:root{--blue:#155eef;--navy:#172b4d;--bg:#f4f6f8;--border:#d9e0e7;--text:#17202a;--muted:#667085;--danger:#b42318;--success:#067647}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}a{color:inherit}.topbar{min-height:58px;background:var(--navy);color:#fff;display:flex;align-items:center;padding:0 18px;gap:22px;position:sticky;top:0;z-index:20}.brand{font-size:18px;font-weight:750;text-decoration:none;white-space:nowrap}.nav{display:flex;gap:5px;flex:1}.nav a{padding:9px 11px;text-decoration:none;border-radius:6px;color:#dce6f5}.nav a:hover,.nav a.active{background:#29436e;color:#fff}.account{display:flex;align-items:center;gap:12px;white-space:nowrap}.account form{margin:0}.link-button{border:0;background:transparent;color:#fff;text-decoration:underline;cursor:pointer}.nav-toggle{display:none}.container{padding:20px;max-width:100%;margin:auto}.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.page-head h1{font-size:24px;margin:0}.page-head p,.muted{margin:4px 0;color:var(--muted)}.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px}.metrics article{background:#fff;border:1px solid var(--border);border-radius:9px;padding:16px}.metrics span{display:block;color:var(--muted)}.metrics strong{font-size:25px;display:block;margin-top:5px}.danger-card strong{color:var(--danger)}.filters{display:flex;gap:8px;flex-wrap:wrap;background:#fff;border:1px solid var(--border);padding:10px;border-radius:8px;margin-bottom:12px}.filters input{min-width:280px;flex:1}.filters input,.filters select,input,select,textarea{border:1px solid #bfc9d4;border-radius:6px;background:#fff;padding:8px 10px;min-height:37px}.primary,.button{display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;padding:8px 13px;text-decoration:none;cursor:pointer;min-height:37px}.primary{background:var(--blue);color:#fff}.button{background:#fff;border-color:var(--border)}.full{width:100%}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--border);border-radius:8px;max-width:100%}table{border-collapse:separate;border-spacing:0;width:100%}th,td{padding:8px 10px;border-right:1px solid #e5e9ee;border-bottom:1px solid #e5e9ee;text-align:left;white-space:nowrap;max-width:260px;overflow:hidden;text-overflow:ellipsis}th{background:#eaf0f8;font-weight:700;position:sticky;top:0;z-index:3}.lead-grid{width:max-content;min-width:100%}.lead-grid td{height:45px}.sticky-col{position:sticky;left:0;z-index:4;background:#fff}.lead-grid th.sticky-col{background:#dce7f5;z-index:6}.cell-form{margin:0}.cell-form select,.cell-form input{min-width:125px;padding:5px 7px;min-height:32px}.cell-form input[type="datetime-local"]{min-width:185px}.cell-form input[type="date"]{min-width:145px}.cell-form input[type="number"]{width:125px}.badge{display:inline-block;border-radius:999px;padding:3px 8px;font-size:12px;background:#eef2f6}.source-facebook{color:#1849a9;background:#e8f1ff}.source-external{color:#854a0e;background:#fff1d6}.empty{text-align:center;padding:40px;color:var(--muted)}.pagination{display:flex;justify-content:center;align-items:center;gap:14px;margin:15px}.alert{padding:10px 12px;border-radius:7px;margin-bottom:12px;background:#e7f6ec;color:var(--success)}.alert.error{background:#feeceb;color:var(--danger)}.panel{background:#fff;border:1px solid var(--border);border-radius:8px;padding:18px}.panel h2{margin-top:0}.split{display:flex;gap:16px;align-items:flex-start}.split>.panel:first-child{width:330px}.grow{flex:1;min-width:0}.stack{display:grid;gap:12px}.stack label,.login-card label{display:grid;gap:5px;font-weight:650}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(140deg,#eef4ff,#f8fafc)}.login-card{width:min(390px,100%);background:#fff;border:1px solid var(--border);border-radius:12px;padding:28px;box-shadow:0 16px 45px rgba(23,43,77,.12)}.login-card h1{margin:0}.login-card form{display:grid;gap:15px;margin-top:22px}.target-input{width:105px}.target-input+small{display:block;color:var(--muted);margin-top:3px}.lead-form{background:#fff;border:1px solid var(--border);border-radius:8px;padding:16px}.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:13px}.form-grid label{display:grid;gap:5px;font-weight:650}.form-grid label.wide{grid-column:span 2}.form-grid input,.form-grid select,.form-grid textarea{width:100%;font-weight:400}.form-grid textarea{resize:vertical}.form-actions{position:sticky;bottom:0;background:#fff;padding:14px 0 2px;border-top:1px solid var(--border);margin-top:15px}.activity-panel{margin-top:18px}@media(max-width:800px){.topbar{flex-wrap:wrap;padding:10px 14px;gap:10px}.nav-toggle{display:block;margin-left:auto}.nav{display:none;width:100%;order:4;flex-direction:column}.nav.open{display:flex}.account{margin-left:auto}.container{padding:12px}.split{display:block}.split>.panel:first-child{width:auto;margin-bottom:14px}.filters input{min-width:100%}.form-grid label.wide{grid-column:span 1}}
.user-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.user-actions form{margin:0}.password-reset-form{display:flex;gap:5px}.password-reset-form input{width:145px}.status-pill{display:inline-block;padding:4px 9px;border-radius:999px;font-size:12px}.status-pill.active{background:#e7f6ec;color:#067647}.status-pill.disabled{background:#feeceb;color:#b42318}.inline-user-form{margin:0}
.users-table{table-layout:auto;width:100%}
.users-table th,.users-table td{vertical-align:middle}
.users-table th:nth-child(1){min-width:210px}
.users-table th:nth-child(2){min-width:240px}
.users-table th:nth-child(3){min-width:135px}
.users-table th:nth-child(4){min-width:90px}
.users-table th:nth-child(5){min-width:175px}
.users-table .management-cell{min-width:430px}
.users-table td>input,.users-table td>select{width:100%;min-width:0}
.user-actions{
    display:grid;
    grid-template-columns:72px 96px minmax(150px,1fr) 70px;
    align-items:center;
    gap:7px;
    width:100%;
}
.user-actions>button,
.user-actions>.button,
.toggle-user-form,
.toggle-user-form button{
    width:100%;
}
.user-actions form{margin:0}
.user-actions .password-reset-form{display:contents}
.password-reset-form input{
    width:100%;
    min-width:150px;
}
.password-reset-form button{width:100%}
.action-placeholder{
    display:block;
    width:100%;
    min-height:37px;
}
.status-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:70px;
}
@media(max-width:900px){
    .users-table .management-cell{min-width:300px}
    .user-actions{
        grid-template-columns:1fr 1fr;
    }
    .password-reset-form{display:contents}
    .action-placeholder{display:none}
}

.target-dashboard{margin-top:18px}
.target-section-heading{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}
.target-section-heading h2{margin:0}
.target-card-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:12px;
}
.target-card{
    border:1px solid var(--border);
    border-radius:8px;
    padding:14px;
    background:#f9fbfd;
}
.target-card-heading{
    display:flex;
    justify-content:space-between;
    gap:10px;
}
.target-card-heading strong{color:var(--blue)}
.target-values{
    margin:9px 0;
    font-size:18px;
    font-weight:700;
}
.target-progress{
    height:9px;
    overflow:hidden;
    border-radius:999px;
    background:#e5eaf0;
}
.target-progress span{
    display:block;
    height:100%;
    border-radius:999px;
    background:var(--blue);
}
.target-progress.small{
    height:6px;
    margin-top:7px;
    min-width:125px;
}
.target-achievement{
    display:block;
    color:var(--muted);
    margin-top:5px;
}
.targets-table td{vertical-align:middle}
.targets-table .target-input{width:115px}

