/* ==========================================================================
   DiplomatPay AI - Application Stylesheet (Aurora Glassmorphism Theme)
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.35);

  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-cyan: #06b6d4;

  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 20px 50px -10px rgba(99, 102, 241, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden !important; /* Strictly remove general window scroll in app and site */
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #edf2f7 0%, #e2e8f0 100%);
  background-attachment: fixed;
  color: var(--slate-800);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* App Header / Navigation */
.app-navbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) 10px calc(24px + env(safe-area-inset-left, 0px));
  background: #ffffff;
  border-bottom: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar-left-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.navbar-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  background: var(--primary);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.brand-title {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--slate-900);
}

.brand-title span {
  color: var(--primary);
}

.nav-stats-strip {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.83rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-pill-label {
  color: var(--slate-500);
  font-weight: 500;
}

.stat-pill-val {
  font-weight: 700;
  color: var(--slate-900);
}

.stat-pill-val.overdue {
  color: #dc2626;
}

.stat-pill-action {
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-pill-action:hover {
  background: #eff6ff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Button Styles - Squared, Filled Marker Aesthetic */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px; /* Squared, high-clarity button markers */
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: #4338ca;
  border-color: #3730a3;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.4);
}

.btn-outline {
  background: #ffffff;
  color: var(--slate-800);
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
  color: #0f172a;
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: white;
  color: var(--danger);
  border: 1.5px solid #fca5a5;
  border-radius: 6px;
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: #b91c1c;
  transform: translateY(-1px);
}

.btn-outline-success {
  background: white;
  color: #059669;
  border: 1.5px solid #6ee7b7;
  border-radius: 6px;
}

.btn-outline-success:hover {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  transform: translateY(-1px);
}

.btn-outline-warning {
  background: white;
  color: #d97706;
  border: 1.5px solid #fcd34d;
  border-radius: 6px;
}

.btn-outline-warning:hover {
  background: #d97706;
  color: #ffffff;
  border-color: #b45309;
  transform: translateY(-1px);
}

.btn-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.80rem;
  font-weight: 700;
  border-radius: 6px; /* Squared distinct marker */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-card-toggle.pay {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-card-toggle.pay:hover {
  background: #047857;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(5, 150, 105, 0.35);
}

.btn-card-toggle.reopen {
  background: #d97706;
  color: #ffffff;
  border-color: #b45309;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
}

.btn-card-toggle.reopen:hover {
  background: #b45309;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(217, 119, 6, 0.35);
}

.btn-card-toggle.make-active {
  background: #6366f1;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn-card-toggle.make-active:hover {
  background: #4f46e5;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(99, 102, 241, 0.4);
}

.badge-interactive {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.badge-interactive:hover {
  transform: scale(1.03);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-nav-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-nav-launch:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(79, 70, 229, 0.15);
}

/* Main Container */
.app-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px calc(24px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
}

/* ==========================================================================
   2-TAB WORKSPACE NAVIGATION BAR (Client Invoices vs Sent & Received Emails)
   ========================================================================== */
.workspace-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}

.workspace-tab-panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.workspace-tab-panel.active {
  display: flex !important;
  flex-direction: column !important;
}

.workspace-tabs-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--slate-700);
  font-family: inherit;
  font-size: 0.90rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.workspace-tab-btn:hover:not(.active) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.workspace-tab-btn.active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.workspace-tab-icon {
  font-size: 1.05rem;
}

.workspace-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--slate-200);
  color: var(--slate-700);
}

.workspace-tab-btn.active .workspace-tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.workspace-unread-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: #10b981;
  color: #ffffff;
}

.workspace-tabs-helper {
  font-size: 0.82rem;
  color: var(--slate-500);
  padding-right: 6px;
}

/* 2-Column Application Shell */
.app-shell {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Panel: Invoices & Filter Controls */
.invoices-pane,
.emails-list-pane {
  background: #f8fafc;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
}

.pane-header {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pane-header h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--slate-900);
}

.pane-subtitle {
  display: block;
  font-size: 0.76rem;
  color: var(--slate-500);
  margin-top: 2px;
}

/* Filter Strip */
.filter-bar {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 6px; /* Squared marker filter */
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.filter-chip:hover:not(.active) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.filter-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

.filter-chip.active[data-filter="overdue"] {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.filter-chip.active[data-filter="paid"] {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}

.filter-count {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 5px;
  border-radius: 4px;
  font-size: 0.72rem;
  background: #e2e8f0;
  color: var(--slate-800);
  font-weight: 800;
}

.filter-chip.active .filter-count {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* Search bar */
.search-bar-wrap {
  padding: 10px 18px;
  background: white;
  border-bottom: 1px solid var(--slate-200);
}

.search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   TAB 1: FULL-WIDTH SPACIOUS CLIENT INVOICES VIEW
   ========================================================================== */
/* ==========================================================================
   TAB 1: FULL-WIDTH SPACIOUS CLIENT INVOICES VIEW
   ========================================================================== */
.invoices-full-shell {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.invoices-full-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px;
  background: #f8fafc;
  border-bottom: 1.5px solid #cbd5e1;
  flex-shrink: 0;
}

.invoices-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.invoices-header-left h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.invoices-inline-filters {
  padding: 0;
  border-bottom: none;
  background: transparent;
}

.invoices-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.invoices-search-box {
  width: 300px;
}

.invoices-grid-container {
  padding: 24px;
  background: #edf2f7; /* High-contrast canvas for elevated white invoice cards */
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 220px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  grid-auto-rows: minmax(285px, auto);
  gap: 18px;
  align-content: start;
  align-items: start;
  overflow-y: auto; /* THIS IS THE SCROLL SHOWN IN THE SCREENSHOT */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.invoices-grid-container::-webkit-scrollbar {
  width: 8px;
}

.invoices-grid-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.invoices-grid-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.invoices-grid-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Invoices Scrollable List (Fallback) */
.invoices-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invoice-item-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px; /* Squared, crisp index-card aesthetic */
  padding: 18px 20px 22px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 285px;
  box-sizing: border-box;
  gap: 14px;
  border-left: 6px solid #6366f1; /* Left marker bar */
}

/* Status-specific left marker bars */
.invoice-item-card.status-overdue {
  border-left: 6px solid #dc2626 !important;
}

.invoice-item-card.status-due_today {
  border-left: 6px solid #d97706 !important;
}

.invoice-item-card.status-due_soon {
  border-left: 6px solid #2563eb !important;
}

.invoice-item-card.status-paid {
  border-left: 6px solid #059669 !important;
}

.invoice-item-card.status-sent {
  border-left: 6px solid #4f46e5 !important;
}

.invoice-item-card.invoice-card-inactive {
  border-left: 6px solid #94a3b8 !important;
  background: #f8fafc !important;
  opacity: 0.82;
}

.invoice-item-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px -2px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.invoice-item-card.active {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25), 0 6px 16px rgba(15, 23, 42, 0.08);
}

.invoice-card-top-wrap {
  width: 100%;
}

.invoice-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}

.inv-client-name {
  font-weight: 800;
  font-size: 1.22rem;
  color: #0f172a;
  letter-spacing: -0.015em;
  line-height: 1.25;
  min-height: 2.7rem;
  display: flex;
  align-items: flex-start;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

/* Enlarged, high-legibility top line with invoice number, contact and due date */
.inv-sub-details {
  font-size: 0.95rem; /* Enlarged top line */
  font-weight: 500;
  color: #334155;
  margin-top: 8px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 1.8rem;
  width: 100%;
}

.inv-id-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-weight: 800;
  color: #0f172a;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.inv-sub-dot {
  color: #94a3b8;
  font-weight: 800;
  font-size: 1rem;
}

.inv-contact-item strong,
.inv-due-item strong {
  color: #0f172a;
  font-weight: 700;
}

.inv-amount-tag {
  font-weight: 800;
  font-size: 1.25rem;
  color: #0f172a;
  background: #f8fafc;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

/* Bottom line removed to focus on important information */
.inv-project-title {
  display: none !important;
}

/* Strictly Uniform Card Meta & Action Footers */
.inv-card-meta {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.80rem;
  margin-top: auto;
}

.inv-card-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 28px;
}

.btn-card-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px; /* Squared, filled button marker */
  background: #4f46e5;
  color: #ffffff;
  border: 1px solid #4338ca;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.28);
}

