/* ============================================================
   IT'S THAT WEBSITE GUY — CRM Design Tokens
   Brand: Dark navy + electric purple + gold
   ============================================================ */
:root {
  --navy:          #0A0F1E;   /* page background — matches logo bg */
  --navy-mid:      #0D1B3E;   /* sidebar, dark panels */
  --navy-light:    #162040;   /* cards, elevated surfaces */
  --purple:        #5B4FD9;   /* primary accent — "It's That" script color */
  --purple-light:  #7B6FE8;   /* hover, highlights */
  --purple-dark:   #3D37B0;   /* pressed states */
  --gold:          #F5C518;   /* "GUY" text color — CTA accents */
  --gold-muted:    #C9A010;   /* gold hover/pressed */
  --white:         #FFFFFF;   /* "WEBSITE" bold text */
  --off-white:     #EDF0FA;   /* body text, readable on dark */
  --muted:         #8892B0;   /* secondary text, labels */
  --line:          #1E2D54;   /* borders, dividers */
  --success:       #27A06B;   /* launched, paid, active */
  --warning:       #F5A623;   /* staging, overdue */
  --danger:        #E05050;   /* cancelled, void */
  --info:          #3B9FD9;   /* sent, inquiry */

  /* Pulled straight off the logo's rocket — exhaust flame + nose cone */
  --ember:         #FF6B35;   /* rocket flame — urgency, money owed */
  --ember-dim:     rgba(255,107,53,0.14);
  --rocket-red:    #E23B2E;   /* rocket body red */

  --radius:        6px;
  --radius-lg:     12px;
  --shadow:        0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:     0 4px 24px rgba(0,0,0,0.6);

  --sidebar-width: 240px;
  --topbar-height: 60px;

  /* Three faces, three jobs: headings, prose, and numbers that must align */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-num:     'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Numbers get monospace + tabular figures so dollar columns line up */
.num, .data-table td .num, td.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--navy);
  color: var(--off-white);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { color: var(--gold); }

img { max-width: 100%; }

/* ============ LAYOUT ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--navy-mid);
  border-right: 1px solid var(--line);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--navy-light);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-content {
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ============ SIDEBAR BRAND ============ */
.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============ SIDEBAR NAV ============ */
.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.75rem 1rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--off-white);
  background: rgba(91, 79, 217, 0.1);
  border-left-color: var(--purple);
}

.nav-link.active {
  color: var(--white);
  background: rgba(91, 79, 217, 0.15);
  border-left-color: var(--purple);
}

.nav-link .icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============ TOPBAR ============ */
.topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============ CARDS ============ */
.card {
  background: var(--navy-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--navy-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--purple);
}

.stat-card.gold::before { background: var(--gold); }
.stat-card.success::before { background: var(--success); }
.stat-card.info::before { background: var(--info); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.4rem;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--purple-light);
  margin-top: 0.25rem;
}

/* ============ TABLES ============ */
.table-wrapper {
  overflow-x: auto;
}

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

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}

tbody tr:hover {
  background: rgba(91, 79, 217, 0.06);
}

tbody td {
  padding: 0.875rem 1rem;
  color: var(--off-white);
  vertical-align: middle;
}

tbody td a {
  color: var(--off-white);
  font-weight: 500;
}

tbody td a:hover { color: var(--gold); }

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 0.2em 0.65em;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-lead        { background: rgba(59,159,217,0.15); color: var(--info); }
.badge-active      { background: rgba(39,160,107,0.15); color: var(--success); }
.badge-care-plan   { background: rgba(91,79,217,0.2);   color: var(--purple-light); }
.badge-completed   { background: rgba(39,160,107,0.1);  color: var(--muted); }
.badge-inactive    { background: rgba(128,128,128,0.1); color: var(--muted); }

.badge-inquiry       { background: rgba(59,159,217,0.15); color: var(--info); }
.badge-proposal-sent { background: rgba(245,198,24,0.15); color: var(--gold); }
.badge-in-progress   { background: rgba(91,79,217,0.2);   color: var(--purple-light); }
.badge-staging-review{ background: rgba(245,166,35,0.15); color: var(--warning); }
.badge-launched      { background: rgba(39,160,107,0.15); color: var(--success); }
.badge-on-hold       { background: rgba(128,128,128,0.15); color: var(--muted); }
.badge-cancelled     { background: rgba(224,80,80,0.15);  color: var(--danger); }

.badge-draft    { background: rgba(128,128,128,0.15); color: var(--muted); }
.badge-sent     { background: rgba(59,159,217,0.15);  color: var(--info); }
.badge-paid     { background: rgba(39,160,107,0.15);  color: var(--success); }
.badge-signed   { background: rgba(39,160,107,0.15);  color: var(--success); }
.badge-overdue  { background: rgba(224,80,80,0.15);   color: var(--danger); }
.badge-void     { background: rgba(128,128,128,0.1);  color: var(--muted); }
.badge-paused   { background: rgba(245,166,35,0.15);  color: var(--warning); }
.badge-new      { background: rgba(245,198,24,0.15);  color: var(--gold); }
.badge-contacted{ background: rgba(59,159,217,0.15);  color: var(--info); }
.badge-converted{ background: rgba(39,160,107,0.15);  color: var(--success); }
.badge-archived { background: rgba(128,128,128,0.1);  color: var(--muted); }

