/* BUILD: 1779502473 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── PROJECT 3 BRAND PALETTE ──────────────────────────────────────
   Extracted from logo: deep navy bg · gold hex accent · teal hex accent · cobalt hex
   ──────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds — deep navy brand */
  --bg: #060d1c;
  --surface: #0d1a30;
  --surface2: #152238;
  --surface3: #1e2e48;
  --border: #253550;

  /* Brand gold — logo hex accent */
  --gold: #e8a820;
  --gold-light: #f5c84a;
  --gold-dim: #a87818;

  /* Brand teal — logo dark hex */
  --teal-brand: #1a7a6e;
  --teal-light: #22a898;
  --teal-dim: #0f4f48;

  /* Brand cobalt — logo blue hex */
  --cobalt: #2855a0;
  --cobalt-light: #3a72cc;

  /* Text */
  --text: #eef2f8;
  --text-secondary: #8fa8c8;
  --text-muted: #4a6080;

  /* Semantic */
  --accent-green: #27c97a;
  --accent-orange: #e8760a;
  --accent-blue: #3a72cc;
  --accent-teal: #22a898;
  --accent-red: #e03e3e;
  --accent-yellow: #e8a820;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
  --nav-h: 64px;
  --sidebar-w: 260px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; width: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 450;
}

/* ── LAYOUT ── */
#app { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

#sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100vh;
  overflow: hidden; transition: transform var(--transition);
  z-index: 100;
}
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#topbar {
  height: var(--nav-h); min-height: var(--nav-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
}

#content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 24px; background: var(--bg);
}

/* ── SIDEBAR ── */
.sidebar-logo {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 15px; color: var(--gold); letter-spacing: 1px;
  margin-bottom: 1px; line-height: 1.2;
}
.sidebar-logo-text p { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.nav-section { padding: 16px 12px 8px; }
.nav-section-label {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); padding: 0 8px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(232,168,32,0.15), rgba(232,168,32,0.04)); color: var(--gold); border-left: 3px solid var(--gold); }
.nav-item .nav-icon { font-size: 16px; width: 22px; text-align: center; }
.nav-item .nav-badge { margin-left: auto; background: var(--gold); color: #000; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-footer .version { font-size: 11px; color: var(--text-muted); }

/* ── TOPBAR ── */
#menu-toggle { background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; padding: 6px; display: none; }
#topbar-title { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--text); flex: 1; }
#topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── CARDS & PANELS ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; color: var(--gold); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: #0a0f1a; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200,169,110,0.3); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); }
.btn-danger { background: rgba(231,76,60,0.15); color: var(--accent-red); border: 1px solid rgba(231,76,60,0.3); }
.btn-danger:hover { background: rgba(231,76,60,0.25); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--surface2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); background: var(--surface2); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: all var(--transition); }
.btn-icon:hover { background: var(--surface3); color: var(--gold); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text-secondary); letter-spacing: 0.5px; margin-bottom: 6px; text-transform: uppercase; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,110,0.1); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--surface2); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.badge-estimate { background: rgba(243,156,18,0.15); color: var(--accent-yellow); }
.badge-active { background: rgba(46,204,113,0.15); color: var(--accent-green); }
.badge-paused { background: rgba(149,165,166,0.15); color: #95a5a6; }
.badge-completed { background: rgba(52,152,219,0.15); color: var(--accent-blue); }
.badge-cancelled { background: rgba(231,76,60,0.15); color: var(--accent-red); }
.badge-draft { background: rgba(243,156,18,0.15); color: var(--accent-yellow); }
.badge-accepted { background: rgba(46,204,113,0.15); color: var(--accent-green); }
.badge-sent { background: rgba(52,152,219,0.15); color: var(--accent-blue); }

/* ── PROGRESS BAR ── */
.progress-track { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal-brand), var(--gold)); border-radius: 3px; transition: width 0.5s ease; }

/* ── PROJECT TYPE CHIPS ── */
.type-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
}
.type-chip.selected { border-color: var(--gold); background: rgba(200,169,110,0.1); color: var(--gold); }

