/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.5;
}

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

.btn--primary:hover {
    background: #7C3AED;
    box-shadow: var(--shadow-glow-purple);
}

.btn--secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

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

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

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

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn--sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
}

.btn--lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
}

.btn--full {
    width: 100%;
}

.btn--icon {
    padding: var(--space-sm);
    width: 36px;
    height: 36px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* ---- Inputs ---- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-group__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group__error {
    font-size: var(--text-xs);
    color: var(--priority-urgent);
}

.input {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    width: 100%;
}

.input:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

.input--error {
    border-color: var(--priority-urgent);
}

.input--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

textarea.input {
    resize: vertical;
    min-height: 80px;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239B97B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ---- Dropdown ---- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + var(--space-xs));
    left: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs);
    z-index: 200;
    display: none;
}

.dropdown__menu.open {
    display: block;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dropdown__item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.dropdown__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-xs) 0;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.badge--purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--brand-purple);
}

.badge--cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--brand-cyan);
}

.badge--green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge--amber {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.badge--red {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

/* ---- Modal Overlay ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
    animation: fadeIn var(--transition-fast);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-base);
}

.modal--sm { max-width: 400px; }
.modal--md { max-width: 560px; }
.modal--lg { max-width: 720px; }
.modal--xl { max-width: 900px; }

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

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

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-lg);
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight var(--transition-base);
}

.toast--success { border-left: 3px solid var(--accent-green); }
.toast--error   { border-left: 3px solid var(--priority-urgent); }
.toast--warning { border-left: 3px solid var(--priority-high); }
.toast--info    { border-left: 3px solid var(--brand-cyan); }

.toast__close {
    margin-left: auto;
    color: var(--text-tertiary);
    cursor: pointer;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ---- Empty State ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    min-height: 300px;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state__desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: var(--space-lg);
}

/* ---- Color Dot ---- */
.color-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Avatar ---- */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 48px; height: 48px; font-size: var(--text-base); }

/* ---- Checkbox ---- */
.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--text-sm);
}

.checkbox__input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: transparent;
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkbox__input:checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.checkbox__input:checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox__label--done {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

/* ---- Divider ---- */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-md) 0;
}

/* ---- Screen reader only ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================================
   CRM-SPECIFIC COMPONENTS
   ================================== */

/* ---- DataTable ---- */
.data-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table__th {
    padding: 10px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table__th--sortable {
    cursor: pointer;
}

.data-table__th--sortable:hover {
    color: var(--text-primary);
}

.data-table__td {
    padding: 10px 16px;
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table__row {
    transition: background var(--transition-fast);
}

.data-table__row:hover {
    background: var(--bg-tertiary);
    cursor: pointer;
}

.data-table__empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-2xl);
}

/* ---- Tags ---- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--brand-purple);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.tag__remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    background: transparent;
    border: none;
    padding: 0;
}

.tag__remove:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.2);
}

.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tag-input__field {
    border: none;
    background: transparent;
    font-size: var(--text-xs);
    color: var(--text-primary);
    outline: none;
    min-width: 80px;
    padding: 2px 0;
}

/* ---- Timeline ---- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-subtle);
}

.timeline__item {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 16px;
}

.timeline__dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-default);
    flex-shrink: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline__dot--task {
    border-color: var(--brand-purple);
}

.timeline__dot--call {
    border-color: var(--brand-cyan);
}

.timeline__dot--meeting {
    border-color: #F59E0B;
}

.timeline__dot--email {
    border-color: var(--brand-magenta);
}

.timeline__dot--note {
    border-color: var(--text-tertiary);
}

.timeline__content {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.timeline__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.timeline__date {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

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

.timeline__notes {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 4px;
}

.timeline__empty {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-style: italic;
}

/* ---- Chart Bar ---- */
.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-top: 16px;
}

.chart-bar__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chart-bar__fill {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 400ms ease;
}

