﻿/* ============================================================
  portal.css - Shared styles for /login, /dashboard, /admin
  Uses the same CSS variables as main.css
  ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.portal-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.portal-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ── Portal Header ───────────────────────────────────────── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.6rem;
  height: 64px;
  background: rgba(7, 12, 16, 0.92);
  border-bottom: 1px solid rgba(39, 64, 79, 0.7);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.portal-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #f5f1e8;
  font-size: 1rem;
  text-decoration: none;
}

.portal-header .brand-mark {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.portal-header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.portal-user-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.portal-signout-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.portal-signout-btn:hover {
  color: var(--text);
  border-color: var(--brand);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.portal-sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0.7rem;
  gap: 0.2rem;
  overflow-y: auto;
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  z-index: 20;
}

.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.6rem 0.8rem 0.3rem;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 150ms, color 150ms;
  width: 100%;
}

.sidebar-btn .btn-icon {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar-btn:hover {
  background: rgba(47, 176, 115, 0.08);
  color: #c5ffe2;
}

.sidebar-btn.active {
  background: rgba(47, 176, 115, 0.14);
  color: #c5ffe2;
}

.sidebar-btn.active .btn-icon {
  opacity: 1;
}

/* ── Content Area ────────────────────────────────────────── */
.portal-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin-left: 210px;
}

.portal-tab-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 1.8rem 2rem;
  gap: 1.4rem;
}

.portal-tab-panel.active {
  display: flex;
}

