/* ELS Investment Management — shared theme
   Palette sampled from the ELS logo. Every screen, internal and client-facing,
   draws its colour, card style and status pills from here. */

:root {
    /* Sampled from the ELS logo: deep aubergine through to magenta-purple,
       with the wordmark charcoal as the neutral ink. */
    --els-primary: #480048;
    --els-primary-dark: #240038;
    --els-primary-mid: #300040;
    --els-primary-deep: #200040;
    --els-primary-soft: #f8f1f9;
    --els-primary-tint: #efe2f1;
    --els-border: #e7d8ea;
    --els-ink: #333333;
    --els-text: #2a1b2e;
    --els-muted: #7a6b80;
    --els-bg: #f5f4f7;
    --els-gradient: linear-gradient(135deg, var(--els-primary-deep) 0%, var(--els-primary-mid) 45%, var(--els-primary) 100%);
    --els-sidebar-width: 260px;
}

body {
    background: var(--els-bg);
    color: var(--els-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

::placeholder {
    color: #aeb7c2 !important;
    opacity: 1;
}

/* ---------- Shell ---------- */

.els-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--els-sidebar-width);
    background: linear-gradient(180deg, var(--els-primary-deep) 0%, var(--els-primary-mid) 55%, var(--els-primary) 100%);
    color: #fff;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}

.els-sidebar .sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.els-sidebar .brand-logo {
    height: 44px;
    width: auto;
}

.els-sidebar .brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .3px;
}

.els-sidebar .brand-subtitle {
    font-size: 11px;
    opacity: .8;
}

.els-sidebar .nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    opacity: .6;
    padding: 16px 18px 6px;
}

.els-sidebar .nav-link {
    color: rgba(255, 255, 255, .85);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
}

.els-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.els-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .16);
    border-left-color: #fff;
    color: #fff;
    font-weight: 600;
}

.els-sidebar .nav-link.disabled {
    opacity: .45;
    pointer-events: none;
}

.els-main {
    margin-left: var(--els-sidebar-width);
    min-height: 100vh;
}

.els-topbar {
    background: #fff;
    border-bottom: 1px solid var(--els-border);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.els-page-header {
    padding: 22px 24px 0;
}

.els-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--els-primary-dark);
    margin: 0;
}

.els-page-subtitle {
    font-size: 13px;
    color: var(--els-muted);
}

.els-content {
    padding: 18px 24px 40px;
}

/* ---------- Cards ---------- */

.els-card {
    background: #fff;
    border: 1px solid var(--els-border);
    border-radius: 15px;
    box-shadow: 0 4px 22px rgba(32, 0, 64, .07);
}

.els-card-header {
    background: var(--els-primary-soft);
    color: var(--els-primary-dark);
    border-bottom: 1px solid var(--els-border);
    border-radius: 15px 15px 0 0;
    padding: 15px 20px;
    font-weight: 700;
    font-size: 15px;
}

.els-card-body {
    padding: 20px;
}

.metric-card .metric-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--els-primary-dark);
    line-height: 1.1;
}

.metric-card .metric-label {
    font-size: 12px;
    color: var(--els-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.metric-card .metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--els-primary-soft);
    color: var(--els-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* ---------- Buttons ---------- */

.btn-els {
    background: var(--els-primary);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
}

.btn-els:hover,
.btn-els:focus {
    background: var(--els-primary-dark);
    color: #fff;
}

.btn-outline-els {
    border: 1px solid var(--els-primary);
    color: var(--els-primary);
    border-radius: 8px;
    font-weight: 600;
    background: transparent;
}

.btn-outline-els:hover {
    background: var(--els-primary);
    color: #fff;
}

input.btn-check:checked + label.investment-record-filter-option {
    background: var(--els-primary);
    border-color: var(--els-primary);
    color: #fff;
}

/* ---------- Tables ---------- */

.table th {
    background: var(--els-primary-soft);
    color: var(--els-primary-dark);
    font-size: 12px;
    white-space: nowrap;
}

.table td {
    font-size: 13px;
    vertical-align: middle;
}

.table td.amount,
.table th.amount {
    text-align: right;
    white-space: nowrap;
}

/* ---------- Forms ---------- */

.form-control,
.form-select {
    min-height: 42px;
    border-color: #ddd1ea;
    border-radius: 8px;
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--els-primary);
    box-shadow: 0 0 0 .2rem rgba(72, 0, 72, .13);
}
.form-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-label .required {
    color: #dc3545;
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--els-primary);
    border-bottom: 1px solid var(--els-border);
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.small-note {
    font-size: 12px;
    color: var(--els-muted);
}

.els-card-body [class*="col-"] {
    min-width: 0;
}

/* ---------- Status pills ---------- */

.status-pill {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 30px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

/* ---------- Approval chain ---------- */

.approval-step {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--els-border);
}

.approval-step:last-child {
    border-bottom: 0;
}

.approval-step .step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 30px;
    background: #eee;
    color: #888;
}