/* ── PROJECT CARDS ── */
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; cursor: pointer;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.project-card.type-construction::before { background: linear-gradient(90deg, #e67e22, #f39c12); }
.project-card.type-consulting::before { background: linear-gradient(90deg, #2980b9, #3498db); }
.project-card.type-it::before { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.project-card.type-landscaping::before { background: linear-gradient(90deg, #16a085, #1abc9c); }
.project-card:hover { border-color: var(--gold-dim); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.project-card-name { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--text); }
.project-card-client { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.project-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ── STAT CARDS ── */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 28px; color: var(--gold); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.stat-change { font-size: 12px; margin-top: 6px; }

/* ── ESTIMATE LINE ITEMS ── */
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th {
  font-weight: 700;
  padding: 10px 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); background: var(--surface2);
  text-align: left; border-bottom: 1px solid var(--border);
}
.line-items-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; font-weight: 500; }
.line-items-table tr:hover td { background: rgba(255,255,255,0.02); }
.line-items-table input, .line-items-table select {
  background: transparent; border: none; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px; width: 100%;
}
.line-items-table input:focus, .line-items-table select:focus { outline: 1px solid var(--gold); border-radius: 4px; }
.line-items-table select option { background: var(--surface2); }

/* ── TASKS KANBAN ── */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kanban-col-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 12px; font-weight: 600; }
.task-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; cursor: pointer;
  transition: all var(--transition);
}
.task-card:hover { border-color: var(--gold-dim); }
.task-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.task-meta { font-size: 11px; color: var(--text-muted); }
.priority-high { border-left: 3px solid var(--accent-red); }
.priority-medium { border-left: 3px solid var(--accent-yellow); }
.priority-low { border-left: 3px solid var(--accent-green); }

/* ── MILESTONES ── */
.milestone-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.milestone-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.milestone-check.done { border-color: var(--accent-green); background: rgba(46,204,113,0.15); }
.milestone-check.done::after { content: '✓'; color: var(--accent-green); font-size: 12px; }
.milestone-title { font-size: 14px; font-weight: 500; flex: 1; }
.milestone-title.done { text-decoration: line-through; color: var(--text-muted); }

/* ── PHOTOS GRID ── */
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.photo-thumb:hover img { transform: scale(1.05); }
.photo-caption { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.6); padding: 4px 8px; font-size: 10px; color: #fff; }
.photo-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer; transition: all var(--transition);
  color: var(--text-muted);
}
.photo-upload-area:hover { border-color: var(--gold); color: var(--gold); }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 600px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
  transition: all var(--transition); margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── TOAST ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  box-shadow: var(--shadow); animation: toast-in 0.2s ease;
  display: flex; align-items: center; gap: 10px; min-width: 200px;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }
.toast-info { border-left: 3px solid var(--gold); }

/* ── EMPTY STATES ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── SEARCH ── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; flex: 1; max-width: 320px;
}
.search-bar input { background: none; border: none; color: var(--text); font-size: 14px; flex: 1; }
.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--text-muted); }

/* ── PRICING SEARCH RESULT ── */
.pricing-result-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px; }
.pricing-result-name { font-size: 14px; color: var(--text); font-weight: 500; }
.pricing-result-price { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--gold); margin: 4px 0; }
.pricing-result-meta { font-size: 12px; color: var(--text-muted); }
.ai-badge { background: linear-gradient(135deg, rgba(200,169,110,0.2), rgba(41,128,185,0.2)); border: 1px solid var(--gold-dim); color: var(--gold); padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; letter-spacing: 1px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-family: 'Playfair Display', serif; font-size: 24px; color: var(--text); }
.page-header-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── MOBILE / TABLET responsive ── */
@media (max-width: 900px) {
  #sidebar { position: fixed; top: 0; left: 0; transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #menu-toggle { display: block; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .modal { max-height: 95vh; }
}