.btn-card-email:hover {
  background: #4338ca;
  color: #ffffff;
  border-color: #3730a3;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.4);
}

/* ==========================================================================
   INVOICE DETAILS POP-UP MODAL (ANTIGRAVITY SETTINGS BLURRED STYLE)
   ========================================================================== */
#invoiceDetailsModal.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#invoiceDetailsModal.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.invoice-details-popup-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 740px;
  width: min(740px, 94vw);
  max-height: 88vh;
  padding: 0 !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

#invoiceDetailsModal.modal-overlay.open .invoice-details-popup-card {
  transform: scale(1);
}

.invoice-popup-header {
  padding: 22px 26px 16px 26px;
  border-bottom: 1.5px solid #e2e8f0;
  background: #ffffff;
  position: relative;
}

.invoice-popup-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-right: 36px;
}

.invoice-popup-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-popup-client-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.invoice-popup-subtitle {
  font-size: 0.86rem;
  color: #64748b;
  margin-top: 4px;
}

.invoice-popup-close-x {
  position: absolute;
  top: 18px;
  right: 20px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1;
  z-index: 10;
}

.invoice-popup-close-x:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.invoice-popup-body {
  padding: 20px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-popup-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .invoice-popup-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.invoice-popup-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.invoice-popup-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.invoice-popup-meta-val {
  font-size: 0.90rem;
  color: #0f172a;
  font-weight: 600;
}

.invoice-popup-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.invoice-popup-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.invoice-popup-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

@media (max-width: 520px) {
  .invoice-popup-grid-2col {
    grid-template-columns: 1fr;
  }
}

.invoice-popup-data-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-popup-data-item .data-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
}

.invoice-popup-data-item .data-val {
  font-size: 0.90rem;
  color: #1e293b;
  word-break: break-word;
}

.invoice-popup-email-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.invoice-popup-email-link:hover {
  text-decoration: underline;
  color: #3730a3;
}

.invoice-popup-project-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.invoice-popup-notes {
  font-size: 0.86rem;
  line-height: 1.5;
  color: #475569;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}

.invoice-popup-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.invoice-popup-items-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1.5px solid #cbd5e1;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.invoice-popup-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.invoice-popup-items-table tr:last-child td {
  border-bottom: none;
}

.invoice-popup-footer {
  padding: 16px 26px;
  border-top: 1.5px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-popup-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-popup-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Integrated Email Thread Card & Client Switcher inside Tab 2 Studio */
.studio-invoice-select {
  padding: 6px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-800);
  background: var(--slate-50);
  cursor: pointer;
  outline: none;
  max-width: 240px;
}

.studio-invoice-select:focus {
  border-color: var(--primary);
}

.integrated-email-thread-card {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-left: 3px solid #10b981;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.thread-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.76rem;
  color: var(--slate-500);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--slate-200);
}

.thread-card-body {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--slate-800);
  white-space: pre-wrap;
  max-height: 135px;
  overflow-y: auto;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}

/* Badges - Squared Standout Markers */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px; /* Squared, clean tag marker */
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.badge-overdue {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #f87171;
}

