:root {
    --navy: #0c2d5b;
    --navy-dark: #081f42;
    --navy-mid: #16407c;
    --green: #16407c;
    --green-dark: #0c2d5b;
    --paper: #f4f6fb;
    --line: #d5dce8;
    --ink: #1c2430;
    --muted: #5b6775;
    --white: #fff;
    --danger: #b42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", sans-serif; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #e7eef8, #f4f6fb);
}
.login-card {
    width: min(420px, calc(100% - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(12, 45, 91, .12);
}
.login-card img { display: block; width: 180px; height: auto; margin-bottom: 8px; }
.login-card p { color: var(--muted); }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%); color: #d5deee; padding: 22px 16px; }
.sidebar .brand {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 24px;
}
.sidebar .brand img { display: block; width: 100%; height: auto; }
.sidebar a { display: block; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .out { margin-top: 24px; color: #f2c9c4; }
.admin-main { padding: 28px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}
.card strong { display: block; font-size: 28px; color: var(--green-dark); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.badge.new { background: #e7eef8; color: var(--navy); }
.badge.ringing, .badge.busy, .badge.switched_off { background: #fff4d6; color: #8a5a00; }
.badge.follow_up { background: #eef2ff; color: #3730a3; }
.badge.documents_collected, .badge.login { background: #e0f2fe; color: #075985; }
.badge.not_interested, .badge.not_eligible, .badge.rejected { background: #fde8e6; color: #b42318; }
.badge.disbursed { background: #dcfce7; color: #166534; }
.badge.contacted { background: #eef2ff; color: #3730a3; }
.badge.closed { background: #f3f4f6; color: #374151; }
.lead-history { list-style: none; margin: 0; padding: 0; }
.lead-history li {
    border-left: 2px solid var(--line);
    padding: 0 0 18px 18px;
    margin-left: 6px;
    position: relative;
}
.lead-history li:last-child { padding-bottom: 0; }
.lead-history li::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--navy);
    border-radius: 50%;
    position: absolute;
    left: -6px;
    top: 6px;
}
.lead-history-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.lead-history p { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select, form input, form textarea, form select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    background: linear-gradient(180deg, var(--navy-mid), var(--navy));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.btn.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.alert.success { background: #e7eef8; color: var(--navy); }
.alert.error { background: #fde8e6; color: var(--danger); }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; }
.form-grid label[hidden] { display: none !important; }
.muted { color: var(--muted); }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.actions-row .filters { margin: 0; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.row-actions form { margin: 0; }
.check-row { display: flex !important; align-items: center; gap: 8px; font-weight: 600; }
.check-row input { width: auto; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr 1fr; }
    .split-2 { grid-template-columns: 1fr; }
}