.attendance-metrics{margin-bottom:18px}
.attendance-panel{margin-top:16px}
.attendance-table th,
.attendance-table td{vertical-align:middle}
.attendance-table td{height:48px}


.external-delete-form {
    display: inline-block;
    margin-left: 8px;
}

.external-delete-button {
    border: 0;
    background: transparent;
    color: #c62828;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    padding: 2px 4px;
    text-decoration: underline;
}

.external-delete-button:hover,
.external-delete-button:focus {
    color: #8e0000;
}

/* FLOATING LEAD TABLE SCROLLBAR */
.floating-table-scrollbar {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 28px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #f8fafc;
    border: 1px solid #bfc9d4;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    box-shadow: 0 -3px 12px rgba(23, 43, 77, .14);
    z-index: 40;
}
.floating-table-scrollbar[hidden] {
    display: none;
}
.floating-table-scrollbar-inner {
    height: 1px;
}

.floating-table-scrollbar::-webkit-scrollbar {
    height: 18px;
}
.floating-table-scrollbar::-webkit-scrollbar-thumb {
    background: #8c9bad;
    border: 3px solid #f8fafc;
    border-radius: 999px;
}
.floating-table-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
}

/* EXTERNAL BULK DELETE UI */
.external-bulk-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
#external-selected-count {
    color: var(--muted);
    font-weight: 650;
    margin-left: auto;
}
.bulk-delete-button {
    min-height: 37px;
    padding: 8px 13px;
    border: 1px solid #b42318;
    border-radius: 6px;
    color: #fff;
    background: #b42318;
    cursor: pointer;
}
.bulk-delete-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}
.bulk-select-column {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
}
.bulk-select-column input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    cursor: pointer;
}
@media (max-width: 620px) {
    #external-selected-count {
        width: 100%;
        margin-left: 0;
    }
}