.badge-due-today {
  background: #fffbeb;
  color: #92400e;
  border: 1.5px solid #f59e0b;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
  animation: pulseAmber 2.5s infinite ease-in-out;
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.badge-due-soon {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1.5px solid #93c5fd;
}

.badge-paid {
  background: #ecfdf5;
  color: #047857;
  border: 1.5px solid #6ee7b7;
}

.badge-draft {
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
}

.badge-marker-recurring {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.badge-marker-autosend {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.badge-marker-reminders {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-marker-scheduled {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-marker-due {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #f59e0b;
}

.badge-marker-snoozed {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-marker-dismissed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.ai-chip {
  background: #ede9fe;
  color: #4338ca;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #a5b4fc;
}

/* In-Card Action Icons - Squared Marker Buttons */
.card-quick-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  justify-content: flex-start !important;
  opacity: 1 !important;
}

.btn-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 6px;
  color: #334155;
  font-size: 0.95rem;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-icon.delete:hover {
  color: #ffffff;
  background: #dc2626;
  border-color: #b91c1c;
}

/* Right Panel: AI Follow-Up Studio */
.studio-pane,
.email-reader-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.studio-header-wrap,
.email-reader-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
}

.studio-header-actions,
.email-reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-title-group h2,
.email-reader-title-group h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--slate-900);
}

.studio-title-group p {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 3px;
}

.studio-content-body,
.email-reader-body-wrap {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

/* Unified Tone & Format Card */
.controls-unified-card {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.stepper-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-600);
}

.ai-recommended-tag {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.tone-selector-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tone-pill-btn {
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.tone-pill-btn:hover {
  border-color: var(--slate-400);
}

.tone-pill-btn.active,
.tone-pill-btn[data-tone].active,
.tone-pill-btn.reply-tpl-btn.active {
  border: 2px solid #7c3aed !important;
  box-shadow: 0 0 0 1px #7c3aed !important;
}

.tone-pill-btn.recommended:not(.active) {
  border: 1.5px dashed #a5b4fc;
}

.tone-pill-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.25;
}

.tone-pill-sub {
  font-size: 0.71rem;
  color: var(--slate-500);
  margin-top: 2px;
  line-height: 1.3;
}

/* Smart Tags Bar in Editor Header */
.smart-tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--slate-200);
}

.smart-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.71rem;
  color: var(--slate-600);
  font-weight: 500;
}

/* Format Toggle: Email vs Chat Snippet */
.format-toggle {
  display: flex;
  background: var(--slate-200);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.format-btn {
  padding: 5px 11px;
  border: none;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.format-btn.active {
  background: #ffffff;
  color: var(--slate-900);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Context Banner (Soft & Calm) */
.context-alert-box {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.81rem;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live Draft Box */
.email-editor-shell {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.editor-header-bar {
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--slate-200);
  font-size: 0.84rem;
}

.editor-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.editor-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-meta-field {
  color: var(--slate-400);
  width: 54px;
  font-weight: 600;
  flex-shrink: 0;
}

.editor-meta-val {
  color: var(--slate-800);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-meta-val input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--slate-900);
  outline: none;
}

.editor-body-textarea {
  width: 100%;
  min-height: 235px;
  padding: 18px;
  border: none;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--slate-800);
  line-height: 1.65;
  resize: vertical;
  outline: none;
}

/* Studio Bottom Actions */
.studio-action-bar {
  padding: 14px 24px;
  border-top: 1px solid var(--slate-200);
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.action-bar-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   TAB 2: SENT & RECEIVED EMAILS LIST & MESSAGE READER
   ========================================================================== */

.emails-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-item-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}

.email-item-card:hover {
  border-color: var(--slate-400);
}

.email-item-card.active {
  border-color: var(--primary);
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.14);
}

.email-item-card.unread {
  border-left: 3px solid #10b981;
}

.email-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.email-direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

.email-direction-badge.sent {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.email-direction-badge.received {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.email-time-label {
  font-size: 0.73rem;
  color: var(--slate-400);
  font-weight: 500;
}

.email-client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.email-client-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-900);
}

.email-inv-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-700);
}

.email-subject-line {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.email-item-card.unread .email-subject-line {
  font-weight: 800;
  color: var(--slate-900);
}

.email-snippet-line {
  font-size: 0.76rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-stage-pill,
.email-method-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

/* Email Envelope & Message Reader */
.email-envelope-card {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 0.83rem;
}

.envelope-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.envelope-label {
  font-weight: 700;
  color: var(--slate-400);
  width: 58px;
  flex-shrink: 0;
}

.envelope-val {
  color: var(--slate-800);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-message-box {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--slate-800);
  white-space: pre-wrap;
  min-height: 210px;
}

.email-quick-reply-card {
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  color: var(--slate-700);
}

.quick-reply-textarea {
  width: 100%;
  min-height: 95px;
  padding: 12px 14px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--slate-800);
  background: #ffffff;
  resize: vertical;
  outline: none;
}

.quick-reply-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.quick-reply-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quick-reply-hint {
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: min(650px, 94vw);
  padding: 28px 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
  position: relative;
  transform: scale(0.96);
  transition: all 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.modal-overlay.open .modal-content-card {
  transform: scale(1);
}

.modal-close-x {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--slate-400);
  cursor: pointer;
  line-height: 1;
}

.modal-close-x:hover {
  color: var(--slate-800);
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--slate-900);
}

.modal-header p {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-full {
  grid-column: span 2;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input, .form-select, .form-textarea {
  padding: 10px 14px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-select {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  background-color: #ffffff;
  cursor: pointer;
}

.form-textarea {
  min-height: 70px;
  resize: vertical;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--slate-200);
}

/* Toast Notice */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--slate-900);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--success);
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .invoices-pane {
    border-right: none;
    border-bottom: 1px solid var(--slate-200);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-full {
    grid-column: span 1;
  }
  .nav-stats-strip {
    display: none;
  }
}

/* ============================================================
   DAY 12: USER ACCOUNT PROFILE & MULTI-TENANT SWITCHER
   ============================================================ */

.user-profile-widget {
  position: relative;
  display: inline-block;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.user-profile-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
  transform: translateY(-1px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.user-nav-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--slate-800);
}

.user-nav-company {
  font-size: 0.72rem;
  color: var(--slate-500);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron {
  font-size: 0.7rem;
  color: var(--slate-400);
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.user-profile-widget.open .dropdown-chevron {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.05);
  padding: 12px;
  z-index: 1000;
  animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--slate-100);
  margin-bottom: 10px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-user-meta strong {
  font-size: 0.92rem;
  color: var(--slate-900);
  line-height: 1.2;
}

.dropdown-user-meta span {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 2px;
  word-break: break-all;
}

.dropdown-user-role {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.7rem !important;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px !important;
  width: fit-content;
}

.dropdown-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  padding: 4px 8px 6px;
}

.demo-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.demo-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.demo-account-item:hover {
  background: var(--slate-50);
  border-color: var(--slate-200);
}

.demo-account-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.demo-account-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-item-text {
  display: flex;
  flex-direction: column;
}

.demo-item-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--slate-800);
}

.demo-item-detail {
  font-size: 0.72rem;
  color: var(--slate-500);
}

.demo-item-check {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
}

.dropdown-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 6px 0;
}

.dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--slate-700);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}

.dropdown-action-btn:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.dropdown-action-btn.text-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* ============================================================
   GMAIL OAUTH 2.0 CONNECT WIDGET STYLES
   ============================================================ */