.portal-tab-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-green  { background: rgba(47, 176, 115, 0.18); color: #2fb073; }
.badge-gold   { background: rgba(214, 162, 75, 0.18);  color: var(--accent); }
.badge-muted  { background: rgba(156, 178, 187, 0.12); color: var(--muted); }
.badge-admin  { background: rgba(214, 162, 75, 0.22);  color: var(--accent); }

/* ── Inbox ───────────────────────────────────────────────── */
.inbox-layout {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.inbox-thread-list {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.inbox-thread-list-header {
  padding: 0.9rem 1rem 0.6rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-thread-list-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.thread-item {
  padding: 0.9rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(39, 64, 79, 0.5);
  transition: background 150ms;
}

.thread-item:hover {
  background: rgba(47, 176, 115, 0.06);
}

.thread-item.active {
  background: rgba(47, 176, 115, 0.12);
  border-left: 3px solid var(--brand);
}

.thread-item-subject {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.thread-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 0.35rem;
  vertical-align: middle;
}

.inbox-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.inbox-view-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-view-subject {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.msg-bubble {
  max-width: 76%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.msg-bubble.from-admin {
  background: var(--surface-2);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-bubble.from-customer {
  background: rgba(47, 176, 115, 0.14);
  border: 1px solid rgba(47, 176, 115, 0.25);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-bubble-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.inbox-reply {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
}

.inbox-reply textarea {
  flex: 1;
  min-height: 70px;
  max-height: 160px;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 150ms;
}

.inbox-reply textarea:focus {
  border-color: var(--brand);
}

.inbox-reply textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.inbox-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 2rem;
  text-align: center;
}

.inbox-empty-icon {
  font-size: 2.4rem;
  opacity: 0.35;
}

/* ── Documents Tab ───────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 180ms, box-shadow 180ms;
}

.doc-card:hover {
  border-color: rgba(47, 176, 115, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.doc-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.doc-card-filename {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.doc-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.doc-card-notes {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 0.4rem;
  margin-top: 0.2rem;
}

.doc-card-actions {
  margin-top: auto;
  padding-top: 0.6rem;
}

/* ── Users Table ─────────────────────────────────────────── */
.users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.users-table th {
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.users-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(39, 64, 79, 0.4);
  color: var(--text);
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tr:hover td {
  background: rgba(47, 176, 115, 0.04);
}

/* ── Client Cards ────────────────────────────────────────── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 180ms, box-shadow 180ms;
}

.client-card:hover {
  border-color: rgba(47, 176, 115, 0.28);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
}

.client-card-header {
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47, 176, 115, 0.3), rgba(47, 176, 115, 0.1));
  border: 1px solid rgba(47, 176, 115, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}

.client-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.client-card-company {
  font-size: 0.78rem;
  color: var(--muted);
}

.client-card-expand-icon {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 220ms;
}

.client-card.is-open .client-card-expand-icon {
  transform: rotate(180deg);
}

.client-card-body {
  display: none;
  padding: 0 1.2rem 1.2rem;
  border-top: 1px solid var(--line);
  flex-direction: column;
  gap: 1rem;
}

.client-card.is-open .client-card-body {
  display: flex;
}

.client-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-info-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.client-info-value {
  font-size: 0.875rem;
  color: var(--text);
}

.client-docs-section {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.client-docs-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}

.client-doc-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(39, 64, 79, 0.35);
  font-size: 0.82rem;
}

.client-doc-item:last-child {
  border-bottom: none;
}

.client-doc-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* Upload form inside client card */
.client-upload-form {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.client-upload-form-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Email Automations ───────────────────────────────────── */
.email-template-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.email-template-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.email-template-header {
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.email-template-trigger-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.email-template-desc {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  font-weight: 400;
  margin-top: 0.15rem;
}

.email-template-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.email-template-edit-form {
  display: none;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.email-template-edit-form.open {
  display: block;
}

.template-vars-hint {
  font-size: 0.74rem;
  color: var(--muted);
  background: rgba(39, 64, 79, 0.4);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  line-height: 1.6;
}

.template-vars-hint code {
  color: var(--accent);
  background: rgba(214, 162, 75, 0.1);
  border-radius: 3px;
  padding: 0.05rem 0.25rem;
  font-size: 0.8em;
}

/* ── Rich Text Editor ────────────────────────────────────── */
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.35rem 0.5rem;
  background: rgba(11, 31, 18, 0.8);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.rich-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rich-btn:hover {
  background: rgba(47, 176, 115, 0.12);
  border-color: rgba(47, 176, 115, 0.25);
  color: var(--text);
}

.rich-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
}

.rich-editor {
  min-height: 140px;
  padding: 0.75rem 1rem;
  background: rgba(4, 12, 8, 0.6);
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.65;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-editor:focus {
  border-color: rgba(47, 176, 115, 0.45);
}

.rich-editor ul {
  margin: 0.25rem 0;
  padding-left: 1.4rem;
}

/* ── Variable Chips ──────────────────────────────────────── */
.var-insert-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.var-insert-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.var-insert-btn {
  background: rgba(47, 176, 115, 0.1);
  border: 1px solid rgba(47, 176, 115, 0.25);
  border-radius: 4px;
  color: #2fb073;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  transition: background 0.15s, border-color 0.15s;
}

.var-insert-btn:hover {
  background: rgba(47, 176, 115, 0.2);
  border-color: rgba(47, 176, 115, 0.45);
}

.var-chip {
  display: inline-block;
  background: rgba(47, 176, 115, 0.15);
  border: 1px solid rgba(47, 176, 115, 0.35);
  border-radius: 4px;
  color: #2fb073;
  font-size: 0.8em;
  padding: 0.05em 0.4em;
  margin: 0 1px;
  user-select: none;
  white-space: nowrap;
  cursor: default;
}

/* ── Compact portal footer ───────────────────────────────── */
.site-footer--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  padding: 0.9rem 1.6rem;
  border-top: 1px solid rgba(58, 84, 98, 0.25);
  background: var(--bg);
}

.site-footer--compact .footer-compact-brand img {
  height: 28px;
  width: auto;
  display: block;
  opacity: 0.85;
}

.site-footer--compact .footer-compact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.site-footer--compact .footer-compact-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer--compact .footer-compact-links a:hover { color: var(--text); }

.site-footer--compact .footer-compact-links span {
  opacity: 0.35;
}

.site-footer--compact .footer-compact-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.site-footer--compact .footer-compact-right img {
  height: 22px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.7;
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(39, 64, 79, 0.8);
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms;
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 200ms, background 200ms;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(47, 176, 115, 0.35);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: var(--brand);
}

/* ── Form Elements (reused across portal) ────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color 150ms;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
  opacity: 0.55;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239cb2bb' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
}

.form-select option {
  background: var(--surface);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── Buttons inside portal ───────────────────────────────── */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms, border-color 150ms, color 150ms;
}

.btn-sm-primary {
  background: var(--brand);
  color: #062113;
}

.btn-sm-primary:hover {
  background: #25c778;
}

.btn-sm-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-sm-secondary:hover {
  border-color: var(--brand);
  color: var(--text);
}

.btn-sm-danger {
  background: transparent;
  border-color: rgba(220, 80, 80, 0.4);
  color: #e07070;
}

.btn-sm-danger:hover {
  background: rgba(220, 80, 80, 0.1);
}

/* ── Loading / error states ──────────────────────────────── */
.portal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--muted);
  font-size: 0.875rem;
  gap: 0.6rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.portal-error-msg {
  color: #e07070;
  font-size: 0.8rem;
  padding: 0.5rem 0;
}

.portal-success-msg {
  color: #2fb073;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

/* ── Settings ────────────────────────────────────────────── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  max-width: 560px;
}

.settings-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.settings-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.settings-info {
  margin: 0;
}

.settings-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(58, 84, 98, 0.15);
}

.settings-info-row:last-child {
  border-bottom: none;
}

.settings-info-row dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.settings-info-row dd {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  text-align: right;
}

.settings-form .form-group {
  margin-bottom: 0.9rem;
}

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47,176,115,0.13) 0%, transparent 65%),
    var(--bg);
}

.login-box {
  width: min(440px, 100%);
  background: rgba(14,24,30,0.92);
  border: 1px solid rgba(47,176,115,0.18);
  border-radius: 20px;
  padding: 2.6rem 2.2rem 2rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 0;
  backdrop-filter: blur(16px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.8rem;
}
.login-brand-mark {
  width: 220px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ── Tabs ──────────────────────────────────── */
.login-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 4px;
  gap: 3px;
  margin-bottom: 1.6rem;
}
.login-tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 150ms, color 150ms, box-shadow 150ms;
}
.login-tab.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 12px rgba(47,176,115,0.4);
}
.login-tab:hover:not(.active) { color: var(--text); }

/* ── Form ──────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.login-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.login-field input {
  width: 100%;
  padding: 0.82rem 1.1rem;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 180ms, background 180ms, box-shadow 180ms;
  box-sizing: border-box;
}
.login-field input::placeholder { color: rgba(180,200,210,0.35); }
.login-field input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(47,176,115,0.06);
  box-shadow: 0 0 0 3px rgba(47,176,115,0.15);
}
/* Suppress autofill white flash */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px rgba(14,24,30,0.98) inset;
  -webkit-text-fill-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

.login-submit {
  margin-top: 0.4rem;
  width: 100%;
  justify-content: center;
  padding: 0.88rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 10px;
  background: var(--brand);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  box-shadow: 0 4px 18px rgba(47,176,115,0.35);
}
.login-submit:hover:not(:disabled) {
  background: #38cc88;
  box-shadow: 0 6px 24px rgba(47,176,115,0.5);
  transform: translateY(-1px);
}
.login-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.login-error {
  color: #f08080;
  font-size: 0.82rem;
  text-align: center;
  padding: 0.55rem 0.75rem;
  background: rgba(224,112,112,0.1);
  border-radius: 8px;
  border: 1px solid rgba(224,112,112,0.25);
}
.login-error[hidden] { display: none; }

/* ── Divider ───────────────────────────────── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0 1rem;
  color: rgba(160,185,200,0.45);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ── Google button ─────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.96);
  color: #3c4043;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.btn-google:hover {
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

/* ── New thread modal ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 12, 0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.4rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-page { padding: 1rem 0.5rem; }
  .login-box { padding: 1.8rem 1.2rem; border-radius: 14px; }
  .login-brand-mark { width: 180px; }
}

@media (max-width: 860px) {
  .portal-sidebar {
    width: 56px;
    min-width: 56px;
    padding: 0.8rem 0.4rem;
    align-items: center;
  }

  .portal-content {
    margin-left: 56px;
  }

  .sidebar-label,
  .sidebar-btn span:not(.btn-icon) {
    display: none;
  }

  .sidebar-btn {
    justify-content: center;
    padding: 0.7rem;
    width: 40px;
  }

  .inbox-thread-list {
    width: 220px;
    min-width: 180px;
  }
}

@media (max-width: 600px) {
  .portal-tab-panel {
    padding: 1rem;
  }

  .inbox-layout {
    flex-direction: column;
    border-radius: 10px;
  }

  .inbox-thread-list {
    width: 100%;
    min-width: unset;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .login-form-row {
    grid-template-columns: 1fr;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   ANALYTICS DASHBOARD
   ═══════════════════════════════════════════════════════ */

/* Header row */
.an-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.2rem;
}

.an-header-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Range toggle buttons */
.an-range-btns {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
}

.an-range-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, background 150ms;
  letter-spacing: 0.03em;
}

.an-range-btn:hover {
  color: var(--text);
  border-color: var(--brand);
}

.an-range-btn.active {
  background: rgba(47, 176, 115, 0.12);
  border-color: var(--brand);
  color: var(--brand);
}

/* Loading state */
.an-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.8rem 0;
}

/* ── KPI Cards ─────────────────────────────────────────── */
.an-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
}

.an-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--kc, var(--brand));
  border-radius: 10px;
  padding: 1rem 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: relative;
  overflow: hidden;
  transition: transform 150ms, box-shadow 150ms;
}

