/* ===== Sales Pipeline CSS ===== */
/* Design System: "Refined Industrial" - Copper=#c17f59 */

/* Stage Colors */
:root {
    --stage-lead: #4a7bbd;
    --stage-lead-light: #e8f0f8;
    --stage-quoted: #f59e0b;
    --stage-quoted-light: #fef9e7;
    --stage-won: #5a9a6e;
    --stage-won-light: #e8f5eb;
    --stage-lost: #ef4444;
    --stage-lost-light: #fef2f2;
}

/* ===== Container ===== */
.sales-container {
    padding: 0 24px 32px;
    min-height: 100%;
}

/* ===== Tabs ===== */
.sales-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
}

.sales-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.sales-tab.active {
    color: var(--copper);
    border-bottom-color: var(--copper);
    font-weight: 600;
}

.sales-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== Toolbar ===== */
.sales-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sales-toolbar .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.sales-toolbar .filter-select:focus {
    border-color: var(--copper);
}

.sales-toolbar-spacer {
    flex: 1;
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.view-toggle-btn {
    padding: 6px 14px;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.view-toggle-btn svg {
    width: 14px;
    height: 14px;
}

.view-toggle-btn.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ===== Pipeline Board ===== */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
    min-height: 500px;
}

.pipeline-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 12px;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.pipeline-column.drag-active {
    border-color: var(--border-color);
}

.pipeline-column.drag-over {
    border-color: var(--copper);
    background: rgba(193, 127, 89, 0.04);
}

.pipeline-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.pipeline-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pipeline-stage-dot.lead { background: var(--stage-lead); }
.pipeline-stage-dot.quoted { background: var(--stage-quoted); }
.pipeline-stage-dot.won { background: var(--stage-won); }
.pipeline-stage-dot.lost { background: var(--stage-lost); }

.pipeline-column-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.pipeline-column-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.pipeline-column-count.lead { background: var(--stage-lead-light); color: var(--stage-lead); }
.pipeline-column-count.quoted { background: var(--stage-quoted-light); color: #b45309; }
.pipeline-column-count.won { background: var(--stage-won-light); color: var(--stage-won); }
.pipeline-column-count.lost { background: var(--stage-lost-light); color: var(--stage-lost); }

.pipeline-column-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-left: auto;
}

.pipeline-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

/* ===== Pipeline Card ===== */
.pipeline-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    user-select: none;
    display: flex;
    gap: 10px;
}

.pipeline-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--border-color);
}

.pipeline-card.dragging {
    opacity: 0.4;
    border: 1px dashed var(--border-color);
    background: var(--bg-secondary);
    transform: scale(0.98);
}

.pipeline-card.just-moved {
    animation: pipelineCardHighlight 0.6s ease;
    box-shadow: 0 0 0 2px var(--copper), var(--shadow-md);
}