.gmail-connect-widget {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-outline-gmail {
  background: #fff5f5;
  border: 1.5px solid #ea4335;
  color: #dc2626;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(234, 67, 53, 0.14);
}

.btn-outline-gmail:hover {
  border-color: #c5221f;
  color: #b91c1c;
  background: #fee2e2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 67, 53, 0.22);
}

.btn-outline-gmail.connected {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #15803d;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.16);
}

.btn-outline-gmail.connected:hover {
  background: #dcfce7;
  border-color: #16a34a;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.24);
}

.gmail-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ea4335;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-outline-gmail.connected .gmail-status-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.btn-icon-only {
  padding: 6px 8px;
  min-width: 28px;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1;
}

/* ============================================================
   AUTH MODAL STYLES
   ============================================================ */

.auth-modal-card {
  max-width: 520px;
  padding: 24px;
}

.auth-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-icon-badge {
  font-size: 1.8rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.quick-demo-access-box {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 16px 0;
}

.quick-demo-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-600);
  margin-bottom: 8px;
}

.quick-demo-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-demo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 6px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-demo-btn:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.demo-avatar-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.demo-btn-text strong {
  display: block;
  font-size: 0.76rem;
  color: var(--slate-800);
}

.demo-btn-text span {
  display: block;
  font-size: 0.68rem;
  color: var(--slate-500);
}

.auth-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--slate-200);
  margin-bottom: 16px;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-500);
  padding: 8px 16px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.auth-tab-btn:hover {
  color: var(--slate-800);
}

.auth-tab-btn.active {
  color: var(--primary);
  font-weight: 700;
}

.auth-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.auth-alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.35;
}

.auth-alert-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.auth-alert-box.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* ============================================================
   EMPTY STATES (ZERO INVOICES LEDGER & STUDIO)
   ============================================================ */

.empty-studio-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: 32px;
}

.empty-studio-card {
  text-align: center;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
}

.empty-studio-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-studio-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.empty-studio-card p {
  font-size: 0.88rem;
  color: var(--slate-600);
  line-height: 1.5;
  margin-bottom: 24px;
}

.empty-studio-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-ledger-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--slate-500);
}

.empty-ledger-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  opacity: 0.8;
}

.empty-ledger-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 4px;
}

.empty-ledger-desc {
  font-size: 0.8rem;
  color: var(--slate-500);
  line-height: 1.4;
  margin-bottom: 16px;
}

.empty-ledger-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   DAY 13: EDGE CASE DIAGNOSTIC MODAL & TEST RUNNER
   ============================================================ */

.edge-modal-card {
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.edge-suite-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 16px 0 14px 0;
}

.edge-score-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.edge-score-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
  letter-spacing: 0.05em;
}

.edge-score-pill strong {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

.edge-results-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 6px;
}

.edge-test-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all 0.15s ease;
}

.edge-test-card.pass {
  border-left-color: var(--success);
  background: linear-gradient(to right, rgba(236, 253, 245, 0.4), white 25%);
}

.edge-test-card.fail {
  border-left-color: var(--danger);
  background: linear-gradient(to right, rgba(254, 242, 242, 0.4), white 25%);
}

.edge-test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.edge-test-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--slate-900);
}

.edge-test-icon {
  font-size: 1rem;
}

.edge-category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.edge-test-msg {
  font-size: 0.8rem;
  color: var(--slate-600);
  margin-bottom: 8px;
  line-height: 1.4;
}

.edge-test-details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.76rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-label {
  font-weight: 600;
  color: var(--slate-500);
  margin-right: 4px;
}

.edge-test-details code {
  background: white;
  padding: 1px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  color: #1e293b;
  word-break: break-all;
}

/* ============================================================
   CLEAN SINGLE-EMAIL READER & UNIFIED POPUP COMPOSER WINDOW
   ============================================================ */

.email-reader-only-pane {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  height: 100%;
  overflow: hidden;
}

.email-tab-client-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.client-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-picker-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-700);
}

.client-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-reader-stage {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.clean-email-reader-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  max-width: 900px;
  margin: 0 auto;
}

.clean-reader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.clean-reader-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clean-reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-reader-subject {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 14px;
  line-height: 1.35;
}

.clean-reader-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.83rem;
}

.clean-meta-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.clean-meta-label {
  font-weight: 700;
  color: var(--slate-500);
  flex-shrink: 0;
}

.clean-meta-val {
  color: var(--slate-800);
  font-weight: 500;
  word-break: break-word;
}

.clean-reader-body {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--slate-800);
  white-space: pre-wrap;
  padding: 6px 2px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.clean-reader-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 4px;
}

/* Unified Popup Window (Matches the user's screenshot as ONE unit) */
.composer-popup-window {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  max-width: 920px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 65px -12px rgba(15, 23, 42, 0.28), 0 4px 16px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .composer-popup-window {
  transform: scale(1);
}

.composer-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.composer-header-left h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--slate-900);
}

.composer-header-left p {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.composer-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.composer-close-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--slate-600);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.composer-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.composer-unified-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: #ffffff;
  flex: 1;
}

.composer-popup-window .editor-body-textarea {
  min-height: 180px;
}

/* AI Reply Assistant Box (Inside Received Email Reader) */
.ai-reply-assistant-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-reply-assistant-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-reply-detected-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-reply-sparkle {
  font-size: 0.82rem;
  font-weight: 800;
  color: #065f46;
}

.ai-intent-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #ffffff;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.ai-reply-subtext {
  font-size: 0.78rem;
  color: var(--slate-600);
}

.ai-reply-template-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reply-quick-chip {
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--slate-800);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reply-quick-chip:hover {
  border-color: #4f46e5;
  color: #4f46e5;
  background: #f5f3ff;
  transform: translateY(-1px);
}

/* Customized Reply Templates inside Composer Popup */
.reply-templates-card {
  background: #f0fdf4;
  border-color: #86efac;
}

.composer-client-quote {
  font-size: 0.8rem;
  color: var(--slate-700);
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #10b981;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.45;
}

/* Set Another Email Reminder Button & Callout */
.btn-set-reminder {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
  border: 1px solid #fcd34d;
  font-weight: 700;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.08);
}

.btn-set-reminder:hover {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #92400e;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.18);
}

.reply-quick-chip.reminder-chip {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #b45309;
  font-weight: 700;
}