.an-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--kc, var(--brand)) 0%, transparent 70%);
  opacity: 0.04;
  pointer-events: none;
}

.an-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.an-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.an-kpi-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.an-kpi-trend {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.an-kpi-up   { color: var(--brand); background: rgba(47, 176, 115, 0.12); }
.an-kpi-down { color: #e8715a;      background: rgba(232, 113, 90, 0.12); }
.an-kpi-flat { color: var(--muted); background: rgba(164, 184, 173, 0.08); }

.an-kpi-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--kc, var(--brand));
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.an-kpi-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.1rem;
}

.an-kpi-sub {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.65;
  margin-top: 0.15rem;
}

/* ── Chart layout ─────────────────────────────────────── */
.an-chart-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.an-chart-wide   { flex: 2 1 320px; min-width: 0; }
.an-chart-narrow { flex: 1 1 180px; min-width: 0; }
.an-chart-half   { flex: 1 1 240px; min-width: 0; }

.an-chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.an-chart-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
}

.an-chart-sub {
  font-size: 0.73rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  margin-top: 0.15rem;
}

.an-canvas-wrap {
  position: relative;
  width: 100%;
}

.an-canvas-wrap canvas {
  display: block;
  width: 100% !important;
}

/* ── Donut legend ─────────────────────────────────────── */
.an-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.an-leg-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--text);
}

.an-leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.an-leg-n {
  margin-left: auto;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ── Activity feed event badges ───────────────────────── */
.an-event-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ec, var(--muted));
  background: color-mix(in srgb, var(--ec, var(--muted)) 14%, transparent);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* ── Google Analytics notice ──────────────────────────── */
.an-ga-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(47, 176, 115, 0.05);
  border: 1px dashed rgba(47, 176, 115, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── GA4 Section divider ──────────────────────────────── */
.ga4-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.ga4-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Status pill */
.ga4-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(214,162,75,0.08);
  border: 1px solid rgba(214,162,75,0.28);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #d6a24b;
  white-space: nowrap;
}

.ga4-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6a24b;
  animation: ga4-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ga4-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* GA4 connected state */
.ga4-status-pill.ga4-connected {
  background: rgba(47,176,115,0.1);
  border-color: rgba(47,176,115,0.35);
  color: var(--brand);
}
.ga4-status-pill.ga4-connected .ga4-dot {
  background: var(--brand);
  animation: none;
}

/* GA4 banner */
.ga4-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(214,162,75,0.05);
  border: 1px dashed rgba(214,162,75,0.22);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.ga4-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ga4-banner-title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.ga4-banner-body {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Sample badge */
.ga4-sample-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #d6a24b;
  background: rgba(214,162,75,0.1);
  border: 1px solid rgba(214,162,75,0.2);
  border-radius: 4px;
  padding: 0.1rem 0.42rem;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

/* GA4 card head (title + badge row) */
.ga4-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0;
}