/* LEAD COLUMN CHOOSER UI */
.lead-table-tools {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 10px;
}
.column-chooser {
    position: relative;
}
.column-chooser > summary {
    list-style: none;
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}
.column-chooser > summary::-webkit-details-marker {
    display: none;
}
.column-chooser > summary::after {
    content: "+";
    margin-left: 9px;
}
.column-chooser[open] > summary::after {
    content: "-";
}
.column-chooser-menu {
    position: absolute;
    z-index: 35;
    top: calc(100% + 6px);
    right: 0;
    width: min(330px, calc(100vw - 30px));
    max-height: 430px;
    overflow-y: auto;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 14px 35px rgba(23, 43, 77, .18);
}
.column-chooser-title {
    font-weight: 750;
    margin: 0 0 9px;
}
.column-chooser-menu label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 4px;
    cursor: pointer;
}
.column-chooser-menu input {
    width: 17px;
    height: 17px;
    min-height: 17px;
    margin: 0;
}
.column-show-all {
    width: 100%;
    margin-top: 10px;
}

/* CLICKABLE DASHBOARD CARDS */
.dashboard-metrics .metric-card,
.dashboard-source-cards .metric-card {
    display: block;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 16px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease,
        background .16s ease;
}
.dashboard-metrics .metric-card:hover,
.dashboard-source-cards .metric-card:hover {
    border-color: var(--blue);
    box-shadow: 0 8px 22px rgba(23, 43, 77, .12);
    transform: translateY(-2px);
}
.dashboard-metrics .metric-card:focus-visible,
.dashboard-source-cards .metric-card:focus-visible {
    outline: 3px solid rgba(21, 94, 239, .24);
    outline-offset: 2px;
    border-color: var(--blue);
}
.dashboard-metrics .metric-card.is-selected {
    border-color: var(--blue);
    background: #f3f7ff;
    box-shadow: inset 0 0 0 1px var(--blue);
}
.dashboard-metrics .metric-card small,
.dashboard-source-cards .metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 650;
}
.dashboard-source-breakdown {
    margin-top: 16px;
}
.dashboard-breakdown-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.dashboard-breakdown-heading h2 {
    margin: 0;
}
.dashboard-source-cards {
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
}
.dashboard-source-cards .source-choice-card strong {
    font-size: 25px;
}
@media (max-width: 640px) {
    .dashboard-breakdown-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

/* MODERN DASHBOARD 2026 */
body:has(.dashboard-shell) {
    background:
        radial-gradient(
            circle at 15% 5%,
            rgba(37, 99, 235, .07),
            transparent 30%
        ),
        #f5f7fb;
}
body:has(.dashboard-shell) .topbar {
    min-height: 64px;
    background:
        linear-gradient(
            110deg,
            #10264a 0%,
            #173a72 55%,
            #1e4a8f 100%
        );
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 24px rgba(15, 39, 78, .16);
}
body:has(.dashboard-shell) .brand {
    font-size: 19px;
    letter-spacing: -.3px;
}
body:has(.dashboard-shell) .nav a {
    color: rgba(255, 255, 255, .78);
}
body:has(.dashboard-shell) .nav a:hover,
body:has(.dashboard-shell) .nav a.active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
body:has(.dashboard-shell) .container {
    padding: 26px;
}
.dashboard-shell {
    --dashboard-blue: #2563eb;
    --dashboard-navy: #10264a;
    --dashboard-card: #fff;
    max-width: 1600px;
    margin: 0 auto;
}
.dashboard-hero {
    position: relative;
    isolation: isolate;
    min-height: 210px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    overflow: hidden;
    padding: 34px 38px;
    border-radius: 22px;
    color: #fff;
    background:
        linear-gradient(
            120deg,
            #10264a 0%,
            #174b96 52%,
            #2875e6 100%
        );
    box-shadow:
        0 20px 45px rgba(20, 67, 137, .2);
}
.dashboard-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 310px;
    height: 310px;
    top: -170px;
    right: 19%;
    border-radius: 50%;
    border: 55px solid rgba(255, 255, 255, .07);
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 240px;
    height: 240px;
    right: -70px;
    bottom: -150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.dashboard-hero-copy {
    max-width: 680px;
}
.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 13px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .09);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}
.dashboard-hero h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.14;
    letter-spacing: -1.3px;
}
.dashboard-hero p {
    max-width: 570px;
    margin: 12px 0 18px;
    color: rgba(255, 255, 255, .76);
    font-size: 15px;
}
.dashboard-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 650;
}
.dashboard-date::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #75f0c1;
    box-shadow: 0 0 0 5px rgba(117, 240, 193, .13);
}
.dashboard-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(145px, 1fr));
    gap: 11px;
    min-width: 330px;
}
.dashboard-action {
    display: flex;
    min-height: 85px;
    flex-direction: column;
    justify-content: center;
    padding: 15px 17px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    transition:
        transform .18s ease,
        background .18s ease,
        box-shadow .18s ease;
}
.dashboard-action span {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .68);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.dashboard-action strong {
    font-size: 14px;
}
.dashboard-action.secondary {
    background: rgba(255, 255, 255, .1);
}
.dashboard-action.primary {
    background: rgba(255, 255, 255, .2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
.dashboard-action:hover {
    color: #fff;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .26);
}
.dashboard-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 28px 2px 15px;
}
.section-kicker {
    display: block;
    margin-bottom: 3px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.dashboard-section-heading h2,
.modern-breakdown-heading h2 {
    margin: 0;
    color: #152642;
    font-size: 22px;
    letter-spacing: -.45px;
}
.dashboard-text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}
.dashboard-text-link > span {
    font-size: 0;
}
.dashboard-text-link > span::after {
    content: "\2192";
    font-size: 17px;
}
.modern-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}
.modern-metric-card {
    --accent: #2563eb;
    --soft: #eff6ff;
    position: relative;
    min-width: 0;
    min-height: 196px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 19px;
    border: 1px solid #e4e9f1;
    border-radius: 17px;
    color: #17263f;
    background: var(--dashboard-card);
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(24, 44, 76, .055);
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}
.modern-metric-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -55px;
    bottom: -58px;
    border-radius: 50%;
    background: var(--soft);
    opacity: .75;
}
.modern-metric-card:hover {
    color: #17263f;
    border-color: color-mix(
        in srgb,
        var(--accent) 38%,
        #dfe5ee
    );
    box-shadow: 0 16px 32px rgba(26, 54, 96, .11);
    transform: translateY(-4px);
}
.modern-metric-card:focus-visible,
.modern-source-card:focus-visible,
.dashboard-action:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 3px;
}
.modern-metric-card.is-selected {
    border-color: var(--accent);
    box-shadow:
        0 0 0 2px var(--soft),
        0 14px 30px rgba(26, 54, 96, .1);
}
.metric-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 17px;
}
.metric-icon {
    min-width: 43px;
    height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border-radius: 12px;
    color: var(--accent);
    background: var(--soft);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .4px;
}
.metric-arrow {
    color: #94a3b8;
    font-size: 0;
}
.metric-arrow::after {
    content: "\2197";
    font-size: 18px;
}
.metric-label {
    display: block;
    color: #66758c;
    font-size: 13px;
    font-weight: 650;
}
.metric-value {
    position: relative;
    z-index: 1;
    display: block;
    overflow: hidden;
    margin: 5px 0 6px;
    color: #14233b;
    font-size: clamp(25px, 2.1vw, 33px);
    line-height: 1.12;
    letter-spacing: -.8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.metric-description {
    position: relative;
    z-index: 1;
    margin-top: auto;
    color: #8995a7;
    font-size: 12px;
}
.tone-blue {
    --accent: #2563eb;
    --soft: #eaf2ff;
}
.tone-violet {
    --accent: #7c3aed;
    --soft: #f1eafe;
}
.tone-indigo {
    --accent: #3159c9;
    --soft: #eaf0ff;
}
.tone-amber {
    --accent: #d97706;
    --soft: #fff3dc;
}
.tone-slate {
    --accent: #52667f;
    --soft: #edf1f5;
}
.tone-red {
    --accent: #dc3545;
    --soft: #ffebed;
}
.tone-green {
    --accent: #148a5b;
    --soft: #e4f7ef;
}
.tone-teal {
    --accent: #0f8b8d;
    --soft: #e2f6f5;
}
.modern-breakdown-panel {
    margin-top: 19px;
    padding: 23px;
    border: 1px solid #dfe6ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(25, 47, 80, .07);
}
.modern-breakdown-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}
.modern-breakdown-heading p {
    margin: 5px 0 0;
    color: #748197;
}
.dashboard-close-button {
    padding: 8px 13px;
    border: 1px solid #dce3ec;
    border-radius: 9px;
    color: #53647c;
    background: #f8fafc;
    text-decoration: none;
    font-weight: 650;
}
.modern-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}
.modern-source-card {
    --accent: #2563eb;
    --soft: #eff6ff;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #17263f;
    background: #fbfcfe;
    text-decoration: none;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}