.reply-quick-chip.reminder-chip:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.reply-set-reminder-callout {
  margin-top: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px dashed #f59e0b;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reply-set-reminder-callout.scheduled {
  background: #fffbeb;
  border: 1px solid #f59e0b;
}

.reply-set-reminder-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reply-reminder-icon {
  font-size: 1.2rem;
}

.reply-set-reminder-left strong {
  display: block;
  font-size: 0.81rem;
  color: var(--slate-900);
}

.reply-set-reminder-left span {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-600);
}

/* Schedule Reminder Bar (Appears with Screenshot 1 when "Set Another Email Reminder" is clicked) */
.schedule-reminder-bar {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-reminder-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-reminder-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-reminder-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d97706;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.schedule-reminder-desc {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
}

.schedule-reminder-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 9px;
  padding: 8px 12px;
}

.schedule-days-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-800);
}

.schedule-days-input {
  width: 58px;
  padding: 4px 8px;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #b45309;
  text-align: center;
  font-family: inherit;
}

.schedule-days-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate-600);
}

.schedule-preset-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.schedule-day-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--slate-700);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.schedule-day-chip:hover {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}

.schedule-day-chip.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

.schedule-target-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-outline-primary {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #a5b4fc;
  font-weight: 700;
}

.btn-outline-primary:hover {
  background: #e0e7ff;
  border-color: #6366f1;
}

/* ============================================================
   APP SETTINGS MODAL STYLES
   ============================================================ */
.settings-modal-card {
  max-width: 650px;
  width: min(650px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.settings-sections-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.settings-section-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--slate-900);
}

.settings-section-desc {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.settings-rows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-toggle-row,
.settings-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  transition: border-color 0.15s ease;
}

.settings-toggle-row {
  cursor: pointer;
}

.settings-toggle-row:hover,
.settings-select-row:hover {
  border-color: #cbd5e1;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.settings-row-info strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--slate-900);
}

.settings-row-info span {
  font-size: 0.76rem;
  color: var(--slate-500);
  line-height: 1.35;
}