.ga4-kpi-row {
  margin-top: 0.2rem;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .an-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .an-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .an-chart-wide,
  .an-chart-narrow,
  .an-chart-half {
    flex: 1 1 100%;
  }
  .an-header {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ============================================================
   NEW COMPONENTS — subscribe modal, user groups, email campaigns
   ============================================================ */

/* ── Subscribe Modal (homepage) ─────────────────────────── */
.subscribe-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 5, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.subscribe-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.subscribe-modal {
  background: #0d1a12;
  border: 1px solid rgba(47, 176, 115, 0.25);
  border-radius: 16px;
  padding: 2rem 2rem 1.6rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease;
  position: relative;
}
.subscribe-modal-overlay.open .subscribe-modal {
  transform: translateY(0) scale(1);
}
.subscribe-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #6b8a78;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.subscribe-modal-close:hover { color: #e8f1ea; }
.subscribe-modal-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d6a24b;
  margin-bottom: 0.4rem;
}
.subscribe-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e8f1ea;
  margin: 0 0 0.35rem;
}
.subscribe-modal-sub {
  font-size: 0.83rem;
  color: #6b8a78;
  margin: 0 0 1.4rem;
}
.subscribe-modal .form-group { margin-bottom: 0.9rem; }
.subscribe-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.6rem 0 1.1rem;
}
.subscribe-consent-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #2fb073;
  cursor: pointer;
}
.subscribe-consent-label {
  font-size: 0.76rem;
  color: #6b8a78;
  line-height: 1.45;
  cursor: pointer;
}
.subscribe-modal .btn-sub {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #2fb073;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.subscribe-modal .btn-sub:hover { background: #27a065; }
.subscribe-modal .btn-sub:disabled { opacity: 0.6; cursor: not-allowed; }
.subscribe-msg {
  font-size: 0.82rem;
  margin-top: 0.7rem;
  text-align: center;
}
.subscribe-msg.success { color: #2fb073; }
.subscribe-msg.error   { color: #e8715a; }

/* ── User Group Filter Tabs ──────────────────────────────── */
.user-group-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.user-group-tab {
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(47, 176, 115, 0.25);
  background: transparent;
  color: #6b8a78;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.user-group-tab:hover {
  background: rgba(47, 176, 115, 0.08);
  color: #e8f1ea;
}
.user-group-tab.active {
  background: rgba(47, 176, 115, 0.15);
  border-color: rgba(47, 176, 115, 0.5);
  color: #2fb073;
}
.badge-subscriber  { background: rgba(91,164,212,0.18); color: #5ba4d4; }
.badge-quote       { background: rgba(155,114,207,0.18); color: #9b72cf; }
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

/* ── Email Campaigns Sub-nav ─────────────────────────────── */
.email-section { display: block; }
.email-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e8f1ea;
  margin: 0 0 0.75rem;
}
.campaign-compose-card {
  background: rgba(13, 26, 18, 0.6);
  border: 1px solid rgba(39, 64, 79, 0.4);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}

/* ── Quill editor theming ────────────────────────────────── */
.ql-toolbar.ql-snow {
  background: rgba(7, 12, 16, 0.8);
  border-color: rgba(39, 64, 79, 0.5) !important;
  border-radius: 8px 8px 0 0;
}
.ql-container.ql-snow {
  background: rgba(7, 12, 16, 0.7);
  border-color: rgba(39, 64, 79, 0.5) !important;
  border-radius: 0 0 8px 8px;
  color: #e8f1ea;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 0.875rem;
}
.ql-editor.ql-blank::before {
  color: #6b8a78 !important;
  font-style: normal !important;
}
.ql-snow .ql-stroke { stroke: #6b8a78 !important; }
.ql-snow .ql-fill   { fill:   #6b8a78 !important; }
.ql-snow .ql-picker-label { color: #6b8a78 !important; }
.ql-snow .ql-picker-options {
  background: #0d1a12 !important;
  border-color: rgba(39, 64, 79, 0.5) !important;
}

/* ── Account Tab (Clerk UserProfile) ─────────────────────── */
#clerk-user-profile { width: 100%; max-width: 680px; }
.cl-rootBox { width: 100% !important; }
.cl-card {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}


/* ══════════════════════════════════════════════════════════════
   QUOTE APPLICATION WIZARD  (/quote page)
   ══════════════════════════════════════════════════════════════ */

/* ── Page layout ──────────────────────────────────────────── */
.quote-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(47,176,115,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(214,162,75,0.05) 0%, transparent 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
}
.quote-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}

/* ── Auth gate ─────────────────────────────────────────────── */
.quote-auth-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1.2rem; padding: 4rem 2rem; flex: 1;
}
.quote-auth-gate h2 { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 0; }
.quote-auth-gate p { color: var(--muted); font-size: 0.95rem; max-width: 400px; margin: 0; }

/* ── Progress bar ──────────────────────────────────────────── */
.quote-progress { margin-bottom: 2.4rem; }
.quote-progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; }
.quote-step-name {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}
.quote-step-count {
  font-size: 0.78rem; font-weight: 600;
  background: rgba(214,162,75,0.12); border: 1px solid rgba(214,162,75,0.25);
  color: var(--accent); padding: 0.15rem 0.6rem; border-radius: 999px;
}
.quote-progress-track {
  height: 6px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden;
}
.quote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px rgba(47,176,115,0.4);
}

/* ── Step panels ───────────────────────────────────────────── */
.quote-step { display: none; flex-direction: column; gap: 1.8rem; animation: stepIn 260ms ease both; }
.quote-step.active { display: flex; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.quote-step-title {
  font-size: 1.55rem; font-weight: 800; color: var(--text); margin: 0 0 0.1rem;
  background: linear-gradient(135deg, #e8f4ea, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.quote-step-desc { color: var(--muted); font-size: 0.87rem; margin: 0; line-height: 1.6; }

/* ── Quote Splash — keyframes ─────────────────────────────── */
@keyframes qs-logo-in {
  0%   { opacity: 0; transform: scale(0.82) translateY(18px); }
  65%  { opacity: 1; transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes qs-logo-breathe {
  from { filter: drop-shadow(0 18px 60px rgba(47,176,115,0.65)) drop-shadow(0 6px 20px rgba(0,0,0,0.85)) drop-shadow(0 0 100px rgba(47,176,115,0.2)); }
  to   { filter: drop-shadow(0 22px 80px rgba(47,176,115,0.9))  drop-shadow(0 8px 24px rgba(0,0,0,0.85)) drop-shadow(0 0 130px rgba(47,176,115,0.35)); }
}
@keyframes qs-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qs-divider-grow {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}
@keyframes qs-card-left {
  0%   { opacity: 0; transform: translateX(-70px) translateY(30px) rotate(-10deg) scale(0.82); }
  55%  { opacity: 1; transform: translateX(8px) translateY(-4px) rotate(1.5deg) scale(1.03); }
  75%  { transform: translateX(-3px) translateY(1px) rotate(-0.5deg) scale(0.99); }
  100% { opacity: 1; transform: translateX(0) translateY(0) rotate(0deg) scale(1); }
}
@keyframes qs-card-center {
  0%   { opacity: 0; transform: translateY(70px) scale(0.78); }
  55%  { opacity: 1; transform: translateY(-10px) scale(1.04); }
  75%  { transform: translateY(3px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes qs-card-right {
  0%   { opacity: 0; transform: translateX(70px) translateY(30px) rotate(10deg) scale(0.82); }
  55%  { opacity: 1; transform: translateX(-8px) translateY(-4px) rotate(-1.5deg) scale(1.03); }
  75%  { transform: translateX(3px) translateY(1px) rotate(0.5deg) scale(0.99); }
  100% { opacity: 1; transform: translateX(0) translateY(0) rotate(0deg) scale(1); }
}
@keyframes qs-orb-green {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, -30px) scale(1.15); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes qs-orb-gold {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-30px, 25px) scale(1.1); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ── Quote Splash / Intro screen ────────────────────────────── */
#quote-splash {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 3rem 1.5rem 5rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(47,176,115,0.13) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(214,162,75,0.07) 0%, transparent 55%),
    var(--bg);
  transition: opacity 350ms ease, transform 350ms ease;
}
#quote-splash::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -15%;
  width: 60%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(47,176,115,0.13) 0%, transparent 70%);
  animation: qs-orb-green 12s ease-in-out infinite;
  pointer-events: none;
}
#quote-splash::after {
  content: '';
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: 55%;
  height: 65%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(214,162,75,0.09) 0%, transparent 70%);
  animation: qs-orb-gold 15s ease-in-out infinite;
  pointer-events: none;
}
#quote-splash.qs-splash-exit {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}
.qs-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 780px;
  width: 100%;
  padding: 3rem 2rem;
  gap: 1.75rem;
}
.qs-splash-logo-full {
  width: min(420px, 85vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 60px rgba(47,176,115,0.65)) drop-shadow(0 6px 20px rgba(0,0,0,0.85)) drop-shadow(0 0 100px rgba(47,176,115,0.2));
  animation:
    qs-logo-in 1s cubic-bezier(0.22, 1, 0.36, 1) both,
    qs-logo-breathe 4s 1.4s ease-in-out infinite alternate;
}
.qs-splash-divider {
  width: 60px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform-origin: center;
  animation: qs-divider-grow 0.6s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  margin: -0.5rem 0;
}
.qs-splash-title {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(140deg, #ffffff 20%, #c8f0dc 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.qs-splash-sub {
  font-size: 1.05rem;
  color: #8aaa9e;
  line-height: 1.75;
  margin: -0.5rem 0 0;
  animation: qs-fade-up 0.7s 0.7s ease both;
  max-width: 540px;
}

/* Checklist — no box, clean list with accent lines */
.qs-splash-list-wrap {
  width: 100%;
  text-align: left;
}
.qs-splash-section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(214,162,75,0.2);
  width: 100%;
}
.qs-checklist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.qs-checklist li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #c2d8cc;
  line-height: 1.4;
  padding: 0.85rem 0 0.85rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  overflow: visible;
}
.qs-checklist li:last-child {
  border-bottom: none;
  color: #8aaa9e;
}
.qs-checklist li em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.35rem;
}
/* ── Trust Pillars ───────────────────────────────────────── */
.qs-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  margin: 0.5rem 0;
}
.qs-pillar:nth-child(1) { animation: qs-card-left   1.3s 0.95s cubic-bezier(0.22, 1, 0.36, 1) both; }
.qs-pillar:nth-child(2) { animation: qs-card-center 1.3s 1.3s  cubic-bezier(0.22, 1, 0.36, 1) both; }
.qs-pillar:nth-child(3) { animation: qs-card-right  1.3s 1.65s cubic-bezier(0.22, 1, 0.36, 1) both; }

.qs-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 1.6rem 1.2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  transition: border-color 250ms, background 250ms;
}
.qs-pillar:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(47,176,115,0.25);
}
.qs-pillar--accent:hover {
  border-color: rgba(214,162,75,0.3);
}

