:root {
    --purple:      #5B2D8E;
    --purple-dark: #3d1d63;
    --purple-light:#7B4DB5;
    --silver:      #C0C0C0;
    --silver-light:#f0f0f5;
    --sidebar-w:   240px;
}

body {
    background: #f4f3f8;
    font-family: 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--purple-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: .65rem 1.25rem;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: .9rem;
    transition: all .2s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background: var(--purple-light);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: .82rem;
}

.badge-role {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: .72rem;
}

.btn-logout {
    display: block;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: .83rem;
    padding: .3rem 0;
    transition: color .2s;
}
.btn-logout:hover { color: #fff; }

/* ── Main content ── */
#content {
    margin-left: var(--sidebar-w);
    padding: 2rem;
    width: 100%;
}

/* ── Page header ── */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple-dark);
    margin: 0;
}
.page-header p {
    color: #888;
    margin: 0;
    font-size: .9rem;
}

/* ── Stat cards ── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--purple);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--purple);
    line-height: 1;
}
.stat-card .stat-label {
    color: #888;
    font-size: .85rem;
    margin-top: .25rem;
}
.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--silver);
}

/* ── Cards ── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: var(--purple-dark);
    border-radius: 10px 10px 0 0 !important;
}

/* ── Tables ── */
.table th {
    color: var(--purple-dark);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--silver-light);
}
.table td { vertical-align: middle; font-size: .9rem; }

/* ── Status badges ── */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
}
.status-enquiry          { background:#e8e0f5; color:#5B2D8E; }
.status-fact_find        { background:#dce8fb; color:#1a56db; }
.status-dip              { background:#fef3cd; color:#856404; }
.status-full_application { background:#fff0d0; color:#b35c00; }
.status-offered          { background:#d1f5dc; color:#166534; }
.status-exchanged        { background:#c7f5f5; color:#0d6e6e; }
.status-completed        { background:#d1fae5; color:#065f46; }

/* ── Pipeline progress bar ── */
.pipeline-wrap {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 1.5rem 0;
}
.pipeline-wrap::before {
    content: '';
    position: absolute;
    top: 16px; left: 0; right: 0;
    height: 3px;
    background: #ddd;
    z-index: 0;
}
.pipeline-step {
    text-align: center;
    flex: 1;
    position: relative;
    z-index: 1;
}
.pipeline-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .4rem;
    font-size: .8rem;
    font-weight: 700;
}
.pipeline-dot.done  { background: var(--purple); color: #fff; }
.pipeline-dot.current { background: var(--purple-light); color: #fff; box-shadow: 0 0 0 4px rgba(91,45,142,.2); }
.pipeline-label { font-size: .72rem; color: #666; }
.pipeline-label.done    { color: var(--purple); font-weight: 600; }
.pipeline-label.current { color: var(--purple-light); font-weight: 700; }

/* ── Notes ── */
.note-item {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: .75rem;
    font-size: .88rem;
}
.note-staff  { background: #f0eaf8; border-left: 3px solid var(--purple); }
.note-client { background: #fff8e1; border-left: 3px solid #f59e0b; }
.note-meta   { font-size: .76rem; color: #888; margin-bottom: .25rem; }

/* ── Doc checklist ── */
.doc-item {
    display: flex;
    align-items: center;
    padding: .6rem .75rem;
    border-radius: 8px;
    margin-bottom: .5rem;
    background: #f9f9f9;
    font-size: .88rem;
}
.doc-item.received  { background: #edfaf2; }
.doc-item.missing   { background: #fff5f5; }
.doc-check { font-size: 1.1rem; margin-right: .6rem; }
.doc-check.yes { color: #16a34a; }
.doc-check.no  { color: #dc2626; }

/* ── Login page ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-light) 100%);
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo i { font-size: 2.5rem; color: var(--purple); }
.login-logo h2 { color: var(--purple-dark); font-weight: 700; margin: .5rem 0 0; }
.login-logo p  { color: #888; font-size: .85rem; }
.btn-purple {
    background: var(--purple);
    color: #fff;
    border: none;
    width: 100%;
    padding: .7rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background .2s;
}
.btn-purple:hover { background: var(--purple-dark); color: #fff; }