/* Modern Toggle Switch Input */
.settings-switch-input {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.settings-switch-input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.settings-switch-input:checked {
  background: #4f46e5;
}

.settings-switch-input:checked::after {
  transform: translateX(18px);
}

.settings-select-input {
  width: auto;
  min-width: 195px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 10px;
}

.settings-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   CLIENT PICKER POPUP MODAL (Choose a Client to Draft Email To)
   ============================================================ */

.client-picker-modal-card {
  max-width: 650px;
  width: min(650px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-sizing: border-box;
}

.client-picker-search-wrap {
  margin-bottom: 12px;
}

.client-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.client-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.client-picker-item:hover {
  border-color: #6366f1;
  background: #f5f3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.client-picker-item.active-client {
  border-color: #818cf8;
  background: #f8fafc;
}

.client-picker-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.client-picker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-picker-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.client-picker-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-picker-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
}

.client-picker-meta {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-picker-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.client-picker-amount {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
}

.client-picker-cta {
  padding: 6px 12px;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #c7d2fe;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.client-picker-item:hover .client-picker-cta {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* ============================================================
   DUE DATE & AUTOMATIC DAYS OVERDUE BANNER IN INVOICE MODAL
   ============================================================ */

.due-date-auto-banner {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  word-break: break-word;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.due-date-auto-banner.is-overdue {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.due-date-auto-banner.is-due-today {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.due-date-auto-banner.is-upcoming {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.due-date-auto-banner.is-paid {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* ============================================================
   TAB 3: AI CHAT & AUTHENTIC VOICE STUDIO
   ============================================================ */

.aichat-pro-badge {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  color: #ffffff !important;
  font-weight: 700;
}

.aichat-shell {
  grid-template-columns: 1fr 410px;
}

.aichat-main-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}

.aichat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.aichat-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.aichat-avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.aichat-header-left h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.aichat-header-left p {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.aichat-voice-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.aichat-voice-status-pill.active-voice {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.aichat-quick-prompts-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  flex-wrap: wrap;
}

.quick-prompts-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aichat-prompt-chip {
  padding: 5px 11px;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.aichat-prompt-chip:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

.aichat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aichat-msg-row {
  display: flex;
  gap: 12px;
  max-width: 86%;
}

.aichat-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.aichat-msg-row.assistant {
  align-self: flex-start;
}

.aichat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.aichat-msg-row.assistant .aichat-msg-avatar {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
}

.aichat-msg-row.user .aichat-msg-avatar {
  background: #1e293b;
  color: #ffffff;
  font-size: 0.78rem;
}

.aichat-msg-bubble {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.aichat-msg-row.assistant .aichat-msg-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-top-left-radius: 4px;
}

.aichat-msg-row.user .aichat-msg-bubble {
  background: #4f46e5;
  color: #ffffff;
  border-top-right-radius: 4px;
  white-space: pre-wrap;
}

.aichat-action-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #4f46e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.aichat-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.71rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.aichat-action-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.aichat-action-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.aichat-draft-preview {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.81rem;
  color: #334155;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.aichat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

/* Attachment Preview Bar above Input */
.aichat-attachment-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px dashed #cbd5e1;
}

.aichat-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  font-size: 0.8rem;
  color: #3730a3;
  font-weight: 600;
}

.aichat-attachment-pill.loading {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.aichat-attachment-pill .attachment-size {
  color: #6366f1;
  font-size: 0.72rem;
  font-weight: 500;
}

.aichat-attachment-pill .attachment-remove-btn {
  background: none;
  border: none;
  color: #4f46e5;
  cursor: pointer;
  padding: 0 3px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aichat-attachment-pill .attachment-remove-btn:hover {
  background: #c7d2fe;
  color: #1e1b4b;
}

.attachment-hint {
  font-size: 0.76rem;
  color: #64748b;
  font-style: italic;
}

/* User Message Attachment Badge */
.aichat-msg-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.76rem;
  color: inherit;
}

/* Drag over active state */
.aichat-dragover {
  border: 2px dashed #4f46e5 !important;
  background-color: rgba(238, 242, 255, 0.7) !important;
}

.aichat-text-input {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.aichat-text-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Right Column: Authentic Voice Studio */
.aichat-voice-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  overflow: hidden;
}

.voice-studio-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.voice-profile-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
}

.voice-profile-card.active-voice {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.voice-profile-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.voice-profile-top-row strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.voice-sample-count-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.voice-learned-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.voice-spec-item {
  font-size: 0.76rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-spec-full {
  grid-column: span 2;
}

.voice-spec-label {
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.voice-spec-item code {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  color: #4f46e5;
  width: fit-content;
}

.voice-patterns-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.voice-pattern-chip {
  padding: 3px 8px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 0.71rem;
  font-weight: 600;
}

.voice-upload-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-upload-header strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
}

.voice-upload-header span {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.4;
}

.voice-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-paste-textarea {
  min-height: 92px;
  font-size: 0.8rem;
}

.voice-samples-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-samples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.voice-samples-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-sample-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.78rem;
}

.voice-sample-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.voice-sample-card-top strong {
  font-size: 0.8rem;
  color: #0f172a;
}

.voice-sample-snippet {
  color: #64748b;
  font-size: 0.74rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   Daily Due-Date Notification Popup Tray (2d Before -> Due Date)
   ========================================================= */

.due-notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.due-notif-bell-btn.has-active-notifs {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.45) 0%, rgba(255, 255, 255, 0.95) 100%);
  color: #b45309;
  font-weight: 700;
}

.due-notif-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d97706;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.due-notif-popup-tray {
  position: fixed;
  top: 66px;
  right: 22px;
  width: 410px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.25), 0 0 0 4px rgba(254, 243, 199, 0.45);
  z-index: 1200;
  overflow: hidden;
  animation: slideInNotifTray 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInNotifTray {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.due-notif-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.due-notif-tray-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #92400e;
}

.due-notif-date-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-size: 0.7rem;
  font-weight: 700;
  color: #b45309;
}

.due-notif-close-btn {
  background: transparent;
  border: none;
  color: #92400e;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.due-notif-close-btn:hover {
  background: rgba(217, 119, 6, 0.12);
}

.due-notif-tray-subtitle {
  padding: 8px 16px;
  background: #fffdf5;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.73rem;
  color: #64748b;
  line-height: 1.4;
}

.due-notif-cards-list {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
}

.due-notif-item-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #fde68a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.due-notif-item-card.due-today {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.due-notif-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.due-notif-headline {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.due-notif-countdown-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: #fef3c7;
  color: #b45309;
  white-space: nowrap;
}

.due-notif-item-card.due-today .due-notif-countdown-tag {
  background: #fee2e2;
  color: #b91c1c;
}

.due-notif-meta {
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.35;
}

.due-notif-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.btn-notif-snooze {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-notif-snooze:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-notif-dismiss {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-notif-dismiss:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-notif-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

.btn-notif-email:hover {
  background: #4338ca;
}

.due-notif-muted-section {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.due-notif-muted-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.73rem;
  color: #64748b;
}

.due-notif-tray-footer {
  padding: 9px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.71rem;
  font-weight: 700;
  border-radius: 6px;
}

/* ==========================================================================
   FREE VS. PAID (PRO) 2-TIER SYSTEM STYLES
   ========================================================================== */

/* 1. Header Navbar Tier Button */
.plan-tier-navbar-btn,
.plan-tier-navbar-btn.free,
.plan-tier-navbar-btn.free-gold,
.plan-tier-navbar-btn.pro,
.plan-tier-navbar-btn.gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: 1px solid #b45309 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.plan-tier-navbar-btn:hover,
.plan-tier-navbar-btn.pro:hover,
.plan-tier-navbar-btn.free:hover,
.plan-tier-navbar-btn.free-gold:hover,
.plan-tier-navbar-btn.gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%) !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.plan-tier-navbar-btn strong,
.plan-tier-navbar-btn b {
  font-weight: 800 !important;
  color: #ffffff !important;
}

.tier-pill-icon {
  font-size: 0.95rem;
}

.tier-pill-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.tier-pill-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tier-pill-sub {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
}

/* 2. Free Tier Notice Banner in Tab 1 */
.free-tier-notice-banner {
  margin: 12px 16px 0 16px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.free-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #92400e;
}

.free-banner-icon {
  font-size: 1.25rem;
}

.free-banner-content strong {
  display: block;
  font-size: 0.82rem;
  color: #78350f;
  margin-bottom: 2px;
}

.tone-selector-5-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}

.tone-pill-personalized {
  position: relative;
  background: #ffffff;
  border: 1.5px solid var(--slate-200);
}

.tone-pill-personalized:hover {
  border-color: var(--slate-400);
}

.tone-pill-personalized.active {
  border: 2px solid #7c3aed !important;
  box-shadow: 0 0 0 1px #7c3aed !important;
}

.pro-chip-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
  color: #a21caf;
  border: 1px solid #f0abfc;
  margin-left: 5px;
  letter-spacing: 0.02em;
}

.tone-pill-personalized.pro-locked {
  opacity: 0.75;
  cursor: pointer;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.tone-pill-personalized.pro-locked .pro-chip-badge {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* 4. Tab 3 Free Paywall Overlay */
.tab-pro-paywall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.paywall-card {
  max-width: 640px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 32px;
  text-align: center;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.paywall-icon-badge {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.paywall-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.paywall-lead {
  font-size: 0.88rem;
  color: var(--slate-600);
  line-height: 1.55;
  margin-bottom: 24px;
}

.paywall-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  text-align: left;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.paywall-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
}

.paywall-feat-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.paywall-feat-item strong {
  display: block;
  color: var(--slate-800);
  margin-bottom: 2px;
}

.paywall-feat-item span {
  color: var(--slate-600);
  line-height: 1.4;
}

.paywall-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 5. Plan Upgrade / Switcher Modal */
.plan-modal-card {
  max-width: 780px !important;
  width: 95% !important;
  padding: 28px !important;
}

.plan-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.plan-header-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-modal-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.plan-modal-header p {
  font-size: 0.85rem;
  color: var(--slate-600);
}

.plan-context-alert {
  margin-bottom: 20px;
  padding: 10px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
}

.plan-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.plan-tier-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.plan-tier-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.plan-tier-card.featured {
  border: 2px solid #6366f1;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}

.plan-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.plan-card-header {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.plan-tier-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 8px;
}

.tier-status-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.tier-status-pill.active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tier-status-pill.pro.active {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.plan-tier-price {
  margin-bottom: 8px;
}

.plan-tier-price .price-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.03em;
}

.plan-tier-price .price-period {
  font-size: 0.85rem;
  color: var(--slate-600);
}

.plan-tier-desc {
  font-size: 0.78rem;
  color: var(--slate-600);
  line-height: 1.45;
}

.plan-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  margin-bottom: 20px;
}

.plan-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--slate-700);
  line-height: 1.35;
}

.plan-feature-item.highlight {
  background: #fdf4ff;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #f0abfc;
  color: #86198f;
}

.plan-feature-item.disabled {
  opacity: 0.55;
  color: var(--slate-400);
}

.feat-check {
  color: #10b981;
  font-weight: 900;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.feat-cross {
  color: #ef4444;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.plan-tier-action-btn {
  width: 100%;
  padding: 10px;
  font-weight: 800;
  font-size: 0.88rem;
}

.plan-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.plan-demo-note {
  font-size: 0.76rem;
  color: var(--slate-600);
}

/* Tab locked badge */
.pro-locked-badge {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

/* ==========================================================================
   AUTOMATIC FOLLOW-UP DRAFT FEATURE STYLES
   ========================================================================== */

.settings-schedule-block {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.settings-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.settings-schedule-desc {
  font-size: 0.78rem;
  color: var(--slate-600);
  margin-bottom: 14px;
}

.auto-draft-tier-pill {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.auto-draft-tier-pill.pro {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.auto-draft-tier-pill.free {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.schedule-window-group {
  margin-bottom: 14px;
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.schedule-window-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-800);
}

.schedule-window-sub {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--slate-500);
}

.schedule-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.schedule-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--slate-700);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.schedule-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
}

.schedule-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25);
}

.schedule-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
}

.schedule-custom-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.free-schedule-warning-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #92400e;
  margin-top: 8px;
}

.free-schedule-warning-box a {
  color: #b45309;
  font-weight: 700;
  text-decoration: underline;
}

/* Auto-Draft Notification Card in Tray */
.auto-draft-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #4f46e5;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.auto-draft-card:hover {
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.1);
  border-color: #818cf8;
}

.auto-draft-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.auto-draft-client-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--slate-900);
}