.badge-starter  { background: rgba(59,159,217,0.15);  color: var(--info); }
.badge-standard { background: rgba(91,79,217,0.2);    color: var(--purple-light); }
.badge-custom   { background: rgba(245,198,24,0.15);  color: var(--gold); }

.badge-paying-client  { background: rgba(39,160,107,0.15); color: var(--success); }
.badge-free-gift-new  { background: rgba(59,159,217,0.15); color: var(--info); }
.badge-free-gift-built{ background: rgba(91,79,217,0.2);   color: var(--purple-light); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--purple-light);
  color: var(--white);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover {
  background: var(--gold-muted);
  color: var(--navy);
}

.btn-outline {
  background: transparent;
  color: var(--off-white);
  border: 1px solid var(--line);
}
.btn-outline:hover {
  border-color: var(--purple);
  color: var(--purple-light);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover {
  opacity: 0.85;
  color: var(--white);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* ============ FORMS ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.form-full { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="password"],
select,
textarea {
  background: var(--navy-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--off-white);
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(91, 79, 217, 0.15);
}

select option { background: var(--navy-mid); color: var(--off-white); }
textarea { resize: vertical; min-height: 100px; }

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--purple);
}

.checkbox-group label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.875rem;
  color: var(--off-white);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
}

.page-header-left p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============ FILTER BAR ============ */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar a {
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all 0.15s;
}

