/* Proposals CRM page styles — Brain-Stem light theme */

/* ===== Full-width container + push footer to bottom ===== */
body[data-site="brain-stem"] main#main .container {
    max-width: 100%;
    padding: 0 1.5rem;
}

body[data-site="brain-stem"] main#main > .section {
    padding-top: 1rem;
}

body[data-site="brain-stem"] main#main {
    min-height: calc(100vh - 64px - 80px); /* viewport - nav - footer */
}

/* ===== CRM Layout ===== */
.crm-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: start;
}

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

/* ===== Filter tabs ===== */
.proposals-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 6px;
    background: transparent;
    color: var(--gray-600, #475569);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.15s;
}

.filter-btn:hover {
    border-color: var(--primary, #1e3a5f);
    color: var(--primary, #1e3a5f);
}

.filter-btn.active {
    background: var(--primary, #1e3a5f);
    border-color: var(--primary, #1e3a5f);
    color: #fff;
    font-weight: 500;
}

/* ===== Proposals grid ===== */
.proposals-grid {
    display: grid;
    gap: 1rem;
}

/* ===== Proposal card ===== */
.proposal-card {
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.proposal-card:hover {
    border-color: var(--secondary, #0891b2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.proposal-card.selected {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 20%, transparent);
    background: color-mix(in srgb, var(--primary, #2563eb) 3%, white);
}

.proposal-card.status-submitted { border-left: 3px solid #f59e0b; }
.proposal-card.status-accepted { border-left: 3px solid #10b981; }
.proposal-card.status-in_progress { border-left: 3px solid #3b82f6; }
.proposal-card.status-completed { border-left: 3px solid #6b7280; }
.proposal-card.status-rejected { border-left: 3px solid #ef4444; }
.proposal-card.status-draft { border-left: 3px solid #8b5cf6; }

.proposal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.proposal-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark, #152a45);
    line-height: 1.3;
}

.proposal-card-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

/* ===== Status badge ===== */
.proposal-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.proposal-status-badge.status-draft { background: #f3e8ff; color: #7c3aed; }
.proposal-status-badge.status-submitted { background: #fef3c7; color: #b45309; }
.proposal-status-badge.status-accepted { background: #d1fae5; color: #047857; }
.proposal-status-badge.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.proposal-status-badge.status-completed { background: #f3f4f6; color: #4b5563; }
.proposal-status-badge.status-rejected { background: #fee2e2; color: #b91c1c; }

/* ===== ICP Badge ===== */
.icp-badge,
.icp-badge-lg {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.icp-badge:hover,
.icp-badge-lg:hover {
    opacity: 0.85;
}

.icp-badge-lg {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
}

.icp-green { background: #d1fae5; color: #047857; }
.icp-amber { background: #fef3c7; color: #b45309; }
.icp-red { background: #fee2e2; color: #b91c1c; }
.icp-none { background: #f3f4f6; color: #6b7280; }

/* ===== Card metrics row ===== */
.card-metrics {
    display: flex;
    margin-top: 0.5rem;
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--gray-100, #f1f5f9);
    border-radius: 6px;
    overflow: hidden;
}

.card-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.35rem 0.5rem;
    min-width: 0;
    text-align: center;
    border-right: 1px solid var(--gray-100, #f1f5f9);
}

.card-metric:last-child {
    border-right: none;
}

.card-metric-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400, #94a3b8);
    white-space: nowrap;
}

.card-metric-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-800, #1e293b);
    white-space: nowrap;
}

.card-metric-value.overdue {
    color: #dc2626;
}

/* ===== Next action text below metrics ===== */
.card-next-action {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--gray-600, #475569);
    font-style: italic;
    line-height: 1.3;
}

.card-next-action.overdue {
    color: #dc2626;
}

.muted {
    color: var(--gray-400, #94a3b8);
}

/* ===== Card notes preview ===== */
.proposal-card-notes {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100, #f1f5f9);
    font-size: 0.8rem;
}

.proposal-card-notes p {
    color: var(--gray-500, #64748b);
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

/* ===== Detail panel ===== */
.detail-placeholder {
    background: #f8fafc;
    border: 1px dashed var(--gray-300, #cbd5e1);
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-panel {
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem;
    width: 100%;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--primary-dark, #152a45);
}

.detail-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.detail-desc {
    color: var(--gray-600, #475569);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.detail-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #64748b);
}

/* ===== Inline editable row ===== */
.detail-inline-row {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.inline-group {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.inline-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400, #94a3b8);
    white-space: nowrap;
}

.date-input {
    width: 150px;
}

/* ===== Rate Form ===== */
.detail-rate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-rate h4 {
    margin: 0;
}

.rate-form {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rate-prefix,
.rate-suffix {
    font-size: 0.85rem;
    color: var(--gray-600, #475569);
}

.rate-input {
    width: 80px;
    text-align: center;
}

/* ===== ICP Breakdown ===== */
.icp-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.icp-dim {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.icp-dim-label {
    min-width: 140px;
    color: var(--gray-600, #475569);
}

.icp-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100, #f1f5f9);
    border-radius: 4px;
    overflow: hidden;
}

.icp-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    transition: width 0.3s;
}

.icp-dim-val {
    min-width: 28px;
    text-align: right;
    font-weight: 600;
    color: var(--gray-700, #334155);
}

/* ===== Contacts Panel ===== */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.contact-item:hover {
    background: #f8fafc;
}

.contact-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #1e3a5f);
}

.contact-info {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    line-height: 1.3;
}

.contact-name {
    font-weight: 600;
    color: var(--gray-800, #1e293b);
}

.contact-role {
    font-size: 0.75rem;
    color: var(--secondary, #0891b2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-email {
    color: var(--gray-500, #64748b);
    font-size: 0.8rem;
}

.contact-item {
    position: relative;
}

.btn-remove-contact {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400, #94a3b8);
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.contact-item:hover .btn-remove-contact {
    opacity: 1;
}

.btn-remove-contact:hover {
    color: #ef4444;
    background: #fee2e2;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Add Contact Section ===== */
.add-contact-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-200, #e2e8f0);
}

.add-contact-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.add-contact-search-wrap {
    flex: 1;
    position: relative;
}

.role-select {
    width: 140px;
    flex-shrink: 0;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.search-results:empty {
    display: none;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f0f9ff;
}

.search-result-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-800, #1e293b);
}

.search-result-email {
    font-size: 0.75rem;
    color: var(--gray-500, #64748b);
}

.selected-user-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #f0f9ff;
    border: 1px solid var(--secondary, #0891b2);
    border-radius: 6px;
    font-size: 0.85rem;
}

.selected-user-display span {
    flex: 1;
    font-weight: 600;
    color: var(--primary-dark, #152a45);
}

/* ===== Comments ===== */
.add-comment-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.comment-input {
    flex: 1;
    resize: vertical;
    min-height: 40px;
}

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

.comment-item {
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.85rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-dark, #152a45);
    font-size: 0.8rem;
}

.comment-date {
    color: var(--gray-400, #94a3b8);
    font-size: 0.75rem;
}

.comment-body {
    margin: 0;
    color: var(--gray-700, #334155);
    line-height: 1.4;
}

/* ===== Shared form inputs ===== */
.form-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--gray-800, #1e293b);
    background: #fff;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary, #0891b2);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15);
}

/* ===== Buttons ===== */
.btn-sm {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-700, #334155);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-sm:hover {
    background: var(--gray-50, #f8fafc);
    border-color: var(--gray-400, #94a3b8);
}

.btn-sm.btn-primary {
    background: var(--primary, #1e3a5f);
    border-color: var(--primary, #1e3a5f);
    color: #fff;
}

.btn-sm.btn-primary:hover {
    background: var(--primary-dark, #152a45);
}

.btn-action {
    background: #f0f9ff;
    border-color: var(--secondary, #0891b2);
    color: var(--secondary, #0891b2);
}

.btn-action:hover {
    background: #e0f2fe;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-body {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500, #64748b);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-800, #1e293b);
}

/* ===== ICP Form ===== */
.icp-form-container {
}

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

.icp-form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-dark, #152a45);
}

.icp-form-desc {
    color: var(--gray-500, #64748b);
    font-size: 0.85rem;
    margin: 0 0 1rem;
}

.icp-dimension {
    margin-bottom: 1rem;
}

.icp-label {
    display: block;
    margin-bottom: 0.3rem;
}

.icp-label strong {
    color: var(--gray-800, #1e293b);
    font-size: 0.9rem;
}

.icp-hint {
    display: block;
    color: var(--gray-500, #64748b);
    font-size: 0.75rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}

.icp-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icp-slider {
    flex: 1;
    height: 6px;
    accent-color: var(--secondary, #0891b2);
}

.icp-slider-val {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 28px;
    text-align: right;
    color: var(--primary, #1e3a5f);
}

.icp-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200, #e2e8f0);
}

/* ===== Nav badge ===== */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
}

/* ===== Pipeline Grid: 2 rows x 8 boxes (2+4+2), sales = 2/3 width ===== */
.pg-grid {
    display: grid;
    /* label | 10 equal columns */
    grid-template-columns: 110px repeat(10, 1fr);
    gap: 4px;
    margin-bottom: 1rem;
}

.pg-corner { /* empty top-left */ }

.pg-col-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500, #64748b);
    padding: 0.35rem 0.5rem;
    background: var(--gray-100, #f1f5f9);
    border-radius: 6px;
    text-align: center;
}

.pg-col-pre   { grid-column: 2 / 4; }
.pg-col-sales { grid-column: 4 / 10; }
.pg-col-del   { grid-column: 10 / 12; }

.pg-row-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500, #64748b);
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
    white-space: nowrap;
}

.pg-row-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    padding: 0.25rem 0.5rem;
    text-align: left;
}

.pg-row-btn:hover {
    background: var(--gray-50, #f8fafc);
    border-color: var(--gray-300, #cbd5e1);
    color: var(--primary, #1e3a5f);
}

/* Stage box */
.pg-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.5rem 0.25rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: color-mix(in srgb, var(--box-color) 10%, white);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    min-height: 68px;
    text-align: center;
}

.pg-box:hover {
    background: color-mix(in srgb, var(--box-color) 20%, white);
    border-color: color-mix(in srgb, var(--box-color) 30%, transparent);
}

.pg-box.active {
    background: color-mix(in srgb, var(--box-color) 22%, white);
    border-color: var(--box-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--box-color) 18%, transparent);
}

.pg-box-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--box-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    width: 100%;
}

.pg-box-count {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--box-color);
    line-height: 1;
    text-align: center;
    width: 100%;
}

.pg-box-count.empty {
    color: var(--gray-300, #cbd5e1);
    font-weight: 400;
}

.pg-box-value {
    font-size: 0.6rem;
    color: var(--gray-500, #64748b);
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.pg-box-pct {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--box-color);
    opacity: 0.7;
    text-align: center;
    width: 100%;
}

/* ===== Forecast Row ===== */
.pg-row-forecast {
    margin-top: 0.35rem;
}

.pg-col-q {
    font-size: 0.65rem;
    background: var(--gray-100, #f1f5f9);
}

.pg-fc {
    /* inherits .pg-box styles — buttons like the pipeline boxes */
}

.pipeline-show-all {
    display: block;
    margin: 0.5rem auto 0;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 6px;
    background: transparent;
    color: var(--gray-600, #475569);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.pipeline-show-all:hover {
    background: var(--gray-50, #f8fafc);
    border-color: var(--gray-400, #94a3b8);
}

@media (max-width: 700px) {
    .pg-grid {
        grid-template-columns: 80px repeat(10, 1fr);
    }
    .pg-box { min-height: 48px; padding: 0.3rem 0.15rem; }
    .pg-box-label { font-size: 0.55rem; }
    .pg-fc-month { font-size: 0.5rem; }
}

/* ===== Stage Badge (on cards) ===== */
.stage-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== Stage Selector (detail panel) ===== */
.detail-stage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-stage h4 {
    margin: 0;
}

/* ===== Deal Row: stage + probability inline ===== */
.detail-deal-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stage-select-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.stage-select {
    width: 160px;
    font-size: 0.85rem;
}

/* ===== Detail Card Metrics Row ===== */
.detail-card-metrics {
    display: flex;
    background: var(--gray-50, #f8fafc);
    border: 1px solid var(--gray-100, #f1f5f9);
    border-radius: 6px;
    overflow: hidden;
}

.detail-metric {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-right: 1px solid var(--gray-100, #f1f5f9);
}

.detail-metric:last-child {
    border-right: none;
}

.detail-metric-close {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.detail-metric-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400, #94a3b8);
    white-space: nowrap;
}

.detail-metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark, #152a45);
    white-space: nowrap;
}

.detail-metric-value.overdue {
    color: #dc2626;
}

.close-date-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.close-date-btns {
    display: flex;
    gap: 0.2rem;
}

.close-btn {
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 4px;
    background: #fff;
    color: var(--gray-600, #475569);
    font-size: 0.65rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.close-btn:hover {
    background: #f0f9ff;
    border-color: var(--secondary, #0891b2);
    color: var(--secondary, #0891b2);
}

.close-btn.active {
    background: var(--secondary, #0891b2);
    border-color: var(--secondary, #0891b2);
    color: #fff;
}

.date-input-sm {
    width: 120px;
    font-size: 0.8rem;
    padding: 0.2rem 0.3rem;
}

/* ===== Action Buttons Row ===== */
.detail-action-btns {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}


/* ===== Manage Users Modal ===== */
.mu-modal-body {
    max-width: 560px;
}

.mu-modal-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

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

.mu-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-dark, #152a45);
}

.mu-section {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
}

.mu-section:last-of-type {
    border-bottom: none;
}

.mu-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #64748b);
}

.mu-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mu-user-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    background: #fff;
}

.mu-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mu-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mu-user-email {
    font-size: 0.75rem;
    color: var(--gray-500, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mu-role-select {
    width: 130px;
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
}

.mu-you-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.btn-remove:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.btn-readd {
    background: none;
    border: 1px solid #86efac;
    color: #16a34a;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.btn-readd:hover {
    background: #dcfce7;
    border-color: #22c55e;
}

.mu-removed-list .mu-user-row {
    background: #fafafa;
    border-color: var(--gray-100, #f1f5f9);
}

.mu-removed-list .mu-user-name {
    color: var(--gray-500, #64748b);
}

.mu-search-input {
    width: 100%;
    margin-bottom: 0.5rem;
}

.mu-search-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 200px;
    overflow-y: auto;
}

.mu-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    background: #fff;
}

.btn-add-user {
    white-space: nowrap;
}

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

.mu-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200, #e2e8f0);
}

/* ===== Contacts header with Manage Users button ===== */
.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.contacts-header h4 {
    margin: 0;
}

/* ===== Win Probability Buttons ===== */
.prob-row {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.prob-btn {
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 4px;
    background: #fff;
    color: var(--gray-600, #475569);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
}

.prob-btn:hover {
    background: #f0f9ff;
    border-color: var(--secondary, #0891b2);
    color: var(--secondary, #0891b2);
}

.prob-btn.active {
    background: var(--secondary, #0891b2);
    border-color: var(--secondary, #0891b2);
    color: #fff;
}

.prob-default {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400, #9ca3af);
    padding: 0.2rem 0.3rem;
    white-space: nowrap;
}

.prob-current {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary, #0891b2);
    padding: 0.2rem 0.3rem;
    white-space: nowrap;
}

.prob-custom {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.25rem;
}

.prob-input {
    width: 52px;
    text-align: center;
    font-weight: 600;
}

.prob-suffix {
    font-size: 0.8rem;
    color: var(--gray-500, #64748b);
    font-weight: 600;
}

/* ===== Action Picker ===== */
.action-picker-row {
    padding: 0 !important;
    margin-bottom: 0.25rem;
}

.action-select {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    max-width: 260px;
}

/* ===== Next Action Section ===== */
.na-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.na-btn-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-400, #9ca3af);
}

.na-hour-btns,
.na-day-btns {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.na-datetime {
    font-size: 0.8rem;
    font-weight: 600;
}

.na-datetime.overdue {
    color: var(--red-500, #ef4444);
}

.na-split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.na-tasks {
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 6px;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.na-task-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.task-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gray-400, #9ca3af);
}

.task-status-dot.completed {
    background: var(--green-500, #22c55e);
}

.task-status-dot.in_progress {
    background: var(--blue-500, #3b82f6);
}

.task-status-dot.pending {
    background: var(--gray-400, #9ca3af);
}

.task-status-dot.blocked {
    background: var(--red-500, #ef4444);
}

/* ===== Section label counts (no h4) ===== */
.contacts-count,
.notes-count {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #64748b);
}

.notes-header {
    margin-bottom: 0.5rem;
}

/* ===== Inline Edit ===== */
.editable {
    cursor: text;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    background: var(--gray-50, #f8fafc);
    transition: all 0.15s;
    position: relative;
    min-width: 2rem;
}

.editable:hover {
    border-color: var(--secondary, #0891b2);
    background: color-mix(in srgb, var(--secondary, #0891b2) 6%, white);
}

.editable:hover::after {
    content: 'Double-click to edit';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.2rem 0.5rem;
    background: var(--gray-800, #1e293b);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: editable-tooltip 0.2s 0.4s forwards;
}

@keyframes editable-tooltip {
    to { opacity: 1; }
}

.editable.editing {
    border-color: var(--secondary, #0891b2);
    background: #fff;
    padding: 0;
}

.editable.editing:hover::after {
    display: none;
}

.inline-input {
    width: 100%;
    padding: 0.2rem 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: inherit;
    font-family: inherit;
    color: var(--gray-800, #1e293b);
    background: transparent;
    outline: none;
}

.inline-textarea {
    resize: vertical;
    min-height: 3rem;
    line-height: 1.5;
}

/* Textarea editables — full width, top+bottom border only */
.editable[data-type="textarea"] {
    display: block;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--gray-200, #e2e8f0);
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
    background: transparent;
    padding: 0.25rem 0.25rem;
}

.editable[data-type="textarea"]:hover {
    border-top-color: var(--secondary, #0891b2);
    border-bottom-color: var(--secondary, #0891b2);
    background: color-mix(in srgb, var(--secondary, #0891b2) 3%, transparent);
}

.editable[data-type="textarea"].editing {
    border-top-color: var(--secondary, #0891b2);
    border-bottom-color: var(--secondary, #0891b2);
    background: #fff;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500, #64748b);
}

.empty-state h3 {
    color: var(--primary, #1e3a5f);
    margin-bottom: 0.5rem;
}

/* ===== Drag-and-drop (SortableJS) ===== */
.drag-ghost { opacity: 0.3; background: var(--primary-light, #e0f0ff); }
.drag-chosen { background: rgba(0, 119, 182, 0.08); }
.drag-active { opacity: 0.9; }
.drag-fallback {
    background: var(--bg, #fff);
    border: 1px solid var(--primary, #0077b6);
    border-radius: 4px;
    padding: 4px 8px;
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.8rem;
    max-width: 260px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* During cross-release drag, make overflow visible so SortableJS can detect drop targets */
.release-dragging .phase-card { overflow: visible !important; }
.release-dragging .phase-body { overflow: visible !important; }
.release-dragging .release-feature-list { min-height: 30px; }

/* ===== Pipeline drag-and-drop (proposal card → stage box) ===== */
.proposal-card[draggable="true"] {
    cursor: grab !important;
    -webkit-user-drag: element;
}
.proposal-card.pipeline-dragging { opacity: 0.35; cursor: grabbing !important; }
.drag-grip {
    position: absolute; top: 8px; left: 6px;
    font-size: 14px; line-height: 1; color: var(--text-secondary, #888);
    cursor: grab; opacity: 0.4; user-select: none;
}
.proposal-card:hover .drag-grip { opacity: 0.8; }
.proposal-card { position: relative; }
.pg-box.pg-drop-hover {
    outline: 2px solid var(--primary, #0077b6) !important;
    outline-offset: -2px;
    background: rgba(0, 119, 182, 0.18) !important;
    transform: scale(1.06);
    transition: transform 0.15s, background 0.15s, outline 0.15s;
}
/* Subtle pulse on all boxes during drag so user sees drop targets */
.pipeline-drag-active .pg-box {
    transition: transform 0.15s, background 0.15s;
    outline: 1px dashed rgba(0, 119, 182, 0.3);
    outline-offset: -1px;
}

/* ===== Tier Value Colors ===== */
.tier-value { color: var(--secondary, #0891b2); }
.tier-native { color: #059669; font-weight: 800; }
.card-metric-ai { display: flex; align-items: baseline; gap: 2px; }
.card-discount { font-size: 0.6rem; font-weight: 700; color: #059669; }

/* ===== Manual Adjustment Row ===== */
.adjust-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.adjust-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.adjust-input {
    width: 100px;
    text-align: right;
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
}

.adjust-current {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600, #475569);
    padding-right: 0.25rem;
}

.btn-adjust-action {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}

.btn-adjust-action:hover {
    background: #dcfce7;
    border-color: #22c55e;
}

.btn-clear {
    font-size: 0.7rem;
    color: var(--gray-500, #64748b);
    border-color: var(--gray-300, #cbd5e1);
}

.btn-clear:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* ===== Quote Form ===== */
.quote-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quote-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.quote-form-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--primary-dark, #152a45);
}

.quote-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--gray-500, #64748b);
}

.quote-tier-select {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.quote-tier-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 0.75rem;
    border: 2px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-600, #475569);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    min-width: 100px;
}

.quote-tier-btn:hover {
    border-color: var(--secondary, #0891b2);
    color: var(--secondary, #0891b2);
}

.quote-tier-btn.active {
    border-color: var(--secondary, #0891b2);
    background: color-mix(in srgb, var(--secondary, #0891b2) 8%, white);
    color: var(--secondary, #0891b2);
}

.quote-tier-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark, #152a45);
}

.quote-tier-btn.active .quote-tier-value {
    color: var(--secondary, #0891b2);
}

.quote-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
}

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

.quote-table th {
    position: sticky;
    top: 0;
    background: var(--gray-50, #f8fafc);
    padding: 0.5rem 0.6rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #64748b);
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
}

.quote-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
    color: var(--gray-700, #334155);
}

.quote-table tbody tr:hover {
    background: var(--gray-50, #f8fafc);
}

.quote-col-code { width: 70px; }
.quote-col-num { width: 80px; text-align: right; }
.quote-code { font-weight: 600; color: var(--primary, #1e3a5f); font-size: 0.75rem; }
.quote-num { text-align: right; font-variant-numeric: tabular-nums; }

.quote-total-row td {
    border-top: 2px solid var(--gray-300, #cbd5e1);
    border-bottom: none;
    padding-top: 0.5rem;
    font-size: 0.85rem;
}

.quote-adjust-row td {
    color: var(--secondary, #0891b2);
    font-style: italic;
    font-size: 0.8rem;
}

.quote-final-row td {
    border-top: 1px solid var(--gray-300, #cbd5e1);
    color: #059669;
    font-size: 0.9rem;
}

.quote-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500, #64748b);
}

.quote-savings {
    color: #059669;
    font-weight: 600;
}

.quote-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200, #e2e8f0);
}

.quote-name-input {
    flex: 1;
    font-size: 0.85rem;
}

.quote-existing {
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200, #e2e8f0);
}

.quote-existing h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500, #64748b);
}

.quote-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.quote-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 6px;
    font-size: 0.8rem;
}

.quote-list-info {
    flex: 1;
    min-width: 0;
}

.quote-list-name {
    font-weight: 600;
    color: var(--gray-800, #1e293b);
    display: block;
}

.quote-list-meta {
    font-size: 0.7rem;
    color: var(--gray-500, #64748b);
}

.quote-list-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.quote-list-status.draft { background: #f3e8ff; color: #7c3aed; }
.quote-list-status.sent { background: #dbeafe; color: #1d4ed8; }
.quote-list-status.accepted { background: #d1fae5; color: #047857; }
.quote-list-status.rejected { background: #fee2e2; color: #b91c1c; }

.quote-list-date {
    font-size: 0.7rem;
    color: var(--gray-400, #94a3b8);
    white-space: nowrap;
}

.quote-print-link {
    color: var(--gray-400, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0.1rem;
    border-radius: 3px;
    transition: color 0.15s;
}
.quote-print-link:hover {
    color: var(--primary, #1e3a5f);
}

/* ===== Quote Feature Selection ===== */
.quote-col-check { width: 32px; text-align: center; }
.quote-col-check input[type="checkbox"] { accent-color: var(--secondary, #0891b2); }

.qt-release-row {
    background: var(--gray-50, #f8fafc);
}

.qt-release-row td {
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
}

.qt-release-label {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--primary-dark, #152a45);
    padding: 0.4rem 0.6rem;
}

.qt-release-ver {
    font-weight: 500;
    color: var(--gray-400, #94a3b8);
    font-size: 0.72rem;
}

.qt-feature-row.qt-excluded {
    opacity: 0.35;
}

.qt-feature-row.qt-excluded td {
    text-decoration: line-through;
    color: var(--gray-400, #94a3b8);
}

.qt-feature-cb, .qt-release-cb {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: var(--secondary, #0891b2);
}

/* ===== Quotes Section (in detail panel) ===== */
.quotes-section {
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--gray-50, #f8fafc);
}

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

.quotes-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.quote-tab-btn {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--gray-300, #cbd5e1);
    border-radius: 6px;
    background: var(--surface, #fff);
    text-decoration: none;
    color: inherit;
    font-size: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 120px;
}
.quote-tab-btn:hover {
    border-color: var(--secondary, #0891b2);
    box-shadow: 0 1px 4px rgba(8, 145, 178, 0.15);
}

.quote-tab-name {
    font-weight: 600;
    color: var(--gray-800, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.quote-tab-meta {
    font-size: 0.68rem;
    color: var(--gray-500, #64748b);
}

.quote-tab-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.quote-tab-btn.draft .quote-tab-status { color: #7c3aed; }
.quote-tab-btn.sent .quote-tab-status { color: #1d4ed8; }
.quote-tab-btn.accepted .quote-tab-status { color: #047857; }
.quote-tab-btn.rejected .quote-tab-status { color: #b91c1c; }

/* ===== Editable Estimation Table ===== */
.estimation-table .editable {
    min-width: 3rem;
    padding: 0.15rem 0.35rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.estimation-table .editable .inline-input {
    width: 60px;
    text-align: right;
}

.estimation-actions-cell {
    width: 32px;
    text-align: center;
    padding: 0 0.25rem;
}

.btn-delete-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: var(--gray-400, #94a3b8);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.estimation-detail-row:hover .btn-delete-sm {
    opacity: 1;
}

.btn-delete-sm:hover {
    color: #ef4444;
    background: #fee2e2;
    border-color: #fca5a5;
}

.add-role-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0;
}

.add-role-form .form-control-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
}

.add-role-form .btn {
    flex-shrink: 0;
}

/* ===== Breakdown Table (estimation audit) ===== */
.breakdown-table .editable {
    min-width: 2.5rem;
    padding: 0.1rem 0.25rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
}

.breakdown-table .editable[data-type="number"] {
    text-align: right;
    min-width: 2rem;
}

.breakdown-table .editable[data-type="textarea"] {
    font-size: 0.72rem;
    line-height: 1.3;
}

.breakdown-table .editable .inline-input {
    width: 50px;
    text-align: right;
    font-size: 0.75rem;
}

.breakdown-table .editable[data-type="text"] .inline-input {
    width: 140px;
    text-align: left;
}

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

.breakdown-row td {
    vertical-align: middle;
}