.auto-draft-meta-line {
  font-size: 0.74rem;
  color: var(--slate-500);
  margin-bottom: 8px;
}

.auto-draft-timing-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  background: #eef2ff;
  color: #4338ca;
  margin-right: 4px;
}

.auto-draft-timing-badge.overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.auto-draft-stage-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.auto-draft-stage-badge.pro {
  background: #ede9fe;
  color: #6d28d9;
}

/* 2-Option Selector in Auto-Draft Card */
.auto-draft-options-wrap {
  margin: 8px 0;
  padding: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
}

.auto-draft-options-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.auto-draft-options-pills {
  display: flex;
  gap: 6px;
}

.auto-draft-opt-btn {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.auto-draft-opt-btn:hover {
  border-color: #818cf8;
  background: #f1f5f9;
}

.auto-draft-opt-btn.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.auto-draft-preview-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--slate-700);
  margin-bottom: 10px;
  line-height: 1.35;
}

.auto-draft-preview-subject {
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.auto-draft-preview-body {
  white-space: pre-line;
  max-height: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--slate-600);
}

.auto-draft-actions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   DAY 15: FIRST-USE ONBOARDING & QUICK-START CHECKLIST
   ========================================================================== */

.onboarding-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
  animation: slideDownOnboarding 0.25s ease-out;
}

@keyframes slideDownOnboarding {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.onboarding-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.onboarding-badge-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-top: 2px;
}

.onboarding-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.onboarding-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--slate-900);
}

.onboarding-progress-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.onboarding-progress-badge.is-all-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.onboarding-subtitle {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 3px;
}

.onboarding-dismiss-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate-400);
  cursor: pointer;
  transition: all 0.15s ease;
}

.onboarding-dismiss-btn:hover {
  background: #f8fafc;
  color: var(--slate-700);
  border-color: #cbd5e1;
}

.onboarding-progress-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin: 14px 0 16px;
}

.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #8b5cf6 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.onboarding-step-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.onboarding-step-item.is-completed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.onboarding-step-status {
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.onboarding-step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.onboarding-step-body strong {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--slate-800);
}

.onboarding-step-item.is-completed .onboarding-step-body strong {
  color: #166534;
}

.onboarding-step-body span {
  font-size: 0.74rem;
  color: var(--slate-500);
  line-height: 1.35;
  margin-bottom: 6px;
}

.onboarding-step-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-connected {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #6ee7b7 !important;
  cursor: default;
}

/* ==========================================================================
   DAY 15: RICH 3-PILLAR EMPTY-LEDGER STATE
   ========================================================================== */

.empty-ledger-rich {
  padding: 36px 20px 44px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.empty-ledger-rich .empty-ledger-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.empty-ledger-rich .empty-ledger-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.empty-ledger-rich .empty-ledger-desc {
  font-size: 0.9rem;
  color: var(--slate-500);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.empty-ledger-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  text-align: left;
}

.empty-option-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

.empty-option-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.1);
}

.empty-opt-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.empty-option-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.empty-option-card p {
  font-size: 0.82rem;
  color: var(--slate-500);
  line-height: 1.45;
  margin-bottom: 18px;
  flex: 1;
}

.empty-option-card .btn {
  align-self: flex-start;
  width: 100%;
  justify-content: center;
}

/* =================================================================
   DAY 17: SUBSCRIPTION CHECKOUT & RECEIPT MODALS (TEST MODE)
   ================================================================= */

.checkout-modal-card {
  max-width: 650px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  padding: 26px !important;
  overflow-x: hidden !important;
}

.checkout-header {
  margin-bottom: 18px;
  text-align: left;
}

.checkout-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #86198f;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checkout-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.checkout-subtitle {
  font-size: 0.82rem;
  color: var(--slate-600);
  line-height: 1.4;
}

/* Billing Interval Selector (Monthly vs Annual) */
.checkout-interval-picker {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 18px;
}

.checkout-interval-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.checkout-interval-btn:hover {
  color: var(--slate-900);
}

.checkout-interval-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.checkout-save-tag {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
}

/* Plan Order Summary Card */
.checkout-order-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.checkout-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--slate-700);
}