.qs-pillar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 0.25rem;
}
.qs-pillar-icon--green {
  background: rgba(47,176,115,0.12);
  color: #2fb074;
  box-shadow: 0 0 20px rgba(47,176,115,0.15);
}
.qs-pillar-icon--gold {
  background: rgba(214,162,75,0.12);
  color: #d6a24b;
  box-shadow: 0 0 20px rgba(214,162,75,0.15);
}

.qs-pillar-stat {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f0ede6;
  line-height: 1;
}
.qs-pillar--accent .qs-pillar-stat {
  color: var(--accent);
}

.qs-pillar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #c2d8cc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qs-pillar-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .qs-pillars { grid-template-columns: 1fr; }
}

/* SVG checkbox icons */
.qs-check-svg {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  overflow: visible;
}

/* Meta badges */
.qs-splash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: -0.5rem;
}
.qs-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a9e90;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* CTA button */
.qs-splash-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.05rem 2.4rem;
  animation: qs-fade-up 0.7s 2.1s ease both;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 32px rgba(47,176,115,0.5), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 220ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 220ms, background 150ms;
}
.qs-splash-btn:hover {
  background: #28c47a;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 16px 44px rgba(47,176,115,0.65), 0 2px 8px rgba(0,0,0,0.3);
}

/* Security / legal note */
.qs-splash-security {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: #4d6b5e;
  animation: qs-fade-up 0.6s 2.3s ease both;
  line-height: 1.65;
  max-width: 480px;
  text-align: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: -0.5rem 0 0;
}
.qs-splash-security a {
  color: #5a8a70;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 150ms;
}
.qs-splash-security a:hover { color: var(--brand); }