.modern-source-card:hover {
    color: #17263f;
    border-color: var(--accent);
    background: #fff;
    transform: translateY(-2px);
}
.modern-source-card strong {
    display: block;
    margin: 3px 0 1px;
    font-size: 21px;
}
.modern-source-card small {
    color: #8290a4;
}
.source-card-arrow {
    color: var(--accent);
    font-size: 0;
    font-weight: 800;
}
.source-card-arrow::after {
    content: "\2192";
    font-size: 20px;
}
.target-dashboard {
    max-width: 1600px;
    margin: 19px auto 0;
    padding: 23px;
    border-color: #dfe6ef;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(25, 47, 80, .06);
}
.target-card {
    border-color: #e3e9f1;
    border-radius: 13px;
    background: linear-gradient(145deg, #fbfcfe, #f5f8fc);
}
.target-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eaf1;
}
.target-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #5b8df4);
}
@media (max-width: 1100px) {
    .modern-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }
    .dashboard-hero-actions {
        width: 100%;
        min-width: 0;
    }
}
@media (max-width: 680px) {
    body:has(.dashboard-shell) .container {
        padding: 12px;
    }
    .dashboard-hero {
        min-height: 0;
        padding: 24px 20px;
        border-radius: 16px;
    }
    .dashboard-hero h1 {
        font-size: 29px;
    }
    .dashboard-hero-actions,
    .modern-source-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-section-heading {
        align-items: flex-start;
    }
    .modern-metric-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }
    .modern-metric-card {
        min-height: 170px;
    }
    .modern-breakdown-heading {
        flex-direction: column;
    }
    .dashboard-close-button {
        width: 100%;
        text-align: center;
    }
}
@media (prefers-reduced-motion: reduce) {
    .modern-metric-card,
    .modern-source-card,
    .dashboard-action {
        transition: none;
    }
}