/* ── NOTES ── */
.note-item { background: var(--surface2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; }
.note-content { font-size: 14px; line-height: 1.5; }
.note-date { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── TOTALS TABLE ── */
.totals-panel { background: var(--surface2); border-radius: var(--radius-sm); padding: 16px; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totals-row.grand { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold); }

/* ── LOADING ── */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BUILDING PLANS ── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.plan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.plan-card:hover { border-color: var(--gold-dim); transform: translateY(-1px); box-shadow: var(--shadow); }
.plan-card-icon { font-size: 32px; margin-bottom: 8px; text-align: center; }
.plan-card-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.plan-card-meta { font-size: 11px; color: var(--text-muted); }
.plan-card-status { position: absolute; top: 8px; right: 8px; }
.plan-type-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.plan-type-btn {
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.plan-type-btn.active { background: rgba(232,168,32,0.12); border-color: var(--gold); color: var(--gold); }
.plan-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; cursor: pointer;
  transition: all var(--transition); color: var(--text-muted);
  margin-bottom: 20px;
}
.plan-upload-zone:hover, .plan-upload-zone.dragover { border-color: var(--gold); color: var(--gold); background: rgba(232,168,32,0.04); }
.plan-upload-zone .upload-icon { font-size: 36px; margin-bottom: 8px; }
.plan-detail-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.plan-preview { width: 100%; border-radius: var(--radius-sm); background: var(--surface2); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.plan-preview img { width: 100%; height: auto; display: block; }
.plan-preview iframe { width: 100%; height: 500px; border: none; }
.plan-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── AI ASSISTANT ── */
.ai-chat-container {
  display: flex; flex-direction: column; height: calc(100vh - 180px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ai-chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2);
}
.ai-chat-header-left { display: flex; align-items: center; gap: 10px; }
.ai-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-brand), var(--cobalt));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; flex-shrink: 0;
}
.ai-title { font-size: 15px; font-weight: 600; color: var(--text); }
.ai-subtitle { font-size: 11px; color: var(--text-muted); }
.ai-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 90%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.msg.user .msg-avatar { background: var(--gold); color: #000; font-weight: 600; }
.msg.assistant .msg-avatar { background: linear-gradient(135deg, var(--teal-brand), var(--cobalt)); color: white; }
.msg-bubble {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.6; max-width: 100%;
}
.msg.user .msg-bubble {
  background: var(--gold); color: #0a1020;
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}
.msg.assistant .msg-bubble {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
}
.msg.assistant .msg-bubble ul, .msg.assistant .msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.msg.assistant .msg-bubble li { margin-bottom: 3px; }
.msg.assistant .msg-bubble strong { color: var(--gold-light); }
.msg.assistant .msg-bubble p { margin-bottom: 8px; }
.msg.assistant .msg-bubble p:last-child { margin-bottom: 0; }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; text-align: right; }
.ai-typing {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 12px; color: var(--text-muted);
}
.typing-dots { display: flex; gap: 3px; }
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); animation: dot-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 0%,80%,100%{transform:scale(0.8);opacity:0.4} 40%{transform:scale(1.1);opacity:1} }
.ai-quick-prompts {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 6px; flex-wrap: wrap; background: var(--surface2);
}
.quick-btn {
  padding: 5px 10px; border-radius: 16px; font-size: 11px;
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.quick-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(232,168,32,0.08); }
.ai-chat-input-area {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
}
.ai-chat-input {
  flex: 1; padding: 10px 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 14px; resize: none; min-height: 42px; max-height: 120px;
  line-height: 1.5;
}
.ai-chat-input:focus { outline: none; border-color: var(--gold); }
.ai-send-btn {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--gold); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all var(--transition); flex-shrink: 0;
}
.ai-send-btn:hover { background: var(--gold-light); transform: scale(1.05); }
.ai-send-btn:disabled { background: var(--surface3); cursor: not-allowed; transform: none; }
.ai-context-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, rgba(26,122,110,0.2), rgba(40,85,160,0.2));
  border: 1px solid var(--teal-dim); color: var(--teal-light);
  padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.5px;
}
.ai-welcome {
  text-align: center; padding: 30px 20px; color: var(--text-secondary);
}
.ai-welcome .ai-welcome-icon { font-size: 40px; margin-bottom: 10px; }
.ai-welcome h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.ai-welcome p { font-size: 13px; line-height: 1.6; max-width: 400px; margin: 0 auto; }