/* ── Splash responsive ──────────────────────────────────── */
@media (max-width: 860px) {
  .qs-splash-inner { max-width: 100%; padding: 2.5rem 1.5rem; }
  .qs-pillars { gap: 0.75rem; }
}

@media (max-width: 640px) {
  .qs-splash-inner { padding: 2rem 1.25rem; gap: 1.4rem; }
  .qs-splash-logo-full { width: min(300px, 80vw); }
  .qs-splash-sub { font-size: 0.95rem; }
  .qs-splash-btn { width: 100%; justify-content: center; }

  /* Pillars — full-width stacked, CSS grid interior layout */
  .qs-pillars {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .qs-pillar {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    text-align: left;
    padding: 1.1rem 1rem;
    gap: 0 0.9rem;
  }
  .qs-pillar-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  .qs-pillar-stat {
    grid-column: 2;
    grid-row: 1;
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.15rem;
  }
  .qs-pillar-title {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
  }
  .qs-pillar-desc {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.79rem;
    padding-top: 0.7rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--muted);
  }

  /* Simple fade-in — no fly-in on mobile */
  .qs-pillar:nth-child(1) { animation: qs-fade-up 0.6s 0.9s  ease both; }
  .qs-pillar:nth-child(2) { animation: qs-fade-up 0.6s 1.05s ease both; }
  .qs-pillar:nth-child(3) { animation: qs-fade-up 0.6s 1.2s  ease both; }
}

/* Section dividers */
.qs-section {
  display: flex; flex-direction: column; gap: 0.9rem;
  padding: 1.3rem; background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 12px;
}
.qs-section:first-child { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 1.3rem; }
.qs-section-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin: 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.qs-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(214,162,75,0.3), transparent);
}

/* Grid helpers */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 580px) {
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

/* Quote-context form label override — brighter than portal default */
.quote-step .form-label {
  color: #c2d8cc;
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Quote-context inputs */
.quote-step .form-input,
.quote-step .form-select,
.quote-step .form-textarea {
  background: rgba(255,255,255,0.09);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: var(--text);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}
.quote-step .form-input::placeholder,
.quote-step .form-textarea::placeholder {
  color: rgba(200,215,208,0.35);
}
.quote-step .form-input:hover,
.quote-step .form-select:hover,
.quote-step .form-textarea:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.22);
}
.quote-step .form-input:focus,
.quote-step .form-select:focus,
.quote-step .form-textarea:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,176,115,0.14), inset 0 1px 3px rgba(0,0,0,0.15);
  outline: none;
}