.filter-bar a:hover,
.filter-bar a.active {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.search-form input {
  width: 200px;
  padding: 0.35rem 0.75rem;
}

/* ============ ALERTS ============ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-error { background: rgba(224,80,80,0.1); border-color: var(--danger); color: #ff9999; }
.alert-success { background: rgba(39,160,107,0.1); border-color: var(--success); color: #80ffba; }
.alert-info { background: rgba(59,159,217,0.1); border-color: var(--info); color: #80d4ff; }

/* ============ DETAIL GRID ============ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.detail-row .label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 130px;
  padding-top: 2px;
}

.detail-row .value {
  color: var(--off-white);
  flex: 1;
}

/* ============ SECTION DIVIDER ============ */
.section-divider {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* ============ MINI TABLE ============ */
.mini-table { margin-top: 0.5rem; }
.mini-table table { font-size: 0.82rem; }
.mini-table thead th { padding: 0.5rem 0.75rem; }
.mini-table tbody td { padding: 0.6rem 0.75rem; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.875rem; }

/* ============ LOGIN PAGE ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(91,79,217,0.15) 0%, transparent 70%);
}

.login-card {
  background: var(--navy-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--purple);
}

.login-logo h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  margin-top: 0.75rem;
}

.login-logo p {
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* ============ CONTRACT PRINT ============ */
@media print {
  .sidebar, .topbar, .page-actions, .btn, .form-actions { display: none !important; }
  .main-content { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; color: black; }
  .contract-print-body { font-family: Georgia, serif; color: #111; line-height: 1.7; }
  .contract-print-body h1, .contract-print-body h2 { color: #000; }
  .contract-section { margin-bottom: 1.5rem; page-break-inside: avoid; }
}

.contract-preview {
  background: white;
  color: #111;
  border-radius: var(--radius-lg);
  padding: 2rem;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  max-width: 800px;
}

.contract-preview h1 {
  font-size: 1.3rem;
  text-align: center;
  color: #000;
  margin-bottom: 0.25rem;
}

.contract-preview .contract-subtitle {
  text-align: center;
  color: #444;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.contract-preview h2 {
  font-size: 1rem;
  font-weight: bold;
  color: #111;
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
}

.contract-preview p { margin-bottom: 0.75rem; color: #222; font-size: 0.9rem; }
.contract-preview ul { margin: 0.5rem 0 0.75rem 1.5rem; color: #222; font-size: 0.9rem; }
.contract-preview li { margin-bottom: 0.35rem; }

.contract-sig-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #111;
}

.sig-line {
  border-bottom: 1px solid #555;
  margin: 2rem 0 0.25rem;
  height: 1px;
}

.sig-label { font-size: 0.8rem; color: #555; }

/* ============ MRR HIGHLIGHT ============ */
.mrr-highlight {
  background: linear-gradient(135deg, rgba(91,79,217,0.2), rgba(245,198,24,0.1));
  border: 1px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mrr-highlight .mrr-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
}

.mrr-highlight .mrr-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ============ PUBLIC FORM ============ */
.public-page {
  min-height: 100vh;
  background: var(--navy);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(91,79,217,0.12) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
}

.public-card {
  background: var(--navy-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
}

.public-header {
  text-align: center;
  margin-bottom: 2rem;
}

.public-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  margin-bottom: 1rem;
}

.public-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
}

.public-header p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.4rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .contract-sig-block { grid-template-columns: 1fr; }
}

/* ============================================================
   INVOICE STYLES
   ============================================================ */
.invoice-total-field {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.line-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.line-item-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px 110px 36px;
  gap: 0.5rem;
  align-items: end;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.line-item-row .form-group { margin: 0; }
.li-remove { align-self: flex-end; margin-bottom: 0; }

.invoice-totals {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.invoice-total-row {
  display: flex;
  gap: 2rem;
  justify-content: flex-end;
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 240px;
}

.invoice-total-row span:last-child {
  min-width: 80px;
  text-align: right;
}

.invoice-total-final {
  color: var(--white);
  font-size: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* ============================================================
   STATUS BANNER
   ============================================================ */
.status-banner {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
.status-banner.status-paid     { background: rgba(16,185,129,0.12); color: var(--success); border-color: rgba(16,185,129,0.3); }
.status-banner.status-overdue  { background: rgba(239,68,68,0.12); color: var(--danger);  border-color: rgba(239,68,68,0.3); }
.status-banner.status-sent     { background: rgba(59,130,246,0.12); color: #60a5fa;        border-color: rgba(59,130,246,0.3); }
.status-banner.status-draft    { background: rgba(245,197,24,0.08); color: var(--gold);    border-color: rgba(245,197,24,0.2); }
.status-banner.status-void     { background: var(--navy-light); color: var(--text-muted); }

/* ============================================================
   CARE PLAN DETAIL - MRR HIGHLIGHT CARD
   ============================================================ */
.mrr-highlight-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, var(--navy-light), rgba(91,79,217,0.15));
  border: 1px solid var(--purple);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.mrr-icon { font-size: 2rem; }

.mrr-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.mrr-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

.mrr-amount span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mrr-status-pill {
  margin-left: auto;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.mrr-status-pill.status-active   { background: rgba(16,185,129,0.2); color: var(--success); }
.mrr-status-pill.status-paused   { background: rgba(245,197,24,0.15); color: var(--gold); }
.mrr-status-pill.status-cancelled{ background: rgba(239,68,68,0.15); color: var(--danger); }

/* ============================================================
   DANGER ZONE
   ============================================================ */
.danger-zone {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  background: rgba(239,68,68,0.04);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ============================================================
   DETAIL HELPERS
   ============================================================ */
.detail-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 0;
}

.text-success { color: var(--success); }
.text-muted   { color: var(--text-muted); }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
}

/* ============================================================
   ADDITIONAL BADGE COLORS
   ============================================================ */
.badge-info    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-neutral { background: var(--navy-light); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   INVOICE PRINT ROUTE — Invoice detail page print support
   ============================================================ */
@media print {
  .sidebar, .topbar, .page-header .action-group, .danger-zone { display: none !important; }
  .app-layout { display: block; }
  .main-content { margin: 0; padding: 0; }
  .page-content { padding: 0; }
  body { background: white; color: black; }
}

/* ============================================================
   CLICKABLE ROWS & ROW ACTIONS
   ============================================================ */
.clickable-row:hover {
  background: rgba(91, 79, 217, 0.08) !important;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: nowrap;
}

.row-actions form {
  margin: 0;
  padding: 0;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* ============================================================
   MISSION CONTROL — dashboard, palette, and the details that
   make this feel built rather than generated.
   ============================================================ */

body { font-family: var(--font-body); }

h1, h2, h3,
.page-title, .panel-title, .sidebar-brand-name, .topbar-title {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

/* Small caps eyebrow used above figures */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ---------- Sidebar polish ---------- */
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.sidebar-brand:hover { color: inherit; }
.sidebar-brand img {
  width: 40px; height: 40px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(245,197,24,0.14), 0 4px 14px rgba(0,0,0,0.5);
}
.sidebar-brand-name { font-size: 0.82rem; font-weight: 700; color: var(--white); line-height: 1.25; }
.sidebar-brand-sub {
  font-family: var(--font-num);
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold);
}
.sidebar-signout {
  color: var(--muted); margin-top: 0.35rem; display: inline-block; font-size: 0.74rem;
}
.sidebar-signout:hover { color: var(--danger); }

/* ---------- Cmd+K trigger ---------- */
.cmdk-trigger {
  display: flex; align-items: center; gap: 0.5rem; width: calc(100% - 2rem);
  margin: 0 1rem 0.35rem; padding: 0.5rem 0.65rem;
  background: rgba(0,0,0,0.28); border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; color: var(--muted);
  font-family: var(--font-body); font-size: 0.78rem; text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.cmdk-trigger:hover { border-color: var(--purple); color: var(--off-white); }
.cmdk-trigger-icon { font-size: 0.95rem; }
.cmdk-trigger-text { flex: 1; }
.cmdk-trigger-kbd {
  font-family: var(--font-num); font-size: 0.62rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; color: var(--muted);
}

/* ---------- Command palette ---------- */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,7,16,0.72); backdrop-filter: blur(5px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem;
}
.cmdk-backdrop.open { display: flex; }
.cmdk-panel {
  width: 100%; max-width: 560px;
  background: var(--navy-light); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: cmdkIn 0.14s ease-out;
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cmdk-input-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.cmdk-input-icon { color: var(--muted); font-size: 1.05rem; }
.cmdk-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--white); font-family: var(--font-body); font-size: 0.95rem;
}
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-esc {
  font-family: var(--font-num); font-size: 0.6rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
.cmdk-results { max-height: 340px; overflow-y: auto; padding: 0.35rem; }
.cmdk-hint { padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: 0.82rem; }
.cmdk-row {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: var(--radius);
  color: var(--off-white); text-decoration: none;
}
.cmdk-row.active { background: rgba(91,79,217,0.2); }
.cmdk-row:hover { background: rgba(91,79,217,0.14); color: var(--off-white); }
.cmdk-row-icon { font-size: 1rem; width: 20px; text-align: center; }
.cmdk-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmdk-row-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-row-sub { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-row-kind {
  font-family: var(--font-num); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
.cmdk-foot {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1rem; border-top: 1px solid var(--line);
  font-size: 0.68rem; color: var(--muted); background: rgba(0,0,0,0.2);
}
.cmdk-foot kbd {
  font-family: var(--font-num); font-size: 0.6rem;
  border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-right: 2px;
}
.cmdk-foot-brand { margin-left: auto; font-family: var(--font-display); color: var(--line); }

/* ---------- Flight deck ---------- */
.deck {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 300px at 88% -30%, rgba(91,79,217,0.28), transparent 70%),
    linear-gradient(180deg, #101B3D 0%, var(--navy-light) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.75rem;
  margin-bottom: 1rem;
  min-height: 172px;
  display: flex;
  align-items: center;
}
/* Faint starfield — two dot layers, no image request */
.deck::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 34% 68%, rgba(255,255,255,0.35) 50%, transparent 50%),
    radial-gradient(1.6px 1.6px at 58% 18%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1.1px 1.1px at 74% 54%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1.3px 1.3px at 91% 34%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 22% 84%, rgba(255,255,255,0.28) 50%, transparent 50%);
  opacity: 0.85;
}
.deck-rocket {
  position: absolute; right: 1.1rem; bottom: -2.6rem;
  width: 178px; opacity: 0.2; pointer-events: none;
  transform: rotate(-10deg);
  filter: drop-shadow(0 0 30px rgba(255,107,53,0.6));
  animation: climb 7s ease-in-out infinite;
}
@keyframes climb {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50%      { transform: rotate(-10deg) translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .deck-rocket { animation: none; }
  .cmdk-panel { animation: none; }
}

.deck-grid {
  position: relative; z-index: 1; width: 100%;
  display: grid; grid-template-columns: minmax(210px, 0.85fr) 2fr;
  gap: 2rem; align-items: center;
}
.deck-primary { border-left: 2px solid var(--gold); padding-left: 1rem; }
.deck-figure { display: flex; align-items: baseline; gap: 0.1rem; margin: 0.3rem 0 0.35rem; }
.deck-currency { font-family: var(--font-num); font-size: 1.5rem; font-weight: 500; color: var(--gold); opacity: 0.75; }
.deck-figure .num { font-size: 2.9rem; font-weight: 700; color: var(--white); line-height: 1; }
.deck-meta { display: flex; align-items: center; gap: 0.5rem; }
.deck-meta-label { font-size: 0.74rem; color: var(--muted); }
.delta {
  font-family: var(--font-num); font-size: 0.72rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
}
.delta.up   { color: var(--success); background: rgba(39,160,107,0.14); }
.delta.down { color: var(--ember);   background: var(--ember-dim); }

.deck-readouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; padding-right: 148px; }
.readout {
  display: flex; flex-direction: column; gap: 0.16rem;
  padding: 0.75rem 0.85rem;
  background: rgba(0,0,0,0.24); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.readout-label {
  font-family: var(--font-display); font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted);
}
.readout-value {
  font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-size: 1.25rem; font-weight: 700; color: var(--white); line-height: 1.25;
}
.readout-value small { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.readout-value.gold  { color: var(--gold); }
.readout-value.ember { color: var(--ember); }
.readout-sub { font-size: 0.68rem; color: var(--muted); }

/* ---------- Attention strip ---------- */
.attention {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.6rem 0.9rem; margin-bottom: 1rem;
  background: rgba(255,107,53,0.05);
  border: 1px solid rgba(255,107,53,0.2);
  border-left: 3px solid var(--ember);
  border-radius: var(--radius);
}
.attention-label {
  font-family: var(--font-display); font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ember);
}
.attention-items { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
  font-size: 0.75rem; font-weight: 600; padding: 0.28rem 0.65rem;
  border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  transition: transform 0.12s;
}
.chip:hover { transform: translateY(-1px); }
.chip-gold   { background: rgba(245,197,24,0.12); color: var(--gold);   border-color: rgba(245,197,24,0.3); }
.chip-ember  { background: var(--ember-dim);      color: var(--ember);  border-color: rgba(255,107,53,0.3); }
.chip-purple { background: rgba(91,79,217,0.15);  color: var(--purple-light); border-color: rgba(91,79,217,0.35); }
.chip-gold:hover { color: var(--gold); }
.chip-ember:hover { color: var(--ember); }
.chip-purple:hover { color: var(--purple-light); }

/* ---------- Panels & charts ---------- */
.chart-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1rem;
}
.panel {
  background: var(--navy-light); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.1rem 1.2rem;
  min-width: 0;
}
.panel-wide { grid-column: span 2; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem;
}
.panel-title { font-size: 0.95rem; font-weight: 600; color: var(--white); }
.panel-sub { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.panel-link { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.panel-link:hover { color: var(--gold); }
.panel-tag {
  font-size: 0.68rem; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.panel-empty { font-size: 0.8rem; color: var(--muted); padding: 1.6rem 0; text-align: center; }
.chart-box { position: relative; height: 262px; }
.chart-box-sm { height: 205px; }
/* In the top row both panels share a height, so the small chart fills it */
.chart-row:first-of-type .chart-box-sm { height: 262px; }

/* ---------- Pipeline funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 0.55rem; }
.funnel-row { display: grid; grid-template-columns: 74px 1fr 30px; align-items: center; gap: 0.6rem; }
.funnel-label { font-size: 0.74rem; color: var(--muted); }
.funnel-track { height: 8px; background: rgba(0,0,0,0.32); border-radius: 999px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease-out; }
.f-lead   { background: linear-gradient(90deg, #3B9FD9, #5B4FD9); }
.f-active { background: linear-gradient(90deg, #5B4FD9, #7B6FE8); }
.f-care   { background: linear-gradient(90deg, #C9A010, #F5C518); }
.f-done   { background: linear-gradient(90deg, #1E7A52, #27A06B); }
.funnel-n { font-size: 0.8rem; font-weight: 700; color: var(--white); text-align: right; }
.funnel-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--line);
  font-size: 0.74rem; color: var(--muted);
}
.funnel-foot strong { color: var(--gold); font-size: 0.95rem; }

/* ---------- Activity timeline ---------- */
.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 0.7rem; position: relative; padding-bottom: 0.55rem; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 11px; top: 22px; bottom: 0;
  width: 1px; background: var(--line);
}
.timeline-dot {
  width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.62rem;
  background: var(--navy); border: 1px solid var(--line); z-index: 1;
}
.t-invoice  { border-color: rgba(245,197,24,0.4); }
.t-client   { border-color: rgba(91,79,217,0.5); }
.t-project  { border-color: rgba(59,159,217,0.4); }
.t-contract { border-color: rgba(39,160,107,0.4); }
.t-quote    { border-color: rgba(255,107,53,0.45); }
.timeline-body { display: flex; flex-direction: column; min-width: 0; text-decoration: none; padding-top: 1px; }
.timeline-label {
  font-size: 0.8rem; font-weight: 600; color: var(--off-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timeline-body:hover .timeline-label { color: var(--gold); }
.timeline-meta { font-size: 0.68rem; color: var(--muted); text-transform: capitalize; }

/* ---------- Mini lists ---------- */
.mini-list { list-style: none; display: flex; flex-direction: column; }
.mini-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(30,45,84,0.6);
}
.mini-list li:last-child { border-bottom: none; }
.mini-list a { display: flex; flex-direction: column; min-width: 0; text-decoration: none; }
.mini-name {
  font-size: 0.82rem; font-weight: 600; color: var(--off-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-list a:hover .mini-name { color: var(--gold); }
.mini-sub { font-size: 0.68rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .chart-row { grid-template-columns: 1fr 1fr; }
  .panel-wide { grid-column: span 2; }
}
@media (max-width: 860px) {
  .deck-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .deck-readouts { grid-template-columns: 1fr 1fr; }
  .deck-rocket { width: 140px; opacity: 0.1; right: 0.5rem; }
  .chart-row { grid-template-columns: 1fr; }
  .panel-wide { grid-column: span 1; }
  .deck-figure .num { font-size: 2.2rem; }
}

/* ---------- Keyboard focus (was missing entirely) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .cmdk-row:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Sign-in ---------- */
.login-page { position: relative; overflow: hidden; }
.login-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 26%, rgba(255,255,255,0.45) 50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 42% 72%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1.8px 1.8px at 66% 16%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1.3px 1.3px at 84% 58%, rgba(255,255,255,0.35) 50%, transparent 50%),
    radial-gradient(1.1px 1.1px at 28% 88%, rgba(255,255,255,0.28) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 92% 30%, rgba(255,255,255,0.32) 50%, transparent 50%),
    radial-gradient(900px 520px at 50% 40%, rgba(91,79,217,0.18), transparent 70%);
}
.login-rocket {
  position: absolute; right: 6%; bottom: -60px; width: 300px;
  opacity: 0.13; transform: rotate(-12deg); pointer-events: none;
  filter: drop-shadow(0 0 50px rgba(255,107,53,0.5));
  animation: climb 8s ease-in-out infinite;
}
.login-card { position: relative; z-index: 1; }
.login-logo img {
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(245,197,24,0.16), 0 10px 34px rgba(0,0,0,0.6);
}
.login-logo h1 { font-family: var(--font-display); }
.login-logo p {
  font-family: var(--font-num); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold);
}
@media (max-width: 700px) { .login-rocket { width: 190px; opacity: 0.09; } }

/* Money and dates in tables line up column-to-column */
table td, .data-table td { font-variant-numeric: tabular-nums; }

/* ============================================================
   PREMIUM MODULES — proposals · workflows · meetings · portal
   ============================================================ */

/* ---------- Numbered steps ---------- */
.step-head {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-size: .95rem; font-weight: 600; color: var(--white);
  margin-bottom: .85rem;
}
.step-n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(245,197,24,.12); border: 1px solid rgba(245,197,24,.35);
  color: var(--gold); font-family: var(--font-num); font-size: .7rem; font-weight: 700;
}
.step-sub { font-size: .78rem; color: var(--muted); margin-bottom: .85rem; margin-top: -.5rem; }
.step-sub code {
  background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-num); font-size: .72rem; color: var(--gold);
}

/* ---------- Package presets ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.preset {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .95rem .6rem; border-radius: 10px; cursor: pointer; text-align: center;
  background: var(--navy); border: 2px solid var(--line);
  font-family: var(--font-body); transition: border-color .15s, transform .12s;
}
.preset:hover { border-color: var(--purple); transform: translateY(-1px); }
.preset.on { border-color: var(--gold); background: rgba(245,197,24,.07); }
.preset-icon { font-size: 1.4rem; }
.preset-name { font-size: .78rem; font-weight: 600; color: var(--white); }
.preset-price { font-family: var(--font-num); font-size: .65rem; color: var(--muted); }

/* ---------- Repeatable rows ---------- */
.scope-row {
  display: grid; grid-template-columns: 1.1fr 1.6fr 110px 34px;
  gap: .5rem; align-items: end; margin-bottom: .5rem;
}
.scope-row .form-group { margin: 0; }
.action-row {
  display: grid; grid-template-columns: 200px 1fr 150px 34px;
  gap: .5rem; align-items: end; margin-bottom: .6rem;
  background: var(--navy); border: 1px solid var(--line);
  border-radius: 8px; padding: .7rem;
}
.action-row .form-group { margin: 0; }
@media (max-width: 800px) {
  .scope-row, .action-row { grid-template-columns: 1fr; }
}

/* ---------- Share link strip ---------- */
.share-strip {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  background: var(--navy-light); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.share-url { display: flex; gap: .4rem; margin-top: .35rem; flex-wrap: wrap; }
.share-url input {
  flex: 1; min-width: 240px; background: var(--navy); border: 1px solid var(--line);
  border-radius: 6px; padding: .45rem .7rem; color: var(--gold);
  font-family: var(--font-num); font-size: .78rem; outline: none;
}
.share-stats { display: flex; gap: 1.5rem; margin-left: auto; }
.share-stats b { display: block; font-size: 1rem; color: var(--white); }

/* ---------- Workflows ---------- */
.wf-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .wf-cols { grid-template-columns: 1fr; } }

.wf-item {
  display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between;
  padding: .95rem 0; border-bottom: 1px solid rgba(30,45,84,.6); flex-wrap: wrap;
}
.wf-item:last-child { border-bottom: none; }
.wf-item.off { opacity: .5; }
.wf-main { flex: 1; min-width: 220px; }
.wf-name { font-weight: 600; color: var(--white); font-size: .92rem; }
.wf-paused {
  font-family: var(--font-num); font-size: .55rem; text-transform: uppercase; letter-spacing: .1em;
  background: rgba(136,146,176,.15); color: var(--muted);
  border-radius: 3px; padding: 1px 5px; margin-left: .4rem; vertical-align: middle;
}
.wf-desc { font-size: .76rem; color: var(--muted); margin: .15rem 0 .5rem; }
.wf-chain { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.wf-trigger, .wf-action, .wf-cond {
  font-size: .68rem; padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.wf-trigger { background: rgba(59,159,217,.14); color: #6BB6E8; border: 1px solid rgba(59,159,217,.3); }
.wf-cond    { background: rgba(136,146,176,.1);  color: var(--muted); border: 1px solid var(--line); font-style: italic; }
.wf-action  { background: rgba(91,79,217,.16);   color: var(--purple-light); border: 1px solid rgba(91,79,217,.35); text-transform: capitalize; }
.wf-arrow   { color: var(--gold); font-weight: 700; }
.wf-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.wf-runs { font-size: .72rem; color: var(--muted); }

.run-log {
  list-style: none; margin-top: .35rem; padding-left: .6rem;
  border-left: 1px solid var(--line);
}
.run-log li { font-size: .7rem; color: var(--muted); padding: 1px 0; }

.recipe { padding: .85rem 0; border-bottom: 1px solid rgba(30,45,84,.6); }
.recipe:last-of-type { border-bottom: none; }
.recipe-name { font-size: .85rem; font-weight: 600; color: var(--white); }
.recipe-desc { font-size: .74rem; color: var(--muted); margin: .2rem 0 .5rem; }
.recipe-foot { display: flex; align-items: center; justify-content: space-between; }
.recipe-count { font-family: var(--font-num); font-size: .65rem; color: var(--muted); }

/* ---------- Tasks ---------- */
.task-list { list-style: none; }
.task {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 0; border-bottom: 1px solid rgba(30,45,84,.6);
}
.task:last-child { border-bottom: none; }
.task.done { opacity: .45; }
.task.done .task-title { text-decoration: line-through; }
.task-check {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px;
  border: 1.5px solid var(--line); background: var(--navy);
  color: var(--gold); cursor: pointer; font-size: .7rem; line-height: 1;
}
.task-check:hover { border-color: var(--gold); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: .88rem; color: var(--off-white); font-weight: 500; }
.task-meta { display: block; font-size: .7rem; color: var(--muted); }
.task-late { color: var(--ember); font-weight: 600; }

/* ---------- Meeting room ---------- */
.meet-layout { display: grid; grid-template-columns: 1fr 400px; gap: 1rem; align-items: start; }
@media (max-width: 1150px) { .meet-layout { grid-template-columns: 1fr; } }

.meet-stage {
  position: relative; aspect-ratio: 16 / 9; min-height: 380px;
  background: #06090F; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.meet-stage iframe { border: 0; display: block; }
.meet-prejoin {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: .6rem; padding: 2rem;
  background: radial-gradient(600px 340px at 50% 40%, rgba(91,79,217,.22), transparent 70%);
}
.meet-rocket {
  width: 92px; opacity: .8; margin-bottom: .3rem;
  filter: drop-shadow(0 0 30px rgba(255,107,53,.55));
  animation: climb 7s ease-in-out infinite;
}
.meet-prejoin h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--white); }
.meet-prejoin p { font-size: .84rem; color: var(--muted); max-width: 340px; }
.meet-room-name { font-size: .62rem; color: var(--line); margin-top: .4rem; }

.rec-bar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-top: .7rem; padding: .6rem .85rem;
  background: var(--navy-light); border: 1px solid var(--line); border-radius: var(--radius);
}
.rec-btn {
  display: flex; align-items: center; gap: .45rem;
  background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.4);
  color: var(--ember); border-radius: 999px; padding: .35rem .9rem;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600; cursor: pointer;
}
.rec-btn:hover:not(:disabled) { background: rgba(255,107,53,.2); }
.rec-btn:disabled { opacity: .4; cursor: not-allowed; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }
.rec-btn.live { background: var(--ember); color: #fff; border-color: var(--ember); }
.rec-btn.live .rec-dot { background: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-status { font-size: .76rem; color: var(--muted); flex: 1; min-width: 160px; }
.rec-timer { font-size: .82rem; color: var(--white); }
.save-state { font-size: .68rem; color: var(--muted); font-family: var(--font-num); }
.rec-hint { font-size: .7rem; color: var(--muted); margin-top: .45rem; line-height: 1.5; }

.meet-side {
  background: var(--navy-light); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: 720px;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.tab {
  flex: 1; padding: .7rem .3rem; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--muted);
  font-family: var(--font-body); font-size: .74rem; font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--off-white); }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.tab-body { display: none; padding: 1rem; overflow-y: auto; }
.tab-body.on { display: block; }

.notes-tools { display: flex; gap: .4rem; margin-bottom: .6rem; flex-wrap: wrap; }
.notes-area {
  width: 100%; min-height: 200px; resize: vertical;
  background: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem; color: var(--off-white);
  font-family: var(--font-body); font-size: .85rem; line-height: 1.65; outline: none;
}
.notes-area:focus { border-color: var(--purple); }

.actions-block { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.actions-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.action-list { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.action-list li { display: flex; gap: .35rem; }
.action-list input {
  flex: 1; background: var(--navy); border: 1px solid var(--line); border-radius: 6px;
  padding: .4rem .6rem; color: var(--off-white); font-size: .8rem; outline: none;
}
.action-list input:focus { border-color: var(--gold); }
.action-list button {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--muted); cursor: pointer; padding: 0 .5rem; font-size: .7rem;
}
.action-list button:hover { border-color: var(--danger); color: var(--danger); }

.side-note {
  font-size: .8rem; color: var(--muted); white-space: pre-wrap;
  background: var(--navy); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem .7rem;
}
.side-links { display: flex; gap: .4rem; margin-top: .9rem; flex-wrap: wrap; }
.past-note {
  border-left: 2px solid var(--line); padding-left: .7rem; margin-bottom: .7rem;
}
.past-note a { font-size: .8rem; font-weight: 600; }
.past-note span { font-size: .66rem; color: var(--muted); margin-left: .35rem; }
.past-note p { font-size: .74rem; color: var(--muted); margin-top: .15rem; }

.intake-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.intake-dump {
  background: var(--navy); border: 1px solid var(--line); border-radius: 6px;
  padding: .7rem; font-family: var(--font-num); font-size: .72rem;
  color: var(--off-white); white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto; line-height: 1.7;
}
.script-box {
  background: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem; font-family: var(--font-num); font-size: .74rem;
  color: var(--off-white); white-space: pre-wrap; line-height: 1.8;
  min-height: 260px; max-height: 440px; overflow-y: auto;
}

/* ---------- Portal-side chat inside the CRM ---------- */
.chat-thread {
  display: flex; flex-direction: column; gap: .5rem;
  max-height: 340px; overflow-y: auto; padding-right: .3rem;
}
.cmsg { max-width: 74%; padding: .55rem .8rem; border-radius: 10px; font-size: .84rem; }
.cmsg.theirs { align-self: flex-start; background: var(--navy); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.cmsg.mine   { align-self: flex-end; background: rgba(91,79,217,.22); border: 1px solid rgba(91,79,217,.4); border-bottom-right-radius: 3px; }
.cmsg-who { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .1rem; }
.cmsg-time { font-size: .6rem; color: var(--muted); margin-top: .2rem; }

.appt {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid rgba(30,45,84,.6);
}
.appt:last-child { border-bottom: none; }
.appt-side { text-align: right; flex-shrink: 0; }

/* ---------- Extra badges for the new statuses ---------- */
.badge-accepted, .badge-signed, .badge-confirmed { background: rgba(39,160,107,.15); color: var(--success); }
.badge-declined, .badge-cancelled, .badge-expired { background: rgba(224,80,80,.14); color: var(--danger); }
.badge-viewed, .badge-live { background: rgba(245,197,24,.14); color: var(--gold); }
.badge-scheduled, .badge-requested { background: rgba(59,159,217,.14); color: var(--info); }
.badge-ended { background: rgba(136,146,176,.12); color: var(--muted); }
.badge-premium { background: rgba(255,107,53,.14); color: var(--ember); }

/* Multi-select service chips — shared by client + project forms */
.svc-checks{display:flex;flex-wrap:wrap;gap:.5rem}
.svc-chip{position:relative;cursor:pointer}
.svc-chip input{position:absolute;opacity:0;pointer-events:none}
.svc-chip span{display:block;padding:.5rem .95rem;border:1.5px solid var(--line);border-radius:99px;background:var(--navy-mid);color:var(--off);font-size:.85rem;transition:all .15s;user-select:none}
.svc-chip:hover span{border-color:var(--purple)}
.svc-chip input:checked+span{border-color:var(--gold);background:rgba(245,197,24,.12);color:var(--white);font-weight:600}
.care-plan-tier{display:none;margin-top:.7rem;padding:.8rem;background:var(--navy-mid);border:1px solid var(--line);border-radius:9px}
.care-plan-tier.show{display:block}

/* Small inline stat readouts (tools page, etc.) */
.stat-strip{display:flex;gap:.8rem;flex-wrap:wrap}
.stat-chip{background:var(--navy-mid);border:1px solid var(--line);border-radius:10px;padding:.7rem 1.1rem;display:flex;flex-direction:column;gap:.15rem;min-width:120px}
.stat-chip-label{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.stat-chip-value{font-size:1.25rem;font-weight:700;color:var(--white)}

/* Dashboard upcoming-expenses widget */
.expense-list{display:flex;flex-direction:column}
.expense-row{display:flex;align-items:center;gap:.8rem;padding:.55rem 0;border-bottom:1px solid var(--line);font-size:.88rem}
.expense-row:last-child{border-bottom:none}
.expense-name{flex:1;color:var(--off);font-weight:500}
.expense-date{flex:0 0 auto;font-size:.8rem}
.expense-amt{flex:0 0 auto;color:var(--white);font-weight:600;min-width:64px;text-align:right}

/* Due-date urgency coloring — shared across the Tools list and the Dashboard widget */
.due-urgent{color:var(--ember);font-weight:700}
.due-soon{color:var(--gold);font-weight:600}

/* Care Plan Subscription box on invoices */
.care-plan-box{background:var(--navy-mid);border:1px solid var(--line);border-left:3px solid var(--purple);border-radius:10px;padding:1rem 1.2rem;margin-bottom:1.25rem}
.care-plan-box-head{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:var(--white);font-size:.92rem;margin-bottom:.6rem}
.care-plan-box-head a{font-size:.8rem;font-weight:600;color:var(--purple-light)}
.care-plan-terms{white-space:pre-wrap;font-family:var(--body);font-size:.83rem;color:var(--off);line-height:1.6;background:none;border:none;margin:0}

/* Care Plan box extras: subscription note + next-invoice-expected line (app-side detail view) */
.care-plan-note{background:rgba(245,197,24,.1);border:1px solid rgba(245,197,24,.3);border-radius:7px;padding:.5rem .8rem;font-size:.78rem;color:var(--gold);margin-bottom:.7rem}
.care-plan-next{margin-top:.8rem;padding-top:.7rem;border-top:1px solid var(--line);font-size:.82rem;color:var(--off)}