/* ── SYNC STATUS INDICATOR ── */
#sync-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; border: 1.5px solid; white-space: nowrap;
  background: rgba(255,255,255,0.08);
}
#sync-indicator.idle    { color: #a0b4d0; border-color: rgba(160,180,208,.4); }
#sync-indicator.syncing { color: #7aabdc; border-color: rgba(58,114,204,.6); background: rgba(58,114,204,.15); }
#sync-indicator.success { color: #27c97a; border-color: rgba(39,201,122,.5); background: rgba(39,201,122,.1); }
#sync-indicator.error   { color: #e57373; border-color: rgba(224,62,62,.5); background: rgba(224,62,62,.1); }
#sync-indicator.offline { color: #e8a820; border-color: rgba(232,168,32,.5); background: rgba(232,168,32,.1); }
#sync-indicator:hover   { background: rgba(255,255,255,0.15) !important; }
#sync-indicator .sync-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
#sync-indicator.idle .sync-dot    { background: #a0b4d0; }
#sync-indicator.syncing .sync-dot { background: #7aabdc; animation: sync-pulse 1s infinite; }
#sync-indicator.success .sync-dot { background: #27c97a; }
#sync-indicator.error .sync-dot   { background: #e57373; }
#sync-indicator.offline .sync-dot { background: #e8a820; }
@keyframes sync-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.sync-popover {
  position: fixed; top: 58px; right: 16px; z-index: 1000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); font-size: 12px;
}
.sync-popover-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.sync-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,.04); }
.sync-row:last-child { border-bottom: none; }
.sync-row .val { color: var(--text); }

/* ── NOTIFICATION BELL ── */
.notif-bell-wrap { position: relative; }
.notif-bell {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; transition: all var(--transition);
  color: var(--text-secondary);
}
.notif-bell:hover { background: var(--surface3); color: var(--gold); border-color: var(--gold-dim); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent-red); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--surface);
  animation: badge-pop 0.3s ease;
}
@keyframes badge-pop { 0%{transform:scale(0)} 70%{transform:scale(1.2)} 100%{transform:scale(1)} }

/* ── INBOX PANEL ── */
.inbox-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 500; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
.inbox-panel.open { transform: translateX(0); }
.inbox-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); flex-shrink: 0;
}
.inbox-header h3 { font-family: 'Playfair Display', serif; font-size: 17px; color: var(--text); }
.inbox-actions { display: flex; align-items: center; gap: 8px; }
.inbox-list { flex: 1; overflow-y: auto; }
.inbox-item {
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer; transition: background var(--transition);
  display: flex; gap: 12px; align-items: flex-start;
}
.inbox-item:hover { background: var(--surface2); }
.inbox-item.unread { background: rgba(232,168,32,.04); }
.inbox-item.unread::before { content: ''; width: 4px; background: var(--gold); position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 2px 2px 0; }
.inbox-item { position: relative; }
.inbox-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.inbox-content { flex: 1; min-width: 0; }
.inbox-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.inbox-body { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-time { font-size: 10px; color: var(--text-muted); }
.inbox-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.inbox-empty .empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ── EMAIL COMPOSE ── */
.email-compose {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.email-compose-header {
  background: var(--surface2); padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.email-compose-title { font-size: 14px; font-weight: 600; color: var(--text); }
.email-template-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.email-template-chip {
  padding: 5px 12px; border-radius: 16px; font-size: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.email-template-chip:hover,
.email-template-chip.active { background: rgba(232,168,32,.12); border-color: var(--gold); color: var(--gold); }
.email-log-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px;
}
.email-log-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.email-log-status.sent { background: var(--accent-green); }
.email-log-status.failed { background: var(--accent-red); }

/* ── SETTINGS PAGE ── */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px; color: var(--gold); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.04);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 14px; color: var(--text); }
.settings-row-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--surface3); border: none; cursor: pointer;
  position: relative; transition: background var(--transition); flex-shrink: 0;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle.on::after { transform: translateX(20px); }

/* Field Designer modal — ensure input text always readable */
input, select, textarea {
  color: var(--text);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