/* Field validation error state */
.quote-step .form-input.field-error,
.quote-step .form-select.field-error,
.quote-step .form-textarea.field-error {
  border-color: rgba(220,70,70,0.75) !important;
  background: rgba(220,70,70,0.07) !important;
  box-shadow: 0 0 0 3px rgba(220,70,70,0.18), inset 0 1px 3px rgba(0,0,0,0.2) !important;
  animation: field-shake 0.35s ease;
}
.chips-error {
  outline: 2px solid rgba(220,70,70,0.6);
  outline-offset: 6px;
  border-radius: 10px;
  animation: field-shake 0.35s ease;
}
@keyframes field-shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* ── Yes/No toggle rows ─────────────────────────────────────── */
.yn-group {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid rgba(255,255,255,0.07);
  transition: border-left-color 160ms, background 160ms;
}
.yn-group:hover { background: rgba(255,255,255,0.045); }
.yn-label { font-size: 0.875rem; color: #d4e8de; flex: 1; }
.yn-btns { display: flex; gap: 0.4rem; flex-shrink: 0; }
.yn-btn {
  padding: 0.3rem 1rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04); color: #8aaaa0; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 150ms; font-family: inherit;
}
.yn-btn:hover { border-color: var(--brand); color: var(--text); background: rgba(47,176,115,0.08); }
.yn-btn.yn-yes.active {
  background: rgba(47,176,115,0.22);
  border-color: var(--brand);
  color: #6ddba8;
  box-shadow: 0 0 0 1px rgba(47,176,115,0.3);
}
.yn-btn.yn-no.active {
  background: rgba(220,80,70,0.2);
  border-color: rgba(220,80,70,0.55);
  color: #ff8a88;
  box-shadow: 0 0 0 1px rgba(220,80,70,0.25);
}
/* Color the left border based on selection */
.yn-group:has(.yn-btn.yn-yes.active) { border-left-color: var(--brand); background: rgba(47,176,115,0.04); }
.yn-group:has(.yn-btn.yn-no.active)  { border-left-color: rgba(220,80,70,0.6); background: rgba(220,80,70,0.03); }

/* ── Chip checkboxes ────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-label {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.85rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 999px;
  font-size: 0.8rem; color: #8aaaa0; cursor: pointer; transition: all 150ms; user-select: none;
  background: rgba(255,255,255,0.03);
}
.chip-label:hover { border-color: var(--brand); color: var(--text); background: rgba(47,176,115,0.08); }
.chip-label input { display: none; }
.chip-label.checked {
  background: rgba(214,162,75,0.15); border-color: var(--accent); color: var(--accent);
  font-weight: 700; box-shadow: 0 0 0 1px rgba(214,162,75,0.2);
}

/* ── Radio pills ────────────────────────────────────────────── */
.radio-pill-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-pill {
  display: inline-flex; align-items: center; padding: 0.35rem 1rem;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; font-size: 0.82rem;
  color: #8aaaa0; cursor: pointer; transition: all 150ms; user-select: none;
  background: rgba(255,255,255,0.03);
}
.radio-pill:hover { border-color: var(--brand); color: var(--text); background: rgba(47,176,115,0.08); }
.radio-pill input { display: none; }
.radio-pill.checked {
  background: rgba(47,176,115,0.18); border-color: var(--brand); color: #6ddba8;
  font-weight: 700; box-shadow: 0 0 0 1px rgba(47,176,115,0.25);
}

/* ── Data tables (coverage history, claims, coverage limits) ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th {
  text-align: left; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); padding: 0.35rem 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(214,162,75,0.2);
}
.data-table td { padding: 0.3rem 0.25rem; vertical-align: middle; }
.data-table .form-input { padding: 0.38rem 0.55rem; font-size: 0.82rem; }

/* ── Building cards ─────────────────────────────────────────── */
.building-card {
  border: 1px solid rgba(214,162,75,0.2); border-radius: 14px;
  overflow: hidden; margin-bottom: 0.8rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.building-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, rgba(214,162,75,0.1) 0%, rgba(255,255,255,0.025) 100%);
  cursor: pointer; user-select: none;
  border-bottom: 1px solid rgba(214,162,75,0.15);
}
.building-card-title { font-size: 0.9rem; font-weight: 700; color: var(--accent); }
.building-card-chevron { font-size: 0.75rem; color: var(--accent); transition: transform 200ms; opacity: 0.7; }
.building-card.open .building-card-chevron { transform: rotate(180deg); }
.building-card-body {
  padding: 1.4rem; flex-direction: column; gap: 1.3rem;
  background: rgba(255,255,255,0.015); display: none;
}
.building-card.open .building-card-body { display: flex; }
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .coverage-grid { grid-template-columns: 1fr; } }