.checkout-summary-row.total {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  font-size: 1rem;
  font-weight: 800;
  color: var(--slate-900);
}

.checkout-test-mode-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #b45309;
}

/* Fast Test Card Helper Bar */
.checkout-test-helper-bar {
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.checkout-test-helper-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #9d174d;
}

.checkout-quickfill-btn {
  background: #be185d;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.checkout-quickfill-btn:hover {
  background: #9d174d;
}

/* Checkout Form Inputs */
.checkout-input-group {
  margin-bottom: 14px;
}

.checkout-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 5px;
}

.checkout-card-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.checkout-card-brand-icon {
  position: absolute;
  left: 12px;
  font-size: 1.1rem;
  pointer-events: none;
}

.checkout-input-with-icon {
  padding-left: 40px !important;
  font-family: 'SFMono-Regular', Consolas, monospace !important;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.checkout-row-dual {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 540px) {
  .checkout-row-dual {
    grid-template-columns: 1fr;
  }
}

.checkout-error-banner {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-security-notice {
  text-align: center;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Receipt / Subscription Success Modal */
.receipt-modal-card {
  max-width: 580px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  padding: 30px !important;
  text-align: center !important;
}

.receipt-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px auto;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.receipt-modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.receipt-modal-subtitle {
  font-size: 0.85rem;
  color: var(--slate-600);
  margin-bottom: 22px;
}

.receipt-table-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: left;
}

.receipt-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
  color: var(--slate-700);
  border-bottom: 1px solid #f1f5f9;
}

.receipt-table-row:last-child {
  border-bottom: none;
  font-weight: 800;
  color: var(--slate-900);
}

.receipt-unlocked-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  text-align: left;
}

.receipt-unlocked-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #065f46;
  background: #ecfdf5;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
}

/* =================================================================
   DAY 18: MANAGE SUBSCRIPTION & STATUS MODAL (TEST MODE)
   ================================================================= */

.manage-sub-modal-card {
  max-width: 650px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  padding: 26px !important;
  overflow-x: hidden !important;
}

.manage-sub-header {
  margin-bottom: 20px;
}

.manage-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.manage-sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.manage-sub-plan-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
}

.manage-sub-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.manage-sub-status-pill.canceling {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.manage-sub-status-pill.canceled {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.manage-sub-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.manage-sub-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manage-sub-meta-label {
  font-size: 0.74rem;
  color: var(--slate-500);
  font-weight: 600;
}

.manage-sub-meta-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--slate-800);
}

.manage-sub-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.manage-sub-banner.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.manage-sub-banner.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.manage-sub-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manage-sub-action-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #ffffff;
}

.manage-sub-action-card:hover {
  border-color: #cbd5e1;
}

.manage-sub-action-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manage-sub-action-info strong {
  font-size: 0.86rem;
  color: var(--slate-900);
}

.manage-sub-action-info span {
  font-size: 0.76rem;
  color: var(--slate-500);
}

/* =================================================================
   CHOOSE ACTIVE INVOICES MODAL & SLOTS (FREE TIER LIMIT / DOWNGRADE)
   ================================================================= */
.choose-active-modal-card {
  max-width: 650px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  padding: 26px !important;
  overflow-x: hidden !important;
}

.choose-active-header {
  margin-bottom: 18px;
  text-align: left;
}

.active-slots-counter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.active-slots-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.active-slots-pill.full {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.active-slots-pill.available {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.choose-active-invoices-scroll {
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding-right: 4px;
}

.choose-active-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.choose-active-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.choose-active-item.is-selected {
  border-color: #818cf8;
  background: #f5f3ff;
}

.choose-active-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.choose-active-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-600, #4f46e5);
}

.choose-active-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.choose-active-client-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.choose-active-subtext {
  font-size: 0.78rem;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.choose-active-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  flex-shrink: 0;
}

.choose-active-amount {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--slate-900);
}

.choose-active-pro-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #f5f3ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.choose-active-pro-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: #334155;
}

.choose-active-pro-info strong {
  color: #1e1b4b;
  font-size: 0.86rem;
}

.invoice-card-inactive {
  border-left: 4px solid #cbd5e1 !important;
  background: #fafafa !important;
}

.badge-active-slot {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
  font-weight: 600 !important;
}

.badge-inactive-slot {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
}

/* =================================================================
   Day 19: Privacy Policy & Terms Modal Standards (Consistent 650px Max Width)
   ================================================================= */
.legal-modal-card {
  max-width: 650px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.legal-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(85vh - 140px);
  padding: 10px 4px 16px 0;
  font-size: 0.88rem;
  line-height: 1.62;
  color: #334155;
  box-sizing: border-box;
}

.legal-modal-body h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 18px;
  margin-bottom: 6px;
}

.legal-modal-body h4:first-child {
  margin-top: 0;
}

.legal-modal-body p {
  margin-bottom: 12px;
}

.legal-modal-body ul {
  margin-left: 20px;
  margin-bottom: 12px;
}

.legal-modal-body li {
  margin-bottom: 6px;
}

.legal-highlight-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #4f46e5;
  padding: 12px 14px;
  border-radius: 8px;
  margin: 14px 0;
  font-size: 0.84rem;
}

.legal-highlight-box.alert-shield {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #10b981;
  color: #166534;
}

.legal-highlight-box.alert-shield strong {
  color: #14532d;
}

/* ==========================================================================
   Progressive Web App (PWA) Install Banner & Modal
   ========================================================================== */

.pwa-install-banner {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-left: 5px solid #4f46e5;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
  animation: pwaBannerFadeIn 0.3s ease-out;
}

@keyframes pwaBannerFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-banner-icon {
  flex-shrink: 0;
}

.pwa-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 2px;
}

.pwa-banner-subtitle {
  font-size: 0.8rem;
  color: #4338ca;
  line-height: 1.4;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-action-btn {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: 1px solid #4338ca !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25) !important;
}

.pwa-install-action-btn:hover {
  background: #4338ca !important;
}

.btn-nav-install {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: 1px solid #4338ca !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}

.btn-nav-install:hover {
  background: #4338ca !important;
}

.install-modal-card {
  max-width: 650px !important;
  width: 95% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.install-step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.install-step-badge {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-step-content strong {
  display: block;
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 3px;
}

.install-step-content p {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .pwa-install-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .pwa-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .invoices-grid-container {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }
}