/* VISIBLE LEAD ID STYLE */
.lead-id-value {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 8px;
    border: 1px solid #d8e1ec;
    border-radius: 7px;
    color: #31527c;
    background: #f4f7fb;
    font-family:
        ui-monospace,
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 12px;
    font-weight: 750;
}

/* SAFE USER DELETE UI */
.user-delete-form {
    display: inline-flex;
    margin: 0;
}
.danger-button {
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid #f0b8b5;
    border-radius: 6px;
    color: #b42318;
    background: #fff5f4;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}
.danger-button:hover {
    border-color: #d92d20;
    color: #fff;
    background: #d92d20;
}
.danger-button:focus-visible {
    outline: 3px solid rgba(217, 45, 32, .2);
    outline-offset: 2px;
}

/* ALIGNED USER MANAGEMENT ACTIONS */
.users-table th,
.users-table td {
    vertical-align: middle;
}
.users-table .management-cell {
    width: 330px;
    min-width: 330px;
    max-width: none;
    padding: 10px 12px;
    overflow: visible;
    background: #fbfcfe;
}
.users-table .user-actions {
    display: grid !important;
    grid-template-columns: 86px 112px 86px;
    align-items: center;
    justify-content: start;
    gap: 8px;
    width: 100%;
}
.users-table .user-actions > button[form] {
    grid-column: 1;
    grid-row: 1;
    width: 86px;
}
.users-table .toggle-user-form {
    grid-column: 2;
    grid-row: 1;
    display: block;
    margin: 0;
}
.users-table .user-delete-form {
    grid-column: 3;
    grid-row: 1;
    display: block;
    margin: 0;
}
.users-table .password-reset-form {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 8px;
    width: 100%;
    margin: 0;
}
.users-table .password-reset-form input {
    width: 100%;
    min-width: 0;
    height: 38px;
}
.users-table .user-actions button,
.users-table .user-actions .button,
.users-table .danger-button {
    min-width: 86px;
    min-height: 38px;
    height: 38px;
    padding: 7px 11px;
    border-radius: 8px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}
.users-table .toggle-user-form .button {
    width: 112px;
}
.users-table .password-reset-form .button {
    width: 86px;
}
.users-table .user-delete-button {
    width: 86px;
    appearance: none;
    border: 1px solid #f0b8b5;
    color: #b42318;
    background: #fff4f3;
}
.users-table .user-delete-button:hover {
    border-color: #d92d20;
    color: #fff;
    background: #d92d20;
}
.users-table .user-actions > button[form]:hover,
.users-table .toggle-user-form .button:hover,
.users-table .password-reset-form .button:hover {
    border-color: #9db8df;
    background: #f1f6fd;
}
.users-table .action-placeholder {
    display: block;
    grid-column: 2 / -1;
    grid-row: 1;
}
.users-table tbody tr {
    transition: background .15s ease;
}
.users-table tbody tr:hover td {
    background: #f8faff;
}
.users-table tbody tr:hover .management-cell {
    background: #f5f8fd;
}
@media (max-width: 700px) {
    .users-table .management-cell {
        min-width: 310px;
        width: 310px;
    }
    .users-table .user-actions {
        grid-template-columns: 82px 106px 82px;
        gap: 6px;
    }
    .users-table .user-actions > button[form],
    .users-table .user-delete-button,
    .users-table .password-reset-form .button {
        width: 82px;
        min-width: 82px;
    }
    .users-table .toggle-user-form .button {
        width: 106px;
        min-width: 106px;
    }
    .users-table .password-reset-form {
        grid-template-columns: minmax(0, 1fr) 82px;
        gap: 6px;
    }
}

/* FROZEN LEAD TABLE HEADER */
.lead-table-scroll {
    position: relative;
    max-height: calc(100vh - 245px);
    min-height: 260px;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #fff;
}
.lead-table-scroll .lead-grid thead th {
    position: sticky;
    top: 0;
    z-index: 12;
    border-bottom: 2px solid #c7d4e5;
    background: #eaf0f8;
    box-shadow:
        0 2px 4px rgba(23, 43, 77, .08);
}
.lead-table-scroll .lead-grid thead th.sticky-col {
    left: 0;
    z-index: 15;
    background: #dce7f5;
}
.lead-table-scroll .lead-grid tbody td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 8;
    background: #fff;
    box-shadow:
        2px 0 3px rgba(23, 43, 77, .05);
}
.lead-table-scroll .lead-grid tbody tr:hover td.sticky-col {
    background: #f8faff;
}
@media (max-width: 800px) {
    .lead-table-scroll {
        max-height: 67vh;
        min-height: 240px;
    }
}