/* ── N/A toggle ─────────────────────────────────────────────── */
.na-section { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.2rem; }
.na-section label { font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.na-toggle-content { display: flex; flex-direction: column; gap: 1rem; }
.na-toggle-content.hidden { display: none; }

/* ── Repeater rows (add/remove) ─────────────────────────────── */
.repeater-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.repeater-row .form-input { flex: 1; }
.remove-row-btn {
  background: transparent; border: 1px solid rgba(220,80,80,0.3); border-radius: 6px;
  color: #e07070; font-size: 0.75rem; padding: 0.38rem 0.5rem; cursor: pointer;
  flex-shrink: 0; transition: background 150ms; font-family: inherit;
}
.remove-row-btn:hover { background: rgba(220,80,80,0.12); }
.add-row-btn {
  display: inline-flex; align-items: center; gap: 0.3rem; background: transparent;
  border: 1px dashed rgba(47,176,115,0.35); border-radius: 8px; color: var(--brand); font-size: 0.8rem;
  padding: 0.4rem 0.8rem; cursor: pointer; transition: border-color 150ms, background 150ms;
  width: fit-content; font-family: inherit;
}
.add-row-btn:hover { border-color: var(--brand); background: rgba(47,176,115,0.08); }

/* ── Step navigation ────────────────────────────────────────── */
.quote-nav {
  position: sticky; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 2rem;
  padding: 1rem 1.2rem;
  background: rgba(7,15,11,0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.quote-nav-right { display: flex; gap: 0.7rem; align-items: center; }
.quote-save-msg { font-size: 0.78rem; color: var(--brand); opacity: 0; transition: opacity 700ms; }
.quote-save-msg.visible { opacity: 1; }

/* ── Quote form — mobile ─────────────────────────────────────
   Tablet: ≤768px   Phone: ≤480px   Small phone: ≤380px
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .quote-main {
    padding: 1.5rem 1.1rem 5rem;
  }
  .quote-step {
    gap: 1.3rem;
  }
  .quote-step-title {
    font-size: 1.3rem;
  }
  .quote-progress {
    margin-bottom: 1.6rem;
  }
  .qs-section {
    padding: 1.1rem;
    gap: 0.8rem;
  }
  .building-card-body {
    padding: 1rem;
  }
  .quote-nav {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 480px) {
  /* Container */
  .quote-main {
    padding: 1.1rem 0.85rem 4.5rem;
  }

  /* Step header */
  .quote-step-title {
    font-size: 1.15rem;
  }
  .quote-step-desc {
    font-size: 0.82rem;
  }
  .quote-step {
    gap: 1rem;
  }

  /* Progress bar */
  .quote-progress {
    margin-bottom: 1.1rem;
  }
  .quote-progress-label span {
    font-size: 0.75rem;
  }

  /* Section cards */
  .qs-section {
    padding: 0.9rem 0.85rem;
    gap: 0.75rem;
    border-radius: 10px;
  }
  .qs-section-title {
    font-size: 0.67rem;
  }

  /* Yes/No rows — wrap label above buttons on small screens */
  .yn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }
  .yn-label {
    width: 100%;
    font-size: 0.84rem;
  }
  .yn-btns {
    width: 100%;
    justify-content: flex-end;
  }
  .yn-btn {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Chips — bigger touch targets */
  .chip-label {
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
  }

  /* Repeater rows — stack on mobile */
  .repeater-row {
    flex-wrap: wrap;
  }
  .repeater-row .form-input {
    min-width: 0;
  }

  /* Building card */
  .building-card-body {
    padding: 0.85rem 0.75rem;
  }
  .building-card-header {
    padding: 0.7rem 0.9rem;
  }

  /* Sticky nav — keep Back left, Continue right, full width */
  .quote-nav {
    padding: 0.7rem 0.85rem;
    gap: 0.5rem;
  }
  .quote-nav-right {
    gap: 0.5rem;
  }
  .quote-save-msg {
    display: none; /* hide "Saved" label, too cramped */
  }

  /* Buttons — ensure 44px minimum touch target */
  .btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .quote-main {
    padding: 0.9rem 0.7rem 4.5rem;
  }
  .quote-step-title {
    font-size: 1.05rem;
  }
  .qs-section {
    padding: 0.8rem 0.7rem;
  }
  /* Save Draft hidden — show only Back + Continue */
  #save-draft-btn {
    display: none !important;
  }
}

/* ── Status badges ──────────────────────────────────────────── */
.status-draft     { background: rgba(120,120,120,0.15); color: #aaa; border: 1px solid rgba(120,120,120,0.25); }
.status-submitted { background: rgba(47,176,115,0.15); color: var(--brand); border: 1px solid rgba(47,176,115,0.35); }
.status-in_review { background: rgba(214,162,75,0.15); color: #d6a24b; border: 1px solid rgba(214,162,75,0.35); }
.status-quoted    { background: rgba(80,160,220,0.15); color: #5ab0e0; border: 1px solid rgba(80,160,220,0.35); }
.status-closed    { background: rgba(220,80,80,0.12); color: #e07070; border: 1px solid rgba(220,80,80,0.3); }

/* ── Dashboard application summary ─────────────────────────── */
.app-summary-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem;
}
.app-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.app-summary-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.app-summary-meta { font-size: 0.8rem; color: var(--muted); }
.app-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem 1.2rem; margin-top: 0.6rem; }
.app-detail-item label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.12rem; }
.app-detail-item span { font-size: 0.85rem; color: var(--text); }

/* ── Admin applications table ───────────────────────────────── */
.apps-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.apps-table th {
  text-align: left; font-size: 0.71rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.apps-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(42,67,53,0.4); vertical-align: middle; }
.apps-table tr:last-child td { border-bottom: none; }
.apps-table tr:hover td { background: rgba(47,176,115,0.04); }
.apps-table .badge { padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; display: inline-block; }

/* ── Application detail modal ───────────────────────────────── */
.app-modal-overlay {
  position: fixed; inset: 0; background: rgba(4,10,6,0.88); backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem; overflow-y: auto; opacity: 0; pointer-events: none; transition: opacity 200ms;
}
.app-modal-overlay.open { opacity: 1; pointer-events: auto; }
.app-modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 2rem; width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 1.4rem;
}
.app-modal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.app-modal-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 0; }
.app-modal-close { background: transparent; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 6px; transition: color 150ms; }
.app-modal-close:hover { color: var(--text); }
.app-modal-section { border-top: 1px solid var(--line); padding-top: 1rem; }
.app-modal-section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand); margin: 0 0 0.6rem; }
.app-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 0.5rem 1rem; }
.app-modal-field dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.app-modal-field dd { font-size: 0.85rem; color: var(--text); margin: 0 0 0.5rem; }
.app-status-select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 0.82rem; padding: 0.35rem 0.6rem; cursor: pointer; font-family: inherit; }
}