.approval-step.done .step-dot {
    background: #d1e7dd;
    color: #0f5132;
}

.approval-step.current .step-dot {
    background: #fff3cd;
    color: #7a5400;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .els-sidebar {
        transform: translateX(-100%);
    }

    .els-sidebar.show {
        transform: translateX(0);
    }

    .els-main {
        margin-left: 0;
    }

    .els-content,
    .els-page-header {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* ---------- Brand marks ---------- */

.els-logo {
    height: 42px;
    width: auto;
    display: block;
}

.els-logo-lg {
    height: 64px;
    width: auto;
    display: block;
}

.els-logo-sm {
    height: 30px;
    width: auto;
    display: block;
}

/* ---------- Sub navigation ---------- */

.nav-tabs .nav-link {
    color: var(--els-muted);
    font-weight: 600;
    font-size: 14px;
    border: 0;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--els-primary);
    border-bottom-color: var(--els-primary-tint);
}

.nav-tabs .nav-link.active {
    color: var(--els-primary);
    background: transparent;
    border-bottom-color: var(--els-primary);
}

/* ---------- Timeline ---------- */

.els-timeline {
    position: relative;
    padding-left: 22px;
}

.els-timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--els-border);
}

.els-timeline-item {
    position: relative;
    padding-bottom: 14px;
}

.els-timeline-item::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--els-primary-tint);
    border: 2px solid var(--els-primary);
}

/* ---------- Utility ---------- */

/* Keep calculated and locked form values visually distinct from editable inputs. */
.form-control[readonly],
.form-select[readonly],
textarea[readonly],
.form-control:disabled,
.form-select:disabled,
.form-check-input:disabled {
    background-color: #f1f3f5 !important;
    border-color: #d7dce1 !important;
    color: #495057 !important;
    opacity: 1 !important;
}

.text-els { color: var(--els-primary) !important; }
.bg-els-soft { background: var(--els-primary-soft) !important; }
.badge.bg-payout-completed { background-color: #6f42c1 !important; color: #fff !important; }

.stat-strip {
    background: var(--els-gradient);
    color: #fff;
    border-radius: 15px;
    padding: 18px 22px;
}

.stat-strip .stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-strip .stat-label {
    font-size: 12px;
    opacity: .82;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Choice cards — "Existing Client" vs "New Client" on the proposal form,
   and any similar two-way pick. */
.els-choice-card {
    border: 2px solid var(--els-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    height: 100%;
    transition: border-color .15s ease, background-color .15s ease;
}

.els-choice-card:hover { border-color: var(--els-primary); }

.els-choice-card.active {
    border-color: var(--els-primary);
    background: var(--els-primary-soft);
}

/* ---------- Marketing requests ---------- */

.mk-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mk-status-tabs a {
    border: 1px solid var(--els-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--els-muted);
    text-decoration: none;
    background: #fff;
}

.mk-status-tabs a.active,
.mk-status-tabs a:hover {
    background: var(--els-primary);
    border-color: var(--els-primary);
    color: #fff;
}

.mk-status-tabs .mk-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--els-primary-tint);
    color: var(--els-primary-dark);
    font-size: 11px;
    text-align: center;
}

.mk-status-tabs a.active .mk-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.mk-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.mk-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--els-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--els-primary-soft);
}

.mk-thumb img,
.mk-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mk-thumb .mk-thumb-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--els-primary);
}

.mk-thumb .mk-thumb-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, .92);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 12px;
}

.mk-brief {
    white-space: pre-line;
    line-height: 1.7;
}

.mk-revision {
    border: 1px solid var(--els-border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.mk-revision + .mk-revision {
    margin-top: 12px;
}

.mk-revision.is-current {
    border-color: var(--els-primary);
    box-shadow: 0 0 0 3px var(--els-primary-tint);
}

.mk-preview {
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
}

.mk-reject-note {
    background: #fdf0f1;
    border-left: 3px solid #dc3545;
    border-radius: 6px;
    padding: 8px 10px;
    color: #a52834;
    font-size: 13px;
}

.mk-dropzone {
    border: 2px dashed var(--els-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--els-primary-soft);
}

.mk-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--els-border);
    color: inherit;
    text-decoration: none;
}

.mk-list-item:last-child {
    border-bottom: 0;
}

.mk-list-item:hover .mk-list-title {
    color: var(--els-primary);
}

.min-w-0 {
    min-width: 0;
}