/* MANUAL LEADS INTERFACE */
.source-manual {
    color: #6941c6;
    background: #f1eafe;
}
.manual-uploader {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #344054;
    background: #eef2f6;
    font-size: 12px;
    font-weight: 700;
}

/* COMPACT REMARKS AND LEAD FORM */
.panel > .lead-form {
    border: 0;
    padding: 0;
    background: transparent;
}

.lead-form > label {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    font-weight: 650;
}

.lead-form > label textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
}

.lead-form > .primary {
    margin-top: 16px;
}

.remark-inline-input {
    width: 210px;
    min-width: 210px !important;
    height: 34px;
    min-height: 34px !important;
    resize: none;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
}

.remark-view-button {
    min-height: 32px;
    padding: 5px 10px;
    margin-left: 5px;
    vertical-align: middle;
}

.remark-modal[hidden] {
    display: none !important;
}

.remark-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
}

.remark-modal-card {
    width: min(680px, 100%);
    max-height: 82vh;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d9e0e7;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.remark-modal-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e9ee;
}

.remark-modal-card h2 {
    margin: 0;
    font-size: 19px;
}

.remark-modal-close {
    border: 1px solid #d9e0e7;
    border-radius: 7px;
    padding: 7px 12px;
    background: #fff;
    cursor: pointer;
}