@keyframes pipelineCardHighlight {
    0% { box-shadow: 0 0 0 3px rgba(193, 127, 89, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(193, 127, 89, 0); }
}

.pipeline-card-drag-handle {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
    color: var(--text-tertiary);
    cursor: grab;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.pipeline-card:hover .pipeline-card-drag-handle {
    opacity: 1;
}

.pipeline-card-drag-handle:hover {
    color: var(--copper);
}

.pipeline-card-drag-handle svg {
    width: 14px;
    height: 14px;
}

.pipeline-card-body {
    flex: 1;
    min-width: 0;
}

.pipeline-card-company {
    font-family: 'Sora', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card-contact {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.pipeline-card-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--copper);
}

.pipeline-card-source {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.pipeline-card-days {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

.pipeline-drop-placeholder {
    height: 58px;
    border: 2px dashed var(--copper-light);
    border-radius: var(--radius-md);
    background: rgba(193, 127, 89, 0.04);
    display: none;
    animation: pipelinePlaceholderPulse 1.2s ease-in-out infinite;
}

@keyframes pipelinePlaceholderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.pipeline-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    border: 1.5px solid var(--copper);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(193, 127, 89, 0.15);
    transform: rotate(1deg) scale(1.01);
    opacity: 0.95;
    padding: 14px;
    width: 240px;
}

/* ===== Pipeline Summary Bar ===== */
.pipeline-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pipeline-summary-card {
    flex: 1;
    min-width: 140px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pipeline-summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pipeline-summary-value {
    font-family: 'Sora', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pipeline-summary-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Pipeline List View ===== */
.pipeline-list-table {
    width: 100%;
    border-collapse: collapse;
}

.pipeline-list-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.pipeline-list-table th:hover {
    color: var(--text-secondary);
}

.pipeline-list-table th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.pipeline-list-table td {
    padding: 12px 14px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.pipeline-list-table tr {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.pipeline-list-table tr:hover td {
    background: var(--bg-secondary);
}

.pipeline-list-table td:first-child {
    font-weight: 600;
}

/* ===== Stage Badges ===== */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.stage-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stage-badge.lead {
    background: var(--stage-lead-light);
    color: var(--stage-lead);
}
.stage-badge.lead::before { background: var(--stage-lead); }

.stage-badge.quoted {
    background: var(--stage-quoted-light);
    color: #92400e;
}
.stage-badge.quoted::before { background: var(--stage-quoted); }

.stage-badge.won {
    background: var(--stage-won-light);
    color: var(--stage-won);
}
.stage-badge.won::before { background: var(--stage-won); }

.stage-badge.lost {
    background: var(--stage-lost-light);
    color: #b91c1c;
}
.stage-badge.lost::before { background: var(--stage-lost); }

/* ===== Lead Detail Panel ===== */
.lead-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.lead-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.lead-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 100vw;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.lead-panel.open {
    transform: translateX(0);
}

.lead-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.lead-panel-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(193, 127, 89, 0.12);
    color: var(--copper);
}

.lead-panel-title {
    flex: 1;
    font-family: 'Sora', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.lead-panel-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lead-panel-close svg {
    width: 18px;
    height: 18px;
}

.lead-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lead-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Lead Panel Sections */
.lead-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lead-section-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-section-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lead-section-icon svg {
    width: 14px;
    height: 14px;
}

.lead-section-icon.info { background: var(--blue-light); color: var(--blue); }
.lead-section-icon.stage { background: rgba(193, 127, 89, 0.12); color: var(--copper); }
.lead-section-icon.activity { background: var(--green-light); color: var(--green); }
.lead-section-icon.notes { background: var(--amber-light); color: var(--amber); }

.lead-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lead-section-body {
    padding: 16px;
}

/* Lead Info Grid */
.lead-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lead-info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lead-info-item.full-width {
    grid-column: 1 / -1;
}

.lead-info-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lead-info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.lead-info-value a {
    color: var(--blue);
    text-decoration: none;
}

.lead-info-value a:hover {
    text-decoration: underline;
}

.lead-info-value.value-amount {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--copper);
}

/* Stage Selector */
.stage-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stage-option {
    padding: 10px 12px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stage-option:hover {
    border-color: var(--border-color);
    background: var(--bg-white);
}

.stage-option.active.lead {
    border-color: var(--stage-lead);
    background: var(--stage-lead-light);
    color: var(--stage-lead);
}

.stage-option.active.quoted {
    border-color: var(--stage-quoted);
    background: var(--stage-quoted-light);
    color: #92400e;
}

.stage-option.active.won {
    border-color: var(--stage-won);
    background: var(--stage-won-light);
    color: var(--stage-won);
}

.stage-option.active.lost {
    border-color: var(--stage-lost);
    background: var(--stage-lost-light);
    color: #b91c1c;
}

.stage-option-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stage-option.lead .stage-option-dot { background: var(--stage-lead); }
.stage-option.quoted .stage-option-dot { background: var(--stage-quoted); }
.stage-option.won .stage-option-dot { background: var(--stage-won); }
.stage-option.lost .stage-option-dot { background: var(--stage-lost); }

/* Activity Log */
.lead-activities {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lead-activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}

.lead-activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 36px;
    bottom: 0;
    width: 1px;
    background: var(--border-light);
}

.lead-activity-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.lead-activity-dot svg {
    width: 13px;
    height: 13px;
    color: var(--text-tertiary);
}

.lead-activity-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 6px;
    line-height: 1.4;
}

.lead-activity-date {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    padding-top: 7px;
    white-space: nowrap;
}

.lead-notes-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
    line-height: 1.5;
}

.lead-notes-textarea:focus {
    border-color: var(--copper);
    background: var(--bg-white);
}

/* Lead Panel Footer Buttons */
.lead-panel-footer .btn {
    flex: 1;
    justify-content: center;
    padding: 9px 14px;
    font-size: 0.85rem;
}

.lead-panel-footer .btn-danger {
    background: none;
    border: 1.5px solid var(--red);
    color: var(--red);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lead-panel-footer .btn-danger:hover {
    background: var(--red-light);
}

/* ===== Quote Editor Panel ===== */
.quote-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.quote-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.quote-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 680px;
    max-width: 100vw;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    z-index: 1201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.quote-panel.open {
    transform: translateX(0);
}

.quote-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.quote-panel-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(193, 127, 89, 0.12);
    color: var(--copper);
}

.quote-panel-id {
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quote-status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.quote-status-badge.draft { background: var(--bg-tertiary); color: var(--text-secondary); }
.quote-status-badge.sent { background: var(--blue-light); color: var(--blue); }
.quote-status-badge.accepted { background: var(--stage-won-light); color: var(--stage-won); }
.quote-status-badge.declined { background: var(--stage-lost-light); color: var(--stage-lost); }

.quote-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.quote-panel-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.quote-panel-close svg {
    width: 18px;
    height: 18px;
}

.quote-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quote-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.quote-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.quote-section-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quote-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quote-section-body {
    padding: 16px;
}

/* Client Info in Quote */
.quote-client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quote-client-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.quote-client-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quote-client-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Quote Meta Fields */
.quote-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quote-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.quote-field-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.quote-field-input:focus {
    border-color: var(--copper);
    background: var(--bg-white);
}

.quote-field-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.quote-field-select:focus {
    border-color: var(--copper);
}

/* Quote Items Table */
.quote-items-table-header {
    display: grid;
    grid-template-columns: 1fr 70px 90px 90px 32px;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.quote-items-col-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quote-items-col-label.right {
    text-align: right;
}

.quote-item-row {
    display: grid;
    grid-template-columns: 1fr 70px 90px 90px 32px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.quote-item-row:last-child {
    border-bottom: none;
}

.quote-item-description {
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.quote-item-description:focus {
    border-color: var(--border-color);
    background: var(--bg-white);
}

.quote-item-number {
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    text-align: right;
    width: 100%;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.quote-item-number:focus {
    border-color: var(--border-color);
    background: var(--bg-white);
}

.quote-item-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    padding-right: 4px;
}

.quote-item-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.quote-item-delete:hover {
    background: var(--red-light);
    color: var(--red);
}

.quote-item-delete svg {
    width: 14px;
    height: 14px;
}

.quote-add-item-btn {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 100%;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.quote-add-item-btn:hover {
    border-color: var(--copper);
    color: var(--copper);
    background: rgba(193, 127, 89, 0.04);
}

.quote-add-item-btn svg {
    width: 14px;
    height: 14px;
}

/* Quote Totals */
.quote-totals {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.quote-total-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.quote-total-value {
    font-weight: 600;
    color: var(--text-primary);
}

.quote-total-row.grand-total {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 2px;
}

.quote-total-row.grand-total .quote-total-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 700;
}

.quote-total-row.grand-total .quote-total-value {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    color: var(--copper);
}

.quote-vat-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

/* Quote Notes */
.quote-notes-textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
    line-height: 1.5;
}

.quote-notes-textarea:focus {
    border-color: var(--copper);
    background: var(--bg-white);
}

/* ===== Quotes Tab ===== */
.quotes-table {
    width: 100%;
    border-collapse: collapse;
}

.quotes-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.quotes-table td {
    padding: 13px 14px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.quotes-table tr {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.quotes-table tr:hover td {
    background: var(--bg-secondary);
}

.quotes-table td:first-child {
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--copper);
}

/* ===== Marketing Tab ===== */
.marketing-coming-soon {
    text-align: center;
    padding: 40px 24px;
    background: var(--bg-white);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.marketing-coming-soon p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.marketing-coming-soon strong {
    color: var(--text-primary);
}

.marketing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.marketing-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition-fast);
}

.marketing-card:hover {
    box-shadow: var(--shadow-md);
}

.marketing-card-content {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.marketing-card-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.marketing-card-value {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.marketing-card-trend {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.marketing-card-trend.up { color: var(--green); }
.marketing-card-trend.down { color: var(--red); }
.marketing-card-trend.neutral { color: var(--text-secondary); }

/* CSS-only sparkline bars */
.marketing-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    padding: 10px 20px 12px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.sparkline-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: height var(--transition-base);
}

.marketing-card:nth-child(1) .sparkline-bar { background: var(--blue); }
.marketing-card:nth-child(2) .sparkline-bar { background: var(--purple); }
.marketing-card:nth-child(3) .sparkline-bar { background: var(--copper); }
.marketing-card:nth-child(4) .sparkline-bar { background: var(--green); }

.marketing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250, 249, 247, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: var(--radius-lg);
}

.marketing-overlay-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    padding: 0 16px;
}

/* ===== Marketing Channel Table ===== */
.marketing-channels-section {
    margin-top: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.marketing-section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.marketing-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

.marketing-channels-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-secondary);
}

.marketing-channels-table td {
    padding: 12px 20px;
    color: var(--text-primary);
    border-top: 1px solid var(--border-light);
}

.marketing-channels-table tr:hover td {
    background: var(--bg-secondary);
}

/* ===== Empty States ===== */
.sales-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}

.sales-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.3;
}

.sales-empty-icon svg {
    width: 100%;
    height: 100%;
}

.sales-empty-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.sales-empty-text {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .pipeline-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pipeline-board {
        grid-template-columns: 1fr;
    }

    .lead-panel,
    .quote-panel {
        width: 100vw;
    }

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

    .pipeline-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .sales-toolbar {
        gap: 8px;
    }
}
