/* ============================================================================
   ⚠️  MIGRATION IN PROGRESS - DO NOT ADD NEW CSS HERE
   ============================================================================

   This file is being migrated to Tailwind CSS.

   🚫 DO NOT add new component styles to this file
   🚫 DO NOT add inline styles to components
   ✅ DO use Tailwind utility classes in your components
   ✅ See TAILWIND_GUIDELINES.md for details

   This file should only contain:
   - CSS custom properties (design tokens)
   - Global resets
   - Third-party library overrides

   Current size: 6,133 lines (reduced from 7,313 - 16.1% reduction so far)
   ============================================================================ */

:root {
    /* Colors - Backgrounds */
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --bg-input: #334155;

    /* Colors - Borders */
    --border-default: #334155;
    --border-input: #475569;
    --border-hover: #64748b;

    /* Colors - Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;

    /* Colors - Semantic */
    --color-accent: #10b981;
    --color-accent-dark: #059669;
    --color-warning: #f59e0b;
    --color-warning-dark: #b45309;
    --color-warning-light: #fbbf24;
    --color-error: #ef4444;
    --color-error-light: #f87171;
    --color-blue: #3b82f6;
    --color-blue-dark: #2563eb;
    --color-blue-light: #60a5fa;
    --color-purple: #8b5cf6;
    --color-purple-dark: #7c3aed;
    --color-purple-light: #a78bfa;
    --color-purple-lighter: #c4b5fd;
    --color-orange: #f97316;
    --color-orange-dark: #ea580c;
    --color-orange-light: #fb923c;
    --color-yellow: #facc15;
    --color-yellow-light: #fde047;
    --color-yellow-dark: #eab308;
    --color-cyan: #22d3ee;
    --color-cyan-dark: #0891b2;
    --color-cyan-light: #67e8f9;
    --color-green-light: #4ade80;
    --color-green-dark: #22c55e;
    --color-teal: #2dd4bf;
    --color-indigo: #6366f1;
    --color-indigo-dark: #4f46e5;
    --color-slate: #cbd5e1;
    --color-slate-dark: #94a3b8;
    --color-gray: #9ca3af;

    /* Spacing */
    --sp-xs: 0.125rem;
    --sp-sm: 0.25rem;
    --sp-md: 0.375rem;
    --sp-lg: 0.5rem;
    --sp-xl: 0.75rem;
    --sp-2xl: 1rem;

    /* Radii */
    --radius-xs: 0.125rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;

    /* Typography */
    --text-xs: 0.625rem;
    --text-sm: 0.65rem;
    --text-base: 0.7rem;
    --text-md: 0.75rem;
    --text-lg: 0.8rem;
    --text-xl: 0.875rem;
    --text-2xl: 1rem;
    --text-3xl: 1.125rem;
    --text-4xl: 1.25rem;
    --text-5xl: 1.5rem;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Form elements */
input,
select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
}

input::placeholder {
    color: var(--text-muted);
}