.chart-bar__label {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.chart-bar__value {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- Metric Card ---- */
.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.metric-card__value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.metric-card__label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-bar__search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-bar__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.filter-bar__search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
}

.filter-bar select {
    min-width: 140px;
}

/* ---- Search Dropdown ---- */
.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown__group {
    padding: 8px 0;
}

.search-dropdown__group-title {
    padding: 4px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

.search-dropdown__item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.search-dropdown__item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.search-dropdown__empty {
    padding: 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* ==================================
   DETAIL PAGES
   ================================== */

.detail-page {
    max-width: 1200px;
}

.detail-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.detail-page__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

@media (max-width: 900px) {
    .detail-page__content {
        grid-template-columns: 1fr;
    }
}

.detail-page__main {
    min-width: 0;
}

.detail-page__sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

/* ---- Profile Card ---- */
.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.profile-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.profile-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-card__name {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

/* ---- Detail Fields Grid ---- */
.detail-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .detail-fields {
        grid-template-columns: 1fr;
    }
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.detail-field--full {
    grid-column: 1 / -1;
}

.detail-field__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* ---- Tag Input Wrapper ---- */
.tag-input-wrapper {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    transition: border-color var(--transition-fast);
}

.tag-input-wrapper:focus-within {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ---- Sidebar Sections ---- */
.detail-sidebar-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.detail-sidebar-section__header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.detail-sidebar-section__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-sidebar-section__body {
    padding: var(--space-md) var(--space-lg);
    max-height: 400px;
    overflow-y: auto;
}

/* ---- Linked Cards ---- */
.linked-card {
    display: block;
    padding: var(--space-sm) var(--space-md);
    margin: 0 calc(-1 * var(--space-md));
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
}

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

.linked-card + .linked-card {
    border-top: 1px solid var(--border-subtle);
}

.linked-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: 2px;
}

.linked-card__title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.linked-card__meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.linked-card--row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.linked-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ==================================
   DEAL DETAIL PAGE
   ================================== */

.deal-detail-hero {
    margin-bottom: var(--space-lg);
}

.deal-detail-hero__title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.deal-detail-hero__title-input {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    outline: none;
    padding: var(--space-xs) 0;
    flex: 1;
    min-width: 200px;
    transition: border-color var(--transition-fast);
}

.deal-detail-hero__title-input:hover {
    border-bottom-color: var(--border-subtle);
}

.deal-detail-hero__title-input:focus {
    border-bottom-color: var(--brand-purple);
}

.badge--lg {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
}

/* ---- Deal Metrics Row ---- */
.deal-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 768px) {
    .deal-metrics-row {
        grid-template-columns: 1fr 1fr;
    }
}

.deal-metric {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.deal-metric__label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.deal-metric__input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.deal-metric__prefix,
.deal-metric__suffix {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.deal-metric__input {
    flex: 1;
    min-width: 0;
}

/* ---- Linked Entity Chips ---- */
.deal-linked-entities {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.linked-entity-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.linked-entity-chip:hover {
    background: var(--bg-elevated);
    border-color: var(--brand-purple);
    color: var(--brand-purple);
}

.linked-entity-chip svg {
    color: var(--text-secondary);
}

/* ---- Deal Stage Progress ---- */
.deal-stage-progress {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    position: relative;
    padding-left: var(--space-md);
}

.deal-stage-progress::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-subtle);
}

.deal-stage-step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

.deal-stage-step__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    background: var(--bg-elevated);
    position: absolute;
    left: calc(-1 * var(--space-md));
    z-index: 1;
}

.deal-stage-step__label {
    font-size: var(--text-xs);
    font-weight: 500;
}

.deal-stage-step--current .deal-stage-step__label {
    font-weight: 700;
}

/* ---- Deal Summary ---- */
.deal-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.deal-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.deal-summary-item__label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

.deal-summary-item__value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================================
   SETTINGS PAGE
   ================================== */

.settings-page {
    max-width: 800px;
}

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.settings-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

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

.settings-section__title {
    font-size: var(--text-base);
    font-weight: 600;
}

.settings-section__body {
    padding: var(--space-lg);
}

/* ---- Profile Row ---- */
.settings-profile-row {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

@media (max-width: 600px) {
    .settings-profile-row {
        flex-direction: column;
        align-items: center;
    }
}

.settings-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.settings-profile-info {
    flex: 1;
    min-width: 0;
}

/* ---- Color Swatches ---- */
.color-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch--active {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

/* ---- Theme Toggle ---- */
.theme-toggle-row {
    display: flex;
    gap: var(--space-lg);
}

.theme-option {
    flex: 1;
    cursor: pointer;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    border-color: var(--border-default);
}

.theme-option--active {
    border-color: var(--brand-purple);
    box-shadow: var(--shadow-glow-purple);
}

.theme-option__label {
    display: block;
    margin-top: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Theme Preview Mini ---- */
.theme-preview {
    height: 64px;
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.theme-preview--dark {
    background: #0B0A10;
}

.theme-preview--light {
    background: #F8F9FB;
}

.theme-preview__bar {
    height: 6px;
    border-radius: 3px;
    width: 50%;
    background: var(--brand-purple);
}

.theme-preview__lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.theme-preview__line {
    height: 4px;
    border-radius: 2px;
    width: 80%;
}

.theme-preview--dark .theme-preview__line {
    background: rgba(255, 255, 255, 0.1);
}

.theme-preview--light .theme-preview__line {
    background: rgba(0, 0, 0, 0.08);
}

.theme-preview__line--short {
    width: 50%;
}

/* ---- Settings Data Cards ---- */
.settings-data-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.settings-data-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.settings-data-card--danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.settings-data-card__info {
    flex: 1;
    min-width: 0;
}

.settings-data-card__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.settings-data-card__desc {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    line-height: 1.4;
}

@media (max-width: 600px) {
    .settings-data-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