.remark-modal-content {
    max-height: 62vh;
    overflow: auto;
    padding: 20px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.65;
}

body.remark-modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .remark-inline-input {
        width: 165px;
        min-width: 165px !important;
    }

    .remark-modal {
        padding: 10px;
    }
}

/* REMARKS BUTTON FIT FIX */
.remark-inline-input {
    width: 165px;
    min-width: 165px !important;
}

.remark-view-button {
    width: 52px;
    min-width: 52px;
    margin-left: 4px;
    padding: 5px 4px;
    flex-shrink: 0;
}

/* UPDATE HISTORY VALUE VIEWER */
.activity-panel table {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
}

.activity-panel th,
.activity-panel td {
    max-width: none;
    vertical-align: middle;
}

.activity-panel th:nth-child(1) {
    width: 160px;
}

.activity-panel th:nth-child(2) {
    width: 115px;
}

.activity-panel th:nth-child(3) {
    width: 160px;
}

.history-value-cell {
    overflow: visible;
    white-space: normal;
}

.history-value-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.history-value-preview {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-value-button {
    width: 52px;
    min-width: 52px;
    margin: 0;
    padding: 5px 7px;
    flex: 0 0 52px;
}

@media (max-width: 800px) {
    .activity-panel table {
        min-width: 780px;
    }
}