label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Support buttons */
.support-row {
    background: rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.support-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auto-added-label {
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.support-buttons {
    display: flex;
    gap: 0.25rem;
}

.support-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    background: var(--bg-hover);
    color: var(--color-slate);
    transition: all 0.2s;
}

.support-btn:hover {
    background: #64748b;
}

.support-btn.standard {
    background: #64748b;
    color: #fff;
}

.support-btn.silver {
    background: #eab308;
    color: #000;
}

.support-btn.gold {
    background: var(--color-warning);
    color: #000;
}

.support-btn.auto-added {
    position: relative;
    box-shadow: 0 0 0 2px #10b981, 0 0 8px rgba(16, 185, 129, 0.4);
    animation: pulse-auto-added 2s ease-in-out infinite;
}

@keyframes pulse-auto-added {

    0%,
    100% {
        box-shadow: 0 0 0 2px #10b981, 0 0 8px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 0 2px #10b981, 0 0 12px rgba(16, 185, 129, 0.6);
    }
}

.support-override {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.support-override input {
    flex: 1;
    padding: 0.25rem 0.5rem;
}

/* Entitlements */
.entitlement-row {
    background: rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.entitlement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.entitlement-header span:first-child {
    font-size: 0.875rem;
}

.entitlement-header span:last-child {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.entitlement-row.below-discovery {
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.entitlement-row.excluded {
    opacity: 0.5;
    background: rgba(51, 65, 85, 0.3);
}

.entitlement-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.entitlement-toggle input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.entitlement-warning {
    font-size: 0.75rem;
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.15);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
}

.discovery-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

input.input-warning {
    border-color: var(--color-warning) !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

/* Compact entitlement rows */
.ent-row {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.ent-row.below-discovery {
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.ent-row.excluded {
    opacity: 0.5;
    background: rgba(51, 65, 85, 0.3);
}

.ent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ent-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.ent-toggle input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.ent-total-badge {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
}

.ent-body {
    margin-top: 0.5rem;
}

.ent-warning {
    font-size: 0.75rem;
    color: var(--color-warning);
    margin-bottom: 0.375rem;
}

.ent-breakdown {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.ent-formula {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.ent-formula input {
    width: 70px;
    padding: 0.25rem 0.375rem;
    font-size: 0.875rem;
    text-align: right;
}

.ent-formula input.ent-qty {
    width: 60px;
}

.ent-formula input.ent-qty.warning {
    border-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.1);
}

.ent-formula input.ent-rate,
.ent-formula input.ent-fixed {
    width: 80px;
}

.ent-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ent-op {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0 0.125rem;
}

.ent-currency {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ent-result {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 0.25rem;
}

.ent-eff-rate {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ent-mode-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid var(--border-default);
    border-radius: 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 0.5rem;
}

.ent-mode-btn:hover {
    background: rgba(71, 85, 105, 1);
    color: var(--text-primary);
}

.ent-overage {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ent-overage input {
    width: 60px;
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    text-align: right;
}

/* Grid helpers */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* Playbook */
.playbook-help {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.playbook-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.playbook-item .num {
    color: var(--color-accent);
    font-family: monospace;
}

.playbook-item .desc {
    color: var(--text-secondary);
}

.playbook-inputs {
    margin-top: 0.75rem;
}

/* Discount */
.discount-approval {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.approval-none {
    color: var(--text-secondary);
}

.approval-ae {
    color: var(--color-green-light);
}

.approval-vp {
    color: var(--color-yellow);
}

.approval-ceo {
    color: var(--color-error-light);
}

.target-amount-input {
    display: flex;
    align-items: center;
}

.target-amount-input .currency-prefix {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-right: none;
    border-radius: var(--radius-md) 0 0 0.375rem;
    padding: 0.5rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.target-amount-input input {
    border-radius: 0 0.375rem 0.375rem 0;
    flex: 1;
}

.target-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.give-get {
    margin-top: 0.75rem;
}

.give-get-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.give-get-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    background: var(--bg-tertiary);
    color: var(--color-slate);
}

.give-get-btn.selected {
    background: var(--color-accent);
    color: #fff;
}


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

th {
    text-align: left;
    color: var(--text-secondary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-default);
}

td {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--color-slate);
}

.text-green {
    color: var(--color-green-light);
}

.text-yellow {
    color: var(--color-yellow);
}

.text-red {
    color: var(--color-error-light);
}

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

.text-emerald {
    color: var(--color-accent);
}

.text-purple {
    color: var(--color-purple-light);
}

.text-blue {
    color: var(--color-blue-light);
}

.text-cyan {
    color: var(--color-cyan);
}

/* Icons */
.icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.icon-emerald {
    color: var(--color-accent);
}

.icon-green {
    color: var(--color-accent);
}

.icon-blue {
    color: var(--color-blue-light);
}

.icon-cyan {
    color: var(--color-cyan);
}

.icon-purple {
    color: var(--color-purple-light);
}

.icon-yellow {
    color: var(--color-yellow);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

/* Layout */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

/* Spacing - Gap */
.gap-xs {
    gap: var(--sp-xs);
}

.gap-sm {
    gap: var(--sp-sm);
}

.gap-md {
    gap: var(--sp-md);
}

.gap-lg {
    gap: var(--sp-lg);
}

.gap-xl {
    gap: var(--sp-xl);
}

.gap-2xl {
    gap: var(--sp-2xl);
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

/* Spacing - Margin */
.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-auto {
    margin-left: auto;
}

.mr-1 {
    margin-right: 0.25rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Spacing - Padding */
.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Typography - Size */
.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-md {
    font-size: var(--text-md);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-2xl {
    font-size: var(--text-2xl);
}

/* Typography - Weight */
.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Border */
.border {
    border: 1px solid var(--border-default);
}

.border-t {
    border-top: 1px solid var(--border-default);
}

.border-b {
    border-bottom: 1px solid var(--border-default);
}

.border-l {
    border-left: 1px solid var(--border-default);
}

.border-r {
    border-right: 1px solid var(--border-default);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 9999px;
}

/* Background */
.bg-primary {
    background: var(--bg-primary);
}

.bg-secondary {
    background: var(--bg-secondary);
}

.bg-tertiary {
    background: var(--bg-tertiary);
}

/* Text Color */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

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

.text-accent {
    color: var(--color-accent);
}

.text-warning {
    color: var(--color-warning);
}

.text-error {
    color: var(--color-error);
}

.text-blue {
    color: var(--color-blue-light);
}

.text-purple {
    color: var(--color-purple-light);
}

.text-orange {
    color: var(--color-orange);
}

/* Common Patterns */
.btn-base {
    padding: var(--sp-md) var(--sp-xl);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-md);
    border: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--sp-2xl);
}

.card-title {
    font-weight: 500;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-fill-discovery {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-left: auto;
}

.btn-fill-discovery:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.input-base {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: var(--sp-lg) var(--sp-xl);
    color: var(--text-primary);
    font-size: var(--text-md);
}

.input-base:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Display */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Position */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* Opacity */
.opacity-50 {
    opacity: 0.5;
}

.opacity-70 {
    opacity: 0.7;
}

/* Width */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

/* Whitespace */
.whitespace-nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Customer Discovery Section */
.discovery-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.discovery-section {
    background: rgba(51, 65, 85, 0.5);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.discovery-section-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

.discovery-ratio {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--color-accent);
    font-weight: 600;
    text-align: center;
}

.discovery-checkbox {
    margin-top: 0.5rem;
}

.discovery-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--color-slate);
    font-size: 0.875rem;
}

.discovery-checkbox input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Playbook Recommendations */
.playbook-recommendations {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default);
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recommendation-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.1);
}

.recommendation-card.top-pick {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.15);
}

.recommendation-card.selected {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.recommendation-card.selected .recommendation-rank {
    background: var(--color-accent);
    color: #fff;
}

.recommendation-card.last-resort {
    opacity: 0.7;
    border-style: dashed;
}

.recommendation-card.last-resort:hover {
    opacity: 1;
    border-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.1);
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.recommendation-rank {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(16, 185, 129, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

.recommendation-card.last-resort .recommendation-rank {
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.2);
}

.recommendation-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.last-resort-badge {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.recommendation-reason {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.recommendation-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent);
}

.recommendation-breakdown {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Product Type Buttons */
.product-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.product-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid #475569;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.product-type-btn:hover {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.1);
}

.product-type-btn.selected {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.product-type-desc {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.product-type-btn.selected .product-type-desc {
    color: #a7f3d0;
}

/* Product Recommended Badge */
.product-option.recommended {
    border: 1px solid rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.recommended-badge {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-accent);
    background: rgba(16, 185, 129, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

/* Version indicator */
.version-indicator {
    position: fixed;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.625rem;
    color: #475569;
    background: rgba(30, 41, 59, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    z-index: 1000;
}

/* IaC Residency Section */
.residency-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.residency-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s ease;
}

.residency-btn:hover {
    background: var(--bg-hover);
    color: #fff;
}

.residency-btn.selected {
    background: var(--color-purple-dark);
    border-color: var(--color-purple);
    color: #fff;
}

.residency-price {
    font-size: 0.65rem;
    opacity: 0.8;
}

.residency-details {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.residency-includes {
    margin-bottom: 0.75rem;
}

.residency-includes ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.25rem;
}

.residency-includes li {
    color: var(--text-secondary);
    padding: 0.125rem 0;
}

.residency-includes li::before {
    content: "✓ ";
    color: var(--color-accent);
}

.residency-addon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.residency-addon input {
    width: 80px;
}

.residency-override {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.residency-override input {
    width: 100px;
}

.icon-purple {
    color: var(--color-purple-light);
}

/* Print Styles - .no-print elements are hidden when printing (see @media print below) */

@media print {

    /* Hide everything except quote preview */
    .no-print,
    .saved-quotes-bar,
    .grid>*:first-child,
    .reference-section,
    .alert-error,
    .alert-warning {
        display: none !important;
    }

    /* Reset body and container for print */
    body {
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Make grid single column for quote only */
    .grid {
        display: block !important;
    }

    /* Quote preview card - full width, no sticky */
    .quote-preview-card {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        background: white !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Reset ALL backgrounds within quote to white */
    .quote-preview-card *,
    .quote-preview-card div,
    .quote-preview-card span,
    .quote-preview-card table,
    .quote-preview-card tr,
    .quote-preview-card td,
    .quote-preview-card th {
        background: white !important;
        background-color: white !important;
    }

    /* Quote header styling for print */
    .quote-header {
        border-bottom: 2px solid #333;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    .quote-header h2 {
        color: black !important;
        font-size: 1.5rem;
    }

    /* Company name */
    .quote-company {
        color: black !important;
        font-size: 1.25rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    /* Line items */
    .line-item {
        border-bottom: 1px solid #eee !important;
        padding: 0.5rem 0 !important;
    }

    .line-item-name {
        color: black !important;
    }

    .line-item span:last-child {
        color: black !important;
        font-weight: 600;
    }

    .line-item .included {
        color: var(--color-accent-dark) !important;
    }

    .line-item .overage,
    .line-item .playbook-breakdown {
        color: #666 !important;
    }

    /* Totals */
    .totals {
        border-top: 2px solid #333 !important;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .total-row span {
        color: black !important;
    }

    .total-row.contract span:last-child {
        color: black !important;
        font-size: 1.25rem;
    }

    /* Additional pricing table */
    .additional-pricing {
        border-top: 1px solid #ccc !important;
    }

    .additional-pricing-title {
        color: black !important;
    }

    .additional-pricing-table th,
    .additional-pricing-table td {
        color: black !important;
        border-bottom: 1px solid #eee !important;
    }

    .additional-pricing-table td:last-child {
        color: black !important;
    }

    /* Alerts - make them print-friendly */
    .alert {
        border: none !important;
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }

    .alert-title {
        color: black !important;
    }

    .alert ul li {
        color: #333 !important;
    }

    /* Contract modifications */
    .contract-modifications {
        background: white !important;
        border: none !important;
        padding: 0 !important;
    }

    .contract-modifications-title {
        color: black !important;
    }

    .contract-modifications-item {
        color: #333 !important;
    }

    /* Hide requirements checklist in print if no quote */
    .quote-empty {
        display: none !important;
    }
}

/* Auth States */
.auth-loading,
.auth-error,
.auth-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 1rem;
}

.auth-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #334155;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.auth-error h2,
.auth-required h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.auth-error p {
    color: var(--color-error-light);
}

.auth-required p {
    color: var(--text-secondary);
}

.auth-error button {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
}

.auth-error button:hover {
    background: var(--color-accent-dark);
}

/* User info in header */
.user-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Version author in version row */
.version-author {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-left: auto;
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* Show changes button */
.btn-show-changes {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    flex-shrink: 0;
}

.btn-show-changes:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Modal overlay and content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Re-extract status message */
.re-extract-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-default);
}

.re-extract-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.re-extract-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error-light);
}

.re-extract-status .status-dismiss {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.7;
    line-height: 1;
}

.re-extract-status .status-dismiss:hover {
    opacity: 1;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
}

/* Diff modal specific styles */
.diff-modal {
    min-width: 500px;
}

.diff-versions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.diff-old-label {
    color: var(--color-error-light);
}

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

.diff-new-label {
    color: var(--color-green-light);
}

.diff-no-changes {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.diff-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-weight: 500;
}

.diff-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-default);
    vertical-align: top;
}

.diff-field {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.diff-old {
    color: var(--color-error-light);
    background: rgba(248, 113, 113, 0.1);
    word-break: break-word;
}

.diff-new {
    color: var(--color-green-light);
    background: rgba(74, 222, 128, 0.1);
    word-break: break-word;
}

.diff-row-price .diff-field {
    font-weight: bold;
}

.diff-row-price .diff-old,
.diff-row-price .diff-new {
    font-weight: bold;
}

/* Gong Import Modal */
.gong-modal {
    min-width: 450px;
    max-width: 550px;
}

.gong-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.gong-modal form {
    display: flex;
    gap: 0.5rem;
}

.gong-modal form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.gong-modal form input:focus {
    outline: none;
    border-color: var(--color-indigo);
}

.btn-import {
    padding: 0.5rem 1rem;
    background: var(--color-indigo);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-import:hover:not(:disabled) {
    background: var(--color-indigo-dark);
}

.btn-import:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gong-error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    border-radius: var(--radius-md);
    color: var(--color-error-light);
    font-size: 0.875rem;
}

.gong-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gong-success {
    padding: 0.75rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid #4ade80;
    border-radius: var(--radius-md);
    color: var(--color-green-light);
    font-size: 0.875rem;
}

.gong-extracted h4 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.gong-data-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.gong-data-table td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--border-default);
}

.gong-data-table td:first-child {
    color: var(--text-secondary);
    width: 40%;
}

.gong-data-table td:last-child {
    color: var(--text-primary);
}

/* Citation styles */
.citation-cell {
    width: 30px;
    text-align: center;
    vertical-align: top;
}

.citation-details {
    cursor: pointer;
}

.citation-details summary {
    list-style: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.citation-details summary:hover {
    opacity: 1;
}

.citation-details summary::-webkit-details-marker {
    display: none;
}

.citation-details[open] summary {
    opacity: 1;
}

.citation-details blockquote {
    margin: 0.5rem 0 0.25rem 0;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--color-slate);
    font-style: italic;
    max-width: 300px;
    word-wrap: break-word;
}

.citation-details small {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.gong-timeline-notes {
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* Gong Modal Tabs */
.gong-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-default);
    margin: 0 -1rem;
    padding: 0 1rem;
}

.gong-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.gong-tab:hover {
    color: var(--text-primary);
}

.gong-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Recent Companies Tab */
.recent-companies {
    max-height: 400px;
    overflow-y: auto;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.recent-item:hover {
    border-color: var(--color-accent);
    background: #1a2638;
}

.recent-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.recent-item-header strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.recent-item-date {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.recent-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.recent-source {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
}

.recent-source.source-gong {
    background: rgba(139, 92, 246, 0.2);
    color: var(--color-purple-light);
}

.recent-source.source-hubspot {
    background: rgba(251, 146, 60, 0.2);
    color: var(--color-orange-light);
}

.recent-source.source-both {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.recent-item-calls {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default);
}

.recent-call-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.125rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-loading,
.recent-error,
.no-recent {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Search Preview Results */
.search-preview-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-preview-results h4 {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.9rem;
}

.preview-section {
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    background: var(--bg-secondary);
}

.preview-section.found {
    border-color: rgba(74, 222, 128, 0.3);
}

.preview-section.not-found {
    border-color: var(--border-default);
    opacity: 0.7;
}

.preview-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-icon {
    font-size: 1rem;
}

.preview-source {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.preview-status {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: auto;
}

.preview-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default);
}

.preview-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.preview-details li {
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.preview-details li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.preview-details li.more-items {
    color: var(--text-muted);
    font-style: italic;
}

.preview-error {
    margin-top: 0.5rem;
    color: var(--color-error-light);
    font-size: 0.75rem;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.preview-actions .btn-import {
    flex: 1;
}

.preview-actions .btn-secondary {
    flex: 0 0 auto;
}

/* Extraction History */
.extraction-history {
    min-height: 200px;
}

.loading-history,
.no-history {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}

.history-item-clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.history-item-clickable:hover {
    border-color: var(--color-accent);
    background: rgba(16, 185, 129, 0.1);
}

.btn-back-to-list {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-back-to-list:hover {
    color: var(--text-primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-header strong {
    color: var(--text-primary);
}

.history-item-header small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.history-item-details {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-use-extraction {
    padding: 0.375rem 0.75rem;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-use-extraction:hover {
    background: var(--color-accent-dark);
}

.btn-view-citations {
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-view-citations:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.history-citations {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default);
}

.history-citation {
    margin-bottom: 0.5rem;
}

.history-citation strong {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.history-citation blockquote {
    margin: 0.25rem 0;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--color-slate);
    font-style: italic;
}

.history-citation small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.gong-confidence {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.gong-confidence .confidence-high {
    color: var(--color-green-light);
}

.gong-confidence .confidence-medium {
    color: var(--color-warning-light);
}

.gong-confidence .confidence-low {
    color: var(--color-error-light);
}

.gong-notes,
.gong-budget-notes {
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.gong-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn-create-quote {
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-create-quote:hover {
    background: var(--color-accent-dark);
}

.btn-cancel {
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-cancel:hover {
    background: #64748b;
}

.btn-gong {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--color-indigo);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-gong:hover {
    background: var(--color-indigo-dark);
}

.btn-secondary {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--color-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--color-blue-dark);
}

/* Timestamp links in citations */
.timestamp-link {
    color: var(--color-blue-light);
    text-decoration: none;
    transition: color 0.2s;
}

.timestamp-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Gong calls list */
.gong-calls-list {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default);
}

.gong-calls-list h5 {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gong-calls-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gong-calls-list li {
    padding: 0.375rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.gong-calls-list li:last-child {
    border-bottom: none;
}

.gong-calls-list a {
    color: var(--color-blue-light);
    text-decoration: none;
}

.gong-calls-list a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.gong-calls-list small {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* ============================================
   Gong Calls Panel - Company Context
   ============================================ */

.gong-calls-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.gong-calls-panel.collapsed .gong-calls-panel-header {
    border-bottom: none;
}

.gong-calls-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.gong-calls-panel-header .panel-collapse-icon {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.gong-calls-panel-header .panel-icon {
    font-size: 1rem;
}

.gong-calls-panel-header .panel-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-purple-lighter);
    flex: 1;
}

.gong-calls-panel-body {
    padding: 0.5rem 0.75rem;
}

.gong-call-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.gong-call-item:last-of-type {
    border-bottom: none;
}

.gong-call-item .call-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.gong-call-item .call-title {
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gong-call-item .call-title:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

.gong-call-item .call-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.btn-view-extraction {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-view-extraction:hover {
    opacity: 1;
}

.gong-calls-more {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0;
    font-style: italic;
}

.btn-view-all-extractions {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--color-purple-lighter);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-view-all-extractions:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

/* ============================================
   Extraction Detail Modal
   ============================================ */

.extraction-detail-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.extraction-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-default);
}

.extraction-calls {
    margin-bottom: 1rem;
}

.extraction-calls h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.extraction-calls ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.extraction-calls li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 0.85rem;
}

.extraction-calls li:last-child {
    border-bottom: none;
}

.extraction-calls a {
    color: var(--color-blue-light);
    text-decoration: none;
}

.extraction-calls a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.extraction-calls small {
    color: var(--text-muted);
}

.extraction-data {
    margin-bottom: 1rem;
}

.extraction-data h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.extraction-notes {
    background: rgba(51, 65, 85, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.extraction-notes h4 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.extraction-notes p {
    color: var(--color-slate);
    font-size: 0.85rem;
    margin: 0.375rem 0;
}

.extraction-notes p strong {
    color: var(--text-secondary);
}

/* Narrative summary section */
.extraction-narrative {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.extraction-narrative h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.narrative-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.narrative-content p {
    margin: 0 0 0.75rem 0;
}

.narrative-content p:last-child {
    margin-bottom: 0;
}

/* Narrative section in company panel */
.narrative-section-content {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.65;
}

.narrative-section-content .narrative-paragraph {
    margin: 0 0 0.75rem 0;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(59, 130, 246, 0.3);
}

.narrative-section-content .narrative-paragraph:last-child {
    margin-bottom: 0;
}

/* Extractions List (new accordion-style view) */
.extractions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.extraction-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.extraction-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.extraction-item-header:hover {
    background: rgba(51, 65, 85, 0.3);
}

.extraction-toggle {
    font-size: 0.6rem;
    color: var(--text-muted);
    width: 0.75rem;
}

.extraction-date {
    color: var(--text-primary);
    font-weight: 500;
}

.extraction-call-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.extraction-badge {
    background: var(--color-accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.extraction-item-body {
    padding: 0.5rem 0.75rem 0.75rem 1.75rem;
    border-top: 1px solid var(--border-default);
    font-size: 0.75rem;
}

.extraction-calls-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.extraction-calls-label {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.extraction-call-link {
    color: var(--color-blue-light);
    text-decoration: none;
    font-size: 0.7rem;
}

.extraction-call-link:hover {
    text-decoration: underline;
}

.extraction-data-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.extraction-data-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg-primary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
}

.extraction-data-item .data-label {
    color: var(--text-muted);
}

.extraction-data-item .data-value {
    color: var(--color-accent);
    font-weight: 600;
}

.extraction-no-data {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.extraction-notes-inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.extraction-note {
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1.4;
}

.extraction-note strong {
    color: var(--text-muted);
}

.extraction-item-actions {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default);
}

.extraction-item-actions .btn-text {
    font-size: 0.7rem;
    color: #38bdf8;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.extraction-item-actions .btn-text:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* ============================================
   Company-Centric Layout Styles
   ============================================ */

/* Main app container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.5rem;
}

/* App header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.app-header .header-content h1 {
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-header .header-content p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-save-header {
    background: var(--color-accent);
    border: none;
    color: #fff;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-save-header:hover {
    background: var(--color-accent-dark);
}

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

.last-saved-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-secondary-header {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-secondary-header:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* Inline Mode Toggle Switch */
.inline-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    user-select: none;
}

.inline-mode-toggle span {
    transition: color 0.2s ease;
}

.inline-mode-toggle span.active {
    color: var(--color-accent);
    font-weight: 600;
}

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

.inline-mode-toggle .toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.inline-mode-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #64748b;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.inline-mode-toggle input:checked+.toggle-slider {
    background: rgba(16, 185, 129, 0.3);
}

.inline-mode-toggle input:checked+.toggle-slider::before {
    left: 18px;
    background: var(--color-accent);
}

/* App layout: sidebar + content */
.app-layout {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

/* Lead list sidebar */
.lead-list-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    position: sticky;
    top: 0.5rem;
}

.lead-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-default);
}

.lead-list-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lead-list-actions {
    display: flex;
    gap: 0.375rem;
}

.btn-new-quote {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
}

.btn-new-quote:hover {
    background: var(--bg-hover);
}

.btn-gong-import {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
}

.btn-gong-import:hover {
    background: var(--bg-hover);
}

.lead-list-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-default);
}

.lead-list-search input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.lead-list-search input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.lead-list-search input::placeholder {
    color: var(--text-muted);
}

.lead-list-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-default);
    font-size: 0.75rem;
}

.lead-list-sort label {
    color: var(--text-secondary);
    font-weight: 500;
}

.lead-sort-select {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
}

.lead-sort-select:hover {
    border-color: var(--border-input);
}

.lead-sort-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.lead-list-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.lead-list-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
}

.lead-list-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.lead-list-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #334155;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.lead-list-item {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 0.25rem;
    transition: background 0.15s;
}

.lead-list-item:hover {
    background: var(--bg-tertiary);
}

.lead-list-item.selected {
    background: var(--color-accent);
    color: #fff;
}

.lead-list-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    /* Allow flex items to shrink */
}

.lead-list-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-list-item-date {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.lead-list-item.selected .lead-list-item-date {
    color: rgba(255, 255, 255, 0.75);
}

.lead-list-item-quote-count {
    color: var(--color-accent);
}

.lead-list-item.selected .lead-list-item-quote-count {
    color: rgba(255, 255, 255, 0.85);
}

.lead-list-item-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.lead-list-item.selected .lead-list-item-stats {
    color: rgba(255, 255, 255, 0.8);
}

.stat-quotes,
.stat-calls {
    white-space: nowrap;
}

.stat-empty {
    font-style: italic;
    color: var(--text-muted);
}

/* Main content area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Lead detail panel */
.lead-detail-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    padding: 0.75rem 1rem;
}

.lead-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.lead-detail-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-delete-company-sm {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.btn-delete-company-sm:hover {
    opacity: 1;
}

.lead-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-refresh-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.btn-refresh-all:hover:not(:disabled) {
    opacity: 1;
}

.btn-refresh-all:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Company Header Section with editable name/domain */
.lead-header-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.lead-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.lead-name-input-wrapper {
    flex: 1;
}

.lead-name-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.25rem 0;
    transition: border-color 0.15s;
}

.lead-name-input:hover {
    border-bottom-color: #475569;
}

.lead-name-input:focus {
    outline: none;
    border-bottom-color: var(--color-blue);
}

.lead-name-input::placeholder {
    color: var(--text-muted);
    font-weight: normal;
}

.lead-domain-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.lead-domain-row label {
    color: var(--text-secondary);
    font-weight: 500;
}

.lead-domain-input {
    flex: 1;
    max-width: 200px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.lead-domain-input:focus {
    outline: none;
    border-color: var(--color-blue);
}

.domain-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Customer Discovery Panel */
.discovery-notes-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.discovery-notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    user-select: none;
}

.discovery-notes-header .section-toggle {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.notes-saving {
    font-size: 0.65rem;
    color: var(--color-blue-light);
    font-weight: normal;
    margin-left: auto;
}

.notes-dirty {
    color: var(--color-warning-light);
    font-size: 1rem;
    margin-left: 0.25rem;
}

.discovery-notes-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.discovery-note-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.discovery-note-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.discovery-note-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 0.75rem;
    padding: 0.5rem;
    resize: vertical;
    min-height: 2.5rem;
    line-height: 1.4;
    font-family: inherit;
}

.discovery-note-input:focus {
    outline: none;
    border-color: var(--color-blue-light);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2);
}

.discovery-note-input::placeholder {
    color: #475569;
}

.discovery-note-value {
    color: #e2e8f0;
}

/* Edit button for discovery notes */
.btn-edit-discovery {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}

.btn-edit-discovery:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.btn-edit-discovery.editing {
    opacity: 1;
    background: var(--color-accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
}

.btn-edit-discovery.editing:hover {
    background: var(--color-accent-dark);
}

/* Read-only discovery notes display */
.discovery-notes-readonly {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.discovery-note-display {
    background: rgba(15, 23, 42, 0.6);
    border-left: 3px solid var(--color-blue);
    padding: 0.625rem 0.875rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

/* General notes span full width with green accent */
.discovery-note-display.note-general {
    grid-column: 1 / -1;
    border-left-color: var(--color-accent);
}

/* Budget gets amber accent */
.discovery-note-display.note-budget {
    border-left-color: var(--color-warning);
}

/* Timeline gets purple accent */
.discovery-note-display.note-timeline {
    border-left-color: var(--color-purple);
}

/* Support keeps blue accent (default) */
.discovery-note-display.note-support {
    border-left-color: var(--color-blue);
}

.discovery-note-display .discovery-note-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    display: block;
}

.discovery-note-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
    white-space: pre-wrap;
}

.discovery-notes-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
    padding: 1rem;
    text-align: center;
}

/* Company sections (quotes, calls) */
.lead-section {
    margin-bottom: 0.75rem;
}

.lead-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    cursor: pointer;
    user-select: none;
}

.lead-section-header:hover {
    color: var(--color-accent);
}

.section-toggle {
    font-size: 0.625rem;
    width: 1rem;
    color: var(--text-muted);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
}

.btn-view-extraction {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.65rem;
}

.btn-view-extraction:hover {
    background: var(--bg-hover);
}

.btn-create-quote-from-data {
    background: var(--color-accent-dark);
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
    font-weight: 500;
}

.btn-create-quote-from-data:hover {
    background: #047857;
}

.lead-section-body {
    padding-left: 1.5rem;
    padding-top: 0.375rem;
}

/* Archived Quotes */
.archived-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.archived-version-row:hover {
    background: var(--bg-primary);
    border-color: var(--border-input);
}

.archived-version-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.archived-version-info .version-deal-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}

.archived-version-info .version-product {
    font-size: 0.75rem;
    font-weight: 500;
    color: #e2e8f0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archived-version-info .version-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-restore-version {
    background: var(--bg-secondary);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-restore-version:hover {
    background: var(--color-accent);
    color: #0f172a;
    border-color: var(--color-accent);
}

/* Extracted Data Grid */
.extracted-data-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.extracted-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
}

.extracted-metric .metric-label {
    color: var(--text-muted);
}

.extracted-metric .metric-value {
    font-weight: 600;
    color: var(--color-accent);
}

.extracted-metric .metric-value.metric-text {
    font-weight: 500;
}

/* Quote version rows */
.quote-version-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.btn-load-quote {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    text-align: left;
}

.btn-load-quote:hover {
    background: var(--bg-primary);
    border-color: var(--color-accent);
}

.quote-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-date {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.quote-price {
    color: var(--color-accent);
    font-weight: 500;
}

.quote-author {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.quote-product {
    color: var(--text-secondary);
    font-size: 0.65rem;
    background: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

.btn-show-diff {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.65rem;
}

.btn-show-diff:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-delete-quote {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem;
}

.btn-delete-quote:hover {
    color: var(--color-error);
}

/* Call rows - styled like quote rows */
.call-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.call-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.7rem;
}

.call-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-blue-light);
}

.call-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.call-title {
    color: var(--color-blue-light);
}

.call-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.call-duration {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.call-date {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.calls-more {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.btn-reextract {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.btn-reextract:hover {
    background: var(--bg-hover);
}

.btn-reextract:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Gong Re-extract button (header style) */
.btn-refresh-gong {
    background: var(--color-accent);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.65rem;
    margin-left: 0.5rem;
}

.btn-refresh-gong:hover {
    background: var(--color-accent-dark);
}

.btn-refresh-gong:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* HubSpot Deals Section */
.btn-refresh-hubspot {
    background: var(--color-orange);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.65rem;
    margin-left: auto;
}

.btn-refresh-hubspot:hover {
    background: var(--color-orange-dark);
}

.btn-refresh-hubspot:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-closed-won {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-closed-won input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-closed-won .toggle-switch {
    position: relative;
    width: 28px;
    height: 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-closed-won .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-closed-won input:checked+.toggle-switch {
    background: var(--color-accent);
}

.toggle-closed-won input:checked+.toggle-switch::after {
    left: 14px;
    background: #fff;
}

.toggle-closed-won:hover .toggle-switch {
    background: #64748b;
}

.toggle-closed-won input:checked+.toggle-switch:hover {
    background: var(--color-accent-dark);
}

.toggle-closed-won .toggle-label {
    white-space: nowrap;
}

.deals-hidden-note {
    font-size: 0.65rem;
    color: var(--color-gray);
    text-align: center;
    padding: 0.25rem 0;
    font-style: italic;
}

.deal-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.deal-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--color-orange);
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
}

.deal-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-orange-light);
}

.deal-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deal-name {
    color: var(--color-orange);
    font-weight: 500;
}

.deal-amount {
    color: var(--color-green-dark);
    font-weight: 600;
}

.deal-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.deal-stage {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
}

.deal-stage.open {
    background: #1e40af;
    color: #93c5fd;
}

.deal-stage.closed {
    background: #166534;
    color: #86efac;
}

.deal-owner {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.deal-close-date {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.section-loading {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-loading .loading-spinner {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.no-deals {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.deals-footer {
    color: #475569;
    font-size: 0.6rem;
    text-align: right;
    margin-top: 0.5rem;
}

.hubspot-error {
    color: var(--color-error-light);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

/* HubSpot Emails refresh button and error */
.btn-refresh-emails {
    background: #2563eb;
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-refresh-emails:hover {
    background: #1d4ed8;
}

.btn-refresh-emails:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.emails-error {
    color: var(--color-error-light);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

/* ============================================================================
   Ironclad Documents Styles (purple/indigo theme)
   ============================================================================ */

.btn-refresh-ironclad {
    background: var(--color-purple-dark);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-refresh-ironclad:hover {
    background: #6d28d9;
}

.btn-refresh-ironclad:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.document-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--color-purple-dark);
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
}

.document-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-purple);
}

.document-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
    overflow: hidden;
    flex: 1 1 auto;
}

.document-title {
    color: var(--color-purple-light);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.document-template {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.document-id {
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: monospace;
    background: rgba(100, 116, 139, 0.2);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-xs);
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
}

.document-status {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 500;
}

.document-status.status-signed,
.document-status.status-completed,
.document-status.status-executed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green-light);
}

.document-status.status-pending_signature,
.document-status.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning-light);
}

.document-status.status-draft,
.document-status.status-in_review {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.document-status.status-in_progress {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-blue-light);
}

.document-status.status-cancelled,
.document-status.status-expired,
.document-status.status-terminated {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error-light);
}

.document-counterparty {
    color: var(--text-secondary);
}

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

.no-documents {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.documents-footer {
    color: #475569;
    font-size: 0.6rem;
    text-align: right;
    margin-top: 0.5rem;
}

.ironclad-error {
    color: var(--color-error-light);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

/* ============================================================================
   HubSpot Emails Styles (blue theme)
   ============================================================================ */

.email-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.25rem;
}

.email-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid #3b82f6;
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.email-row-btn:hover {
    background: var(--bg-primary);
    border-color: #60a5fa;
}

.email-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.email-direction {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.email-direction.incoming {
    color: #22c55e;
}

.email-direction.outgoing {
    color: #3b82f6;
}

.email-subject {
    color: #60a5fa;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.email-from {
    color: var(--text-muted);
    font-size: 0.65rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-date {
    color: #94a3b8;
    font-size: 0.65rem;
    white-space: nowrap;
}

.email-expand-icon {
    color: #64748b;
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.email-expand-icon.expanded {
    transform: rotate(0deg);
}

.email-body-container {
    background: var(--bg-primary);
    border: 1px solid #334155;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 0.75rem;
    margin-top: -0.25rem;
}

.email-body-header {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #334155;
}

.email-body-header div {
    margin-bottom: 0.125rem;
}

.email-body-content {
    max-height: 300px;
    overflow-y: auto;
}

.email-body-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    margin: 0;
    line-height: 1.5;
}

.email-body-empty {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

.no-emails {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.emails-more {
    color: #475569;
    font-size: 0.65rem;
    text-align: center;
    padding: 0.25rem 0;
    font-style: italic;
}

.emails-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-btn {
    background: #e2e8f0;
    border: none;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    min-width: 28px;
}

.pagination-btn:hover:not(:disabled) {
    background: #cbd5e1;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    color: #64748b;
    font-size: 0.7rem;
    padding: 0 0.5rem;
}

.emails-footer {
    color: #475569;
    font-size: 0.6rem;
    text-align: right;
    margin-top: 0.5rem;
}

/* Right panel email text overflow */
.right-panel .email-subject {
    max-width: 250px;
}

/* ============================================================================
   Stripe Payments Styles (cyan/teal theme)
   ============================================================================ */

.btn-refresh-stripe {
    background: var(--color-cyan-dark);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-refresh-stripe:hover {
    background: #0e7490;
}

.btn-refresh-stripe:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Public Intelligence refresh button */
.btn-refresh-intel {
    background: var(--color-accent);
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-refresh-intel:hover {
    background: var(--color-accent-dark);
}

.btn-refresh-intel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stripe-total-paid {
    color: var(--color-cyan);
    font-size: 0.7rem;
    font-weight: 500;
}

.stripe-customer-info {
    margin-bottom: 0.5rem;
    padding: 0.375rem;
    background: rgba(8, 145, 178, 0.1);
    border-radius: var(--radius-sm);
}

.stripe-customer-link {
    color: var(--color-cyan);
    text-decoration: none;
    font-size: 0.75rem;
}

.stripe-customer-link:hover {
    color: var(--color-cyan-light);
}

.customer-email {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-left: 0.5rem;
}

.stripe-subsection-title {
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0.5rem 0 0.25rem 0;
}

.subscription-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.subscription-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--color-cyan-dark);
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
}

.subscription-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-cyan);
}

.subscription-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subscription-product {
    color: var(--color-cyan);
    font-weight: 500;
}

.subscription-amount {
    color: var(--color-green-light);
    font-size: 0.7rem;
}

.subscription-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
}

.subscription-status {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    text-transform: capitalize;
}

.subscription-status.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green-light);
}

.subscription-status.status-trialing {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning-light);
}

.subscription-status.status-canceled,
.subscription-status.status-past_due,
.subscription-status.status-unpaid {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error-light);
}

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

.invoice-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.invoice-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.7rem;
}

.invoice-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
}

.invoice-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-amount {
    color: var(--color-green-light);
    font-weight: 500;
}

.invoice-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6rem;
}

.invoice-status {
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.55rem;
    text-transform: capitalize;
}

.invoice-status.status-paid {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green-light);
}

.invoice-status.status-open,
.invoice-status.status-draft {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning-light);
}

.invoice-status.status-void,
.invoice-status.status-uncollectible {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error-light);
}

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

.invoices-more {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-align: center;
    padding: 0.25rem;
}

.no-payments {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.payments-footer {
    color: #475569;
    font-size: 0.6rem;
    text-align: right;
    margin-top: 0.5rem;
}

.stripe-error {
    color: var(--color-error-light);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.lead-no-data {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}

.lead-no-data p {
    margin: 0.25rem 0;
}

/* Company name hint */
.lead-name-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* Company name and domain side-by-side row */
.lead-name-domain-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.lead-name-field {
    flex: 2;
}

.domain-field {
    flex: 1;
    min-width: 140px;
}

.domain-field label small {
    color: var(--text-muted);
    font-weight: normal;
}

/* Domain search indicator (shown in HubSpot row when domain is configured) */
.domain-search-indicator {
    font-size: 0.7rem;
    color: var(--color-accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.domain-search-indicator strong {
    color: var(--color-accent-dark);
}

/* ============================================================================
   Clazar Private Offers Styles (orange/amber theme for AWS Marketplace)
   ============================================================================ */

.btn-refresh-clazar {
    background: #d97706;
    border: none;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: auto;
}

.btn-refresh-clazar:hover {
    background: #b45309;
}

.btn-refresh-clazar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.offers-active-badge {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green-light);
    font-size: 0.6rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    font-weight: 500;
}

.offer-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

/* .offer-row.active-offer - deprecated, use .offer-row.offer-status-accepted instead */

.offer-row-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid #d97706;
    color: var(--text-primary);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
}

.offer-row-btn:hover {
    background: var(--bg-primary);
    border-color: var(--color-warning-light);
}

.offer-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.offer-name {
    color: var(--color-warning-light);
    font-weight: 500;
}

.offer-amount {
    color: var(--color-green-light);
    font-size: 0.7rem;
}

.offer-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    flex-wrap: wrap;
}

/* Offer status badges - shown inline with dates */
.offer-status-badge {
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
}

.offer-status-badge.status-accepted {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-green-light);
}

.offer-status-badge.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: var(--color-warning-light);
}

.offer-status-badge.status-draft {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
}

.offer-status-badge.status-expired,
.offer-status-badge.status-declined,
.offer-status-badge.status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error-light);
}

.offer-status-badge.status-other {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
}

/* Row-level styling based on status */
.offer-row.offer-status-accepted {
    border-left: 2px solid #4ade80;
    padding-left: 0.25rem;
    margin-left: -0.25rem;
}

.offer-row.offer-status-expired {
    opacity: 0.6;
}

.offer-row.offer-status-draft {
    opacity: 0.7;
}

.offer-marketplace {
    color: #d97706;
    font-size: 0.55rem;
    background: rgba(217, 119, 6, 0.15);
    padding: 0.1rem 0.25rem;
    border-radius: var(--radius-xs);
}

.offer-product {
    color: var(--text-secondary);
    font-size: 0.6rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-expires,
.offer-accepted {
    color: var(--text-muted);
    font-size: 0.55rem;
}

.no-offers {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.no-gong-calls {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

/* Mini progress bar for Gong re-extraction */
.gong-mini-progress {
    padding: 0.5rem 0.75rem;
    background: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.mini-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.mini-progress-message {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-accent);
}

.mini-progress-step {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mini-progress-bar {
    height: 4px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.mini-progress-detail {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

.gong-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    font-size: 0.75rem;
}

.gong-error-banner .error-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.gong-error-banner .error-message {
    line-height: 1.4;
    word-break: break-word;
}

.offers-footer {
    color: #475569;
    font-size: 0.6rem;
    text-align: right;
    margin-top: 0.5rem;
}

.hidden-offers-note {
    font-size: 0.65rem;
    color: var(--color-gray);
    text-align: center;
    padding: 0.25rem 0;
    font-style: italic;
}

.clazar-error {
    color: var(--color-error-light);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

/* Integration Lookup Editor - compact inline editor for per-integration company names */
.integration-lookup-editor {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    font-size: 0.6rem;
    max-width: 220px;
}

.integration-lookup-editor .lookup-label {
    color: var(--text-muted);
    margin-right: 0.25rem;
    white-space: nowrap;
    font-weight: 400;
}

.integration-lookup-editor .lookup-value {
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-xs);
    background: transparent;
    border: 1px dashed transparent;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-style: italic;
}

.integration-lookup-editor .lookup-value:hover {
    background: rgba(71, 85, 105, 0.4);
    border-color: var(--border-input);
    color: var(--text-secondary);
}

.integration-lookup-editor.has-custom .lookup-value {
    color: #d97706;
    font-style: normal;
}

.integration-lookup-editor.has-custom .lookup-value:hover {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.3);
}

.lookup-custom-indicator {
    color: #d97706;
    margin-left: 0.125rem;
    font-weight: 500;
    font-style: normal;
}

.integration-lookup-editor.editing {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 0.125rem;
    gap: 0.25rem;
}

.integration-lookup-editor .lookup-input {
    width: 100px;
    padding: 0.125rem 0.25rem;
    font-size: 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
}

.integration-lookup-editor .lookup-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn-lookup-save,
.btn-lookup-cancel {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    font-size: 0.7rem;
    border-radius: var(--radius-xs);
    transition: all 0.15s ease;
}

.btn-lookup-save {
    color: var(--color-green-light);
}

.btn-lookup-save:hover {
    background: rgba(74, 222, 128, 0.2);
}

.btn-lookup-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-lookup-cancel {
    color: var(--color-error-light);
}

.btn-lookup-cancel:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-lookup-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Two-column layout (sidebar + main content) */
.app-layout-two-col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
}

/* Three-column layout with tabs */
.app-layout-three-col {
    display: grid;
    grid-template-columns: 280px 1fr 550px;
    gap: 1rem;
}

/* Middle workspace with tabs */
.quote-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

/* Tab bar */
.quote-tabs {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    padding: 0;
}

.quote-tabs-list {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

.quote-tabs-list::-webkit-scrollbar {
    height: 4px;
}

.quote-tabs-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.quote-tabs-list::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 2px;
}

/* Individual tab */
.quote-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-default);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    position: relative;
    max-width: 180px;
    flex-shrink: 0;
}

.quote-tab .quote-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.quote-tab.active {
    background: var(--bg-primary);
    color: var(--color-accent);
    border-bottom: 2px solid #10b981;
}

.quote-tab-label {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-tab-edit {
    background: var(--bg-secondary);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    width: 150px;
    outline: none;
}

.quote-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.quote-tab-close:hover {
    background: var(--color-error);
    color: #fff;
}

.quote-tab-close svg {
    width: 12px;
    height: 12px;
}

.quote-tab-new {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--color-accent);
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0.25rem;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1;
}

.quote-tab-new:hover {
    background: var(--bg-tertiary);
    color: #34d399;
    border-color: var(--color-accent);
}

.quote-tab-new svg,
.quote-tab-new .icon {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor;
    stroke-width: 2.5px;
}

/* Tab loading indicator */
.quote-tab-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

.loading-spinner {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tab content area */
.quote-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Version History Bar */
.version-history-bar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.version-history-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.version-history-select {
    flex: 1;
    min-width: 0;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-history-select:hover {
    border-color: var(--text-muted);
    background: var(--bg-primary);
}

.version-history-select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.version-history-select option {
    background: var(--bg-primary);
    color: #e2e8f0;
    padding: 0.375rem;
}

.version-history-count {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.625rem;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

/* Right panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    max-height: calc(100vh - 100px);
    padding-right: 0.5rem;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    overflow-y: auto;
}

.right-panel .lead-detail-panel {
    display: contents;
    /* Makes children render as direct children of right-panel, showing gaps between sections */
}

.right-panel .quote-preview-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

/* Quote preview section - collapsible like other sections */
.quote-preview-section .quote-preview-arr {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.85rem;
}

.quote-preview-section .lead-section-body {
    padding: var(--spacing-4);
}

/* Each company section is a card */
.right-panel .lead-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.right-panel .lead-section-header {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-default);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s ease;
    font-weight: 500;
}

.right-panel .lead-section-header:hover {
    background: var(--bg-primary);
}

.right-panel .lead-section-body {
    padding: 1rem;
    word-wrap: break-word;
}

/* Single column layout for discovery notes in right panel */
.right-panel .discovery-notes-readonly {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.right-panel .discovery-note-display {
    width: 100%;
}

/* Prevent text overflow in integration rows */
.right-panel .deal-name,
.right-panel .call-title,
.right-panel .document-title,
.right-panel .offer-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Ensure row buttons don't overflow */
.right-panel .deal-row-btn,
.right-panel .call-row-btn,
.right-panel .document-row-btn,
.right-panel .offer-row-btn {
    min-width: 0;
    overflow: hidden;
}


/* Company header - separate card with actions */
.right-panel .lead-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.right-panel .lead-detail-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-accent);
}

/* Responsive: stack on smaller screens */
@media (max-width: 1400px) {
    .app-layout-three-col {
        grid-template-columns: 280px 1fr;
    }

    .right-panel {
        grid-column: 1 / -1;
        max-height: none;
    }
}

@media (max-width: 900px) {

    .app-layout,
    .app-layout-two-col,
    .app-layout-three-col {
        display: flex;
        flex-direction: column;
    }

    .lead-list-sidebar {
        width: 100%;
        min-width: auto;
        max-height: 200px;
        position: static;
    }

    .right-panel {
        max-height: none;
    }
}

/* Print styles - hide sidebar */
@media print {
    .lead-list-sidebar {
        display: none;
    }

    .app-layout {
        display: block;
    }

    .lead-detail-panel {
        display: none;
    }
}

/**
 * Inline Quote Editor Styles
 *
 * A quote-centric editing experience where configuration
 * controls are embedded directly within the quote display.
 */

/* ============================================================================
   Main Container
   ============================================================================ */

.inline-quote-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* ============================================================================
   Version Bar
   ============================================================================ */

.inline-version-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.inline-version-select {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.75rem;
}

.inline-version-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================================================
   Section Base Styles
   ============================================================================ */

.inline-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inline-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: linear-gradient(to right, rgba(51, 65, 85, 0.6), rgba(51, 65, 85, 0.3));
    border-bottom: 1px solid #475569;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.inline-section-price {
    margin-left: auto;
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Section type color accents */
.inline-discovery-section {
    border-left: 3px solid var(--color-purple);
}

.inline-product-section {
    border-left: 3px solid var(--color-accent);
}

.inline-entitlements-section {
    border-left: 3px solid var(--color-orange);
}

.inline-support-section {
    border-left: 3px solid var(--color-blue);
}

.inline-residency-section {
    border-left: 3px solid var(--color-purple);
}

.inline-term-section {
    border-left: 3px solid var(--color-warning);
}

.inline-section-content {
    padding: 0.875rem;
    overflow: visible;
    background: rgba(15, 23, 42, 0.3);
}

/* ============================================================================
   Company Section
   ============================================================================ */

.inline-company-row {
    display: flex;
    gap: 0.75rem;
}

.inline-company-name {
    flex: 2;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.inline-company-name:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.inline-domain {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.inline-domain:focus {
    outline: none;
    border-color: var(--text-muted);
}

.inline-company-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================================================
   Discovery Section
   ============================================================================ */

.inline-discovery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: flex-end;
}

.inline-discovery-group {
    flex: 1;
    min-width: 70px;
}

.inline-discovery-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.inline-discovery-group input {
    width: 100%;
    max-width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.625rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inline-discovery-group input:focus {
    outline: none;
    border-color: var(--color-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.inline-discovery-ratio,
.inline-discovery-total {
    padding: 0.375rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.inline-discovery-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.inline-check input {
    width: auto;
}

/* Playbook Recommendations */
.inline-playbook-recommendations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default);
}

.inline-playbook-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inline-playbook-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.inline-playbook-btn.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.inline-playbook-btn.recommended {
    border-color: var(--color-warning);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.inline-playbook-btn.last-resort {
    opacity: 0.5;
}

.playbook-rank {
    color: var(--color-warning);
    font-weight: 700;
    font-size: 0.85rem;
}

.inline-playbook-btn.selected .playbook-rank {
    color: var(--color-accent);
}

.playbook-name {
    font-weight: 500;
}

.playbook-price {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* ============================================================================
   Product Section
   ============================================================================ */

.inline-product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.inline-product-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 90px;
}

.inline-product-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.inline-product-btn.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.product-name {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-primary);
}

.product-price {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.inline-product-override {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default);
}

.inline-override-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.inline-override-row label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.inline-override-input {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.inline-override-input input {
    width: 100px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.inline-included-grid {
    display: flex;
    gap: 0.75rem;
}

.inline-included-item {
    flex: 1;
}

.inline-included-item label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.125rem;
}

.inline-included-item input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* ============================================================================
   Entitlements Section
   ============================================================================ */

.inline-entitlement-row {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.inline-entitlement-row:last-child {
    margin-bottom: 0;
}

.inline-entitlement-row.disabled {
    opacity: 0.5;
    background: rgba(15, 23, 42, 0.5);
}

.inline-entitlement-row.warning {
    border-left: 3px solid var(--color-warning);
}

.inline-ent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inline-ent-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.inline-ent-toggle input {
    width: auto;
    accent-color: var(--color-orange);
}

.inline-ent-total {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

.inline-ent-body {
    margin-top: 0.375rem;
}

.inline-ent-warning {
    font-size: 0.65rem;
    color: var(--color-warning);
    margin-bottom: 0.25rem;
}

.inline-ent-formula {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.inline-ent-qty {
    width: 70px;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: right;
}

.inline-ent-unit {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.inline-ent-op {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.inline-ent-currency {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.inline-ent-rate,
.inline-ent-fixed {
    width: 70px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.375rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: right;
}

.inline-ent-eff-rate {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.inline-ent-mode-btn {
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.375rem;
    color: var(--text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    margin-left: 0.25rem;
}

.inline-ent-mode-btn:hover {
    background: #64748b;
    color: var(--text-primary);
}

.inline-ent-breakdown {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================================================
   Support Section
   ============================================================================ */

.inline-support-row {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.inline-support-row:last-child {
    margin-bottom: 0;
}

.inline-support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.inline-support-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-auto-badge {
    font-size: 0.65rem;
    color: var(--color-accent);
    background: rgba(16, 185, 129, 0.15);
    padding: 0.2rem 0.375rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.inline-support-buttons {
    display: flex;
    gap: 0.375rem;
}

.inline-support-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inline-support-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.inline-support-btn.selected {
    color: #fff;
    font-weight: 600;
}

.inline-support-btn.standard.selected {
    background: #64748b;
    border-color: var(--text-secondary);
}

.inline-support-btn.silver.selected {
    background: #94a3b8;
    border-color: var(--text-secondary);
}

.inline-support-btn.gold.selected {
    background: var(--color-warning);
    border-color: var(--color-warning);
}

.inline-support-btn.auto {
    opacity: 0.7;
}

.inline-support-override {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inline-support-override input {
    width: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.375rem;
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* ============================================================================
   Residency Section
   ============================================================================ */

.inline-residency-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-residency-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 90px;
}

.inline-residency-btn span {
    color: var(--text-primary);
    display: block;
    font-weight: 600;
}

.inline-residency-btn .inline-residency-price {
    color: var(--text-secondary);
    font-weight: 400;
}

.inline-residency-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.inline-residency-btn.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--color-purple);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.inline-residency-price {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.inline-residency-override {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inline-residency-override input {
    width: 100px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.75rem;
}

/* ============================================================================
   Term & Discount Section
   ============================================================================ */

.inline-term-row,
.inline-discount-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.inline-term-group,
.inline-discount-group {
    flex: 1;
    min-width: 100px;
}

.inline-term-group label,
.inline-discount-group label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.inline-term-group select,
.inline-discount-group select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.inline-discount-group input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.inline-impl-controls {
    display: flex;
    gap: 0.375rem;
}

.inline-impl-controls select {
    flex: 0 0 auto;
    width: auto;
}

.inline-impl-override {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.inline-impl-override input {
    width: 80px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.inline-from-target {
    font-size: 0.6rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.125rem;
}

.inline-approval-badge {
    display: inline-block;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.inline-approval-badge.approval-none {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-accent);
}

.inline-approval-badge.approval-ae {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue);
}

.inline-approval-badge.approval-vp {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.inline-approval-badge.approval-exec {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.inline-give-get {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default);
}

.inline-give-get label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.inline-required {
    color: var(--color-warning);
}

.inline-give-get-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.inline-give-get-btn {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inline-give-get-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.inline-give-get-btn.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ============================================================================
   Totals Section
   ============================================================================ */

.inline-totals {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid #10b981;
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.inline-totals-incomplete {
    border-color: var(--border-input);
}

.inline-totals-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.inline-totals-requirements {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.inline-totals-requirements p {
    margin-bottom: 0.5rem;
}

.inline-totals-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.inline-totals-requirements li {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.inline-totals-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.inline-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.inline-totals-label {
    color: var(--text-secondary);
}

.inline-totals-value {
    color: var(--text-primary);
    font-weight: 500;
}

.inline-totals-discount .inline-totals-value {
    color: var(--color-warning);
}

.inline-totals-divider {
    height: 1px;
    background: var(--bg-tertiary);
    margin: 0.375rem 0;
}

.inline-totals-arr {
    font-size: 1rem;
}

.inline-totals-arr .inline-totals-label {
    color: var(--text-primary);
    font-weight: 600;
}

.inline-totals-arr .inline-totals-value {
    color: var(--color-accent);
    font-weight: 700;
}

.inline-totals-tcv {
    font-size: 1.1rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-default);
    margin-top: 0.25rem;
}

.inline-totals-tcv .inline-totals-label {
    color: var(--text-primary);
    font-weight: 600;
}

.inline-totals-tcv .inline-totals-value {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.25rem;
}

/* ============================================================================
   Alerts Section
   ============================================================================ */

.inline-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.inline-alert {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

.inline-alert-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.inline-alert-content {
    padding-left: 1.25rem;
}

.inline-alert-item {
    margin-bottom: 0.125rem;
}

.inline-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.inline-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.inline-alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.inline-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.inline-contract-mods {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
}

.inline-contract-mods-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-purple-lighter);
    margin-bottom: 0.25rem;
}

.inline-contract-mods-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.inline-contract-mod-item {
    padding: 0.125rem 0.375rem;
    background: rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--color-purple-lighter);
}

/* ============================================================================
   Icon colors (matching existing app)
   ============================================================================ */

.icon-emerald {
    color: var(--color-accent);
}

.icon-purple {
    color: var(--color-purple);
}

.icon-blue {
    color: var(--color-blue);
}

.icon-orange {
    color: var(--color-orange);
}

.icon-yellow {
    color: var(--color-warning);
}

.icon-warning {
    color: var(--color-warning);
}

/* AppDataLoader loading and error states */
.app-loading,
.app-error,
.app-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.loading-container,
.error-container,
.login-container {
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    max-width: 500px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #334155;
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.error-container h2,
.login-container h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-container p,
.login-container p {
    margin-bottom: 1.5rem;
    color: var(--color-slate);
    line-height: 1.6;
}

.error-container button {
    background: var(--color-blue);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
}

.error-container button:hover {
    background: var(--color-blue-dark);
}
/* Data source badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: rgb(148, 163, 184);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Section header layout improvements */
.section-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0; /* Allow text truncation if needed */
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Update lead-section-header to allow wrapping */
.lead-section-header {
    flex-wrap: wrap;
    row-gap: 0.375rem;
}

/* Make section-title not grow and prevent wrapping */
.section-title {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make badges more compact */
.badge {
    padding: 0.125rem 0.35rem;
    font-size: 0.55rem;
    margin-left: 0;
}

/* Reduce gap in right section */
.section-header-right {
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Make domain search indicator more compact */
.domain-search-indicator {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Make integration lookup editor more compact in section headers */
.lead-section-header .integration-lookup-editor {
    font-size: 0.65rem;
}

.lead-section-header .lookup-label {
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.lead-section-header .lookup-value {
    font-weight: 500;
}
