:root {
    color-scheme: light dark;
    --sky: #0284c7;
    --sky-hover: #0369a1;
    --sky-active: #075985;
    --teal: #0284c7; /* alias for backward compatibility */
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --paper: #f0f7ff;
    --surface: #ffffff;
    --bs-primary: #0284c7;
    --bs-primary-rgb: 2, 132, 199;
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-link-color: var(--sky);
    --bs-link-hover-color: var(--sky-hover);
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
    accent-color: var(--sky);
}
* {
    box-sizing: border-box;
}
body {
    font-family: Inter, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 14px;
}
a {
    color: var(--sky);
    text-decoration: none;
}
a:hover {
    color: var(--sky-hover);
    text-decoration: underline;
}
.workspace {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 245px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 32px 20px 20px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
}
.brand:hover {
    text-decoration: none;
    color: var(--ink);
}
.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    width: 47px;
    height: 47px;
    border-radius: 13px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -2px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}
.brand-mark span {
    font-weight: 400;
}
.nav-label {
    font-size: 9px;
    letter-spacing: 1.7px;
    color: var(--muted);
    margin: 35px 12px 13px;
    font-weight: 700;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 7px;
    padding: 10px 13px;
    color: #475569;
    font-size: 13px;
    margin: 3px 0;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
    color: var(--ink);
    background: rgba(2, 132, 199, 0.08);
    text-decoration: none;
}
.nav-item.selected {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 600;
}
.nav-item span {
    font-size: 20px;
}
.planned {
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.planned small {
    font-size: 8px;
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}
.sidebar-footer {
    border-top: 1px solid var(--line);
    margin-top: auto;
    padding: 24px 8px 0;
    font-size: 11px;
}
.sidebar-footer small {
    display: block;
    margin: 5px 0 0 13px;
    color: var(--muted);
    font-size: 10px;
}
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0ea5e9;
    margin-right: 6px;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}
.main-area {
    margin-left: 245px;
    flex: 1;
    min-width: 0;
}
.topbar {
    height: 88px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-label {
    font-size: 12px;
    color: var(--muted);
}
.profile-button {
    border: 0;
    background: none;
    display: flex;
    gap: 11px;
    align-items: center;
    color: var(--ink);
    text-align: left;
    font-size: 12px;
}
.profile-button small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
}
.avatar {
    border-radius: 50%;
    width: 37px;
    height: 37px;
    background: #e0f2fe;
    color: #0284c7;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 600;
}
.page-content {
    padding: 37px 42px;
    max-width: 1600px;
    margin: auto;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}
h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -1.2px;
    margin: 8px 0 10px;
}
h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}
h3 {
    font-size: 16px;
    font-weight: 600;
}
.eyebrow {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.9px;
    color: var(--muted);
}
.page-heading p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.soft-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 5px;
    font-size: 10px;
    padding: 6px 10px;
    white-space: nowrap;
    font-weight: 600;
}
.soft-badge.neutral {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}
.welcome-banner {
    border-radius: 13px;
    background: linear-gradient(135deg, #075985 0%, #0284c7 60%, #0ea5e9 100%);
    color: white;
    padding: 32px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 245px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.2);
}
.welcome-banner .eyebrow {
    color: #bae6fd;
}
.welcome-banner h2 {
    font-size: 31px;
    line-height: 1.2;
    margin: 15px 0 13px;
    letter-spacing: -0.7px;
}
.welcome-banner p {
    color: #e0f2fe;
    font-size: 12px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 6px;
    padding: 7px 16px;
    min-height: 38px;
    height: 38px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    box-sizing: border-box;
    vertical-align: middle;
}
.btn:hover {
    text-decoration: none;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}
.btn:disabled, .btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-sm {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 5px;
    padding: 4px 11px;
    min-height: 30px;
    height: 30px;
    gap: 4px;
}
.btn-lg {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 8px;
    padding: 9px 20px;
    min-height: 44px;
    height: 44px;
    gap: 8px;
}
.btn-primary {
    --bs-btn-bg: #0284c7;
    --bs-btn-border-color: #0284c7;
    --bs-btn-hover-bg: #0369a1;
    --bs-btn-hover-border-color: #0369a1;
    --bs-btn-active-bg: #075985;
    --bs-btn-active-border-color: #075985;
    --bs-btn-focus-shadow-rgb: 2, 132, 199;
    color: #fff;
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}
.btn-primary:hover {
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
    color: #fff;
}
.btn-primary:active {
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
    color: #fff;
}
.btn-outline-primary {
    --bs-btn-color: #0284c7;
    --bs-btn-border-color: #0284c7;
    --bs-btn-hover-bg: #0284c7;
    --bs-btn-hover-border-color: #0284c7;
    --bs-btn-hover-color: #fff;
    color: var(--bs-btn-color);
    border-color: var(--bs-btn-border-color);
    background-color: transparent;
}
.btn-outline-primary:hover {
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
    color: var(--bs-btn-hover-color);
}
.btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-color: #0f172a;
    --bs-btn-hover-bg: #f1f5f9;
    --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-active-color: #0f172a;
    --bs-btn-active-bg: #e2e8f0;
    --bs-btn-active-border-color: #94a3b8;
    color: var(--bs-btn-color);
    border-color: var(--bs-btn-border-color);
    background-color: transparent;
}
.btn-outline-secondary:hover {
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
    color: var(--bs-btn-hover-color);
}
.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: #fff;
}
.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: #fff;
}
.btn-outline-success {
    color: #10b981;
    border-color: #10b981;
    background-color: transparent;
}
.btn-outline-success:hover {
    background-color: #10b981;
    border-color: #10b981;
    color: #fff;
}
.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.btn-outline-danger {
    color: #ef4444;
    border-color: #fca5a5;
    background-color: transparent;
}
.btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.btn-light {
    background: #ffffff;
    color: #0369a1;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-light:hover {
    background: #f0f9ff;
    color: #0284c7;
    border-color: #bae6fd;
}
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-pills .btn {
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    min-height: 28px;
    height: 28px;
}
.banner-art {
    position: relative;
    width: 280px;
    height: 200px;
    display: grid;
    place-items: center;
    margin-right: 20px;
}
.banner-art > span {
    font-size: 100px;
    font-weight: 200;
    color: #bae6fd;
    transform: rotate(-10deg);
}
.banner-art small {
    position: absolute;
    bottom: 0;
    font-size: 8px;
    letter-spacing: 4px;
    color: #7dd3fc;
}
.orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 180px;
    height: 180px;
}
.orbit-one {
    transform: rotate(-35deg) scaleX(1.5);
}
.orbit-two {
    transform: rotate(35deg) scaleX(1.5);
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 29px 0 16px;
}
.section-heading h2 {
    font-size: 15px;
    margin: 0;
}
.section-heading > span {
    font-size: 10px;
    color: var(--muted);
}
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 17px;
}
.metric-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
}
.metric-card > span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}
.metric-card strong {
    display: block;
    font-size: 30px;
    font-weight: 600;
    margin: 9px 0;
}
.metric-card small {
    color: var(--muted);
    font-size: 10px;
}
.dashboard-bottom {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 22px;
    margin-top: 26px;
}
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 25px;
}
.card {
    background-color: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.panel .section-heading {
    margin: 0;
}
.empty-state {
    text-align: center;
    padding: 39px 0 22px;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    background: #e0f2fe;
    border-radius: 13px;
    margin: 0 auto 19px;
    font-size: 25px;
    color: #0284c7;
}
.empty-state p {
    font-size: 11px;
    line-height: 1.8;
    color: var(--muted);
    margin-top: 11px;
}
.getting-started h2 {
    margin: 16px 0 10px;
}
.getting-started p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8;
}
.check-row {
    margin: 15px 0;
    font-size: 11px;
}
.check-row span {
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 50%;
    padding: 3px 5px;
    margin-right: 10px;
}
.text-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}
.getting-started .text-link {
    margin-top: 16px;
}
.page-footer {
    padding: 18px 42px 25px;
    color: var(--muted);
    font-size: 10px;
    display: flex;
    justify-content: space-between;
}
.table {
    --bs-table-color: var(--ink);
}
.table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
    padding: 15px 10px;
}
.table td {
    padding: 18px 10px;
    font-size: 12px;
}
.table td small {
    font-size: 10px;
    margin-top: 4px;
}
.employee-name {
    font-weight: 600;
}
.search-bar {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.form-control, .form-select {
    font-size: 13px;
    min-height: 38px;
    height: 38px;
    padding: 7px 12px;
    border-radius: 6px;
    border-color: var(--line);
    color: var(--ink);
    background-color: #fff;
    box-sizing: border-box;
    line-height: 1.4;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
    outline: none;
}
.form-control-sm, .form-select-sm {
    font-size: 12px;
    min-height: 30px;
    height: 30px;
    padding: 4px 8px;
    border-radius: 5px;
}
.form-panel, .detail-panel {
    max-width: 720px;
}
.field-row {
    margin-bottom: 20px;
}
.field-row label, .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}
.field-row input:not([type=checkbox]):not([type=radio]), .field-row select {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 7px 12px;
    min-height: 38px;
    height: 38px;
    width: 100%;
    background: #fff;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field-row input:focus, .field-row select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}
.help-text {
    font-size: 11px;
    color: var(--muted);
    margin-top: 7px;
}
.help-text ul {
    padding-left: 17px;
}
.errorlist {
    color: #dc2626;
    font-size: 12px;
    padding-left: 18px;
}
.detail-panel dt, .detail-panel dd {
    margin-bottom: 20px;
    font-size: 13px;
}
.profile-photo {
    width: 90px;
    height: 90px;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 25px;
}
.menu-toggle {
    display: none;
}
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-story {
    background: linear-gradient(145deg, #082f49 0%, #075985 55%, #0284c7 100%);
    color: white;
    padding: 55px 65px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}
.login-story .brand {
    color: white;
}
.login-story .brand-mark {
    background: #e0f2fe;
    color: #0369a1;
}
.login-story .eyebrow {
    color: #bae6fd;
}
.login-story h1 {
    font-size: clamp(35px, 3.5vw, 57px);
    font-weight: 400;
    line-height: 1.2;
    margin-top: 24px;
}
.login-story h1 em {
    font-family: Georgia, serif;
    color: #7dd3fc;
}
.login-story p {
    max-width: 350px;
    font-size: 14px;
    line-height: 1.9;
    color: #e0f2fe;
    margin-top: 24px;
}
.story-line {
    height: 1px;
    background: #38bdf8;
    width: 90px;
    margin: 35px 0 20px;
}
.login-story small {
    color: #bae6fd;
    font-size: 10px;
    letter-spacing: 1px;
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #f8fafc;
    padding: 50px 35px;
    position: relative;
}
.login-form {
    width: 100%;
    max-width: 370px;
}
.login-form h2 {
    font-size: 34px;
    letter-spacing: -1px;
    margin: 15px 0 10px;
}
.login-form > p {
    font-size: 13px;
}
.login-help {
    text-align: center;
    font-size: 11px;
    margin-top: 28px;
    color: var(--muted);
}
.login-panel > small {
    position: absolute;
    bottom: 32px;
    font-size: 10px;
}
.text-primary {
    color: var(--sky) !important;
}
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 30px;
}
.error-page strong {
    font-size: 80px;
    color: var(--sky);
}

@media(min-width:1500px) {
    .page-content {
        padding-top: 45px;
    }
    .welcome-banner {
        min-height: 290px;
    }
}
@media(max-width:1100px) {
    .sidebar {
        width: 215px;
    }
    .main-area {
        margin-left: 215px;
    }
    .page-content {
        padding: 28px;
    }
    .topbar {
        padding: 0 28px;
    }
    .banner-art {
        width: 190px;
        margin-right: 0;
    }
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
    .login-story {
        padding: 40px;
    }
}
@media(max-width:767px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
        width: 235px;
        top: 75px;
    }
    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.15);
    }
    .main-area {
        margin-left: 0;
    }
    .topbar {
        height: 75px;
        padding: 0 18px;
        gap: 10px;
    }
    .menu-toggle {
        display: block;
    }
    .topbar-label {
        display: none;
    }
    .page-content {
        padding: 25px 18px;
    }
    .page-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    h1 {
        font-size: 28px;
    }
    .welcome-banner {
        padding: 26px;
    }
    .welcome-banner h2 {
        font-size: 27px;
    }
    .banner-art {
        display: none;
    }
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .metric-card {
        padding: 17px;
    }
    .page-footer {
        padding: 20px;
        gap: 20px;
    }
    .page-footer span {
        max-width: 150px;
        text-align: right;
    }
    .section-heading {
        flex-wrap: wrap;
    }
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-story {
        min-height: auto;
        padding: 25px;
    }
    .login-story > div, .login-story > small {
        display: none;
    }
    .login-panel {
        min-height: calc(100vh - 97px);
        padding: 45px 25px 75px;
    }
    .profile-button {
        max-width: 240px;
    }
    .dropdown-item-text {
        overflow-wrap: anywhere;
    }
    .panel {
        padding: 20px;
    }
}
@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
    }
}

/* Stage 2: lead workspace, reusing the existing palette and shell. */
.lead-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}
.lead-filters .field-row {
    margin-bottom: 0;
    width: 100%;
}
.lead-filters .field-row input,
.lead-filters .field-row select {
    width: 100%;
}
.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 38px;
    height: 38px;
}
.filter-actions .btn {
    flex-shrink: 0;
}
.lead-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}
.field-row textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.4;
    background: #fff;
    box-sizing: border-box;
}
.field-row textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}
.field-row select[multiple] {
    min-height: 115px;
}
.full-width {
    grid-column: 1/-1;
}
.form-actions, .lead-quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.bulk-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.bulk-toolbar select {
    width: auto;
    min-width: 180px;
    font-size: 12px;
    min-height: 34px;
    height: 34px;
    padding: 4px 28px 4px 10px;
}
.bulk-toolbar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
}
.bulk-toolbar .btn {
    min-height: 34px;
    height: 34px;
    padding: 4px 14px;
    font-size: 12px;
}
.bulk-toolbar small {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}
.lead-table {
    min-width: 1000px;
}
.lead-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}
.lead-actions a {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--sky);
    background: rgba(2, 132, 199, 0.08);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}
.lead-actions a:hover {
    background: var(--sky);
    color: #fff;
    text-decoration: none;
}
.priority-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.priority-low {
    background: #f1f5f9;
    color: #475569;
}
.priority-medium {
    background: #e0f2fe;
    color: #0369a1;
}
.priority-high {
    background: #fef3c7;
    color: #b45309;
}
.priority-urgent {
    background: #fee2e2;
    color: #b91c1c;
}
.status-lost, .status-not_interested, .status-wrong_number, .status-not_eligible {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.status-new, .status-assigned, .status-no_response {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.pagination-bar span {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}
.pagination-bar .btn {
    min-height: 30px;
    height: 30px;
    padding: 4px 12px;
    font-size: 12px;
}
.lead-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 24px;
}
.lead-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 0;
}
.detail-grid.single {
    grid-template-columns: 1fr;
    margin-bottom: 25px;
}
.detail-grid dt {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 6px;
}
.detail-grid dd {
    font-size: 13px;
    margin: 0;
    overflow-wrap: anywhere;
}
.timeline article {
    border-left: 2px solid #bae6fd;
    padding: 0 0 12px 16px;
    margin-top: 22px;
    overflow-wrap: anywhere;
}
.timeline small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin: 5px 0;
}
.timeline strong {
    font-size: 12px;
}
.timeline p {
    margin: 8px 0;
    font-size: 13px;
}
.source-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.chart-row {
    display: grid;
    grid-template-columns: 150px 1fr 40px;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    font-size: 12px;
}
.chart-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.chart-bar {
    height: 100%;
    background: #0ea5e9;
    border-radius: 5px;
}
.lead-edit-form {
    max-width: 1050px;
}
nav[aria-label="Breadcrumb"] {
    font-size: 11px;
    color: var(--muted);
}
.is-submitting {
    opacity: 0.7;
    cursor: wait;
}
@media(max-width:1100px) {
    .lead-filters {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 14px;
    }
}
@media(max-width:767px) {
    .lead-filters, .lead-form-grid, .lead-detail-grid, .lead-history-grid {
        grid-template-columns: 1fr;
    }
    .lead-filters {
        gap: 12px;
    }
    .filter-actions {
        width: 100%;
        margin-top: 4px;
    }
    .filter-actions .btn {
        flex: 1 1 auto;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .chart-row {
        grid-template-columns: 110px 1fr 25px;
        gap: 10px;
    }
    .bulk-toolbar select {
        max-width: 100%;
    }
}

/* External partner portal: shared branding, simpler navigation. */
.partner-header {
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 24px 5%;
    display: flex;
    align-items: center;
    gap: 25px;
}
.partner-header nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 13px;
}
.partner-header form {
    margin: 0;
}
.partner-content {
    max-width: 1250px;
    margin: auto;
    padding: 40px 30px 60px;
    min-height: 75vh;
}
.partner-footer {
    text-align: center;
    padding: 25px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}
.partner-content .metrics {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.partner-content .field-row textarea {
    min-height: 95px;
}
@media(max-width:900px) {
    .partner-header {
        flex-wrap: wrap;
        padding: 20px;
    }
    .partner-header nav {
        width: 100%;
        margin-left: 0;
        gap: 18px;
    }
    .partner-content {
        padding: 30px 20px;
    }
    .partner-header .brand {
        margin-right: auto;
    }
}
@media(max-width:480px) {
    .partner-header nav {
        gap: 12px;
        font-size: 12px;
    }
    .partner-content .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Partner workspace uses the CRM shell, with its own scoped report accents. */
.partner-sidebar-account {
    margin-top: auto;
    padding-top: 32px;
    font-size: 13px;
    overflow-wrap: anywhere;
}
.partner-workspace .sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.partner-workspace .page-content {
    max-width: 1600px;
    width: 100%;
    margin: auto;
}
.partner-workspace .main-area {
    min-width: 0;
}
.partner-metrics {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.partner-metrics .metric-card {
    border-top: 3px solid var(--metric-accent, #0284c7);
    background: linear-gradient(145deg, #fff, #f0f9ff);
}
.partner-metrics .metric-card:nth-child(3n) {
    --metric-accent: #8b5cf6;
}
.partner-metrics .metric-card:nth-child(3n + 2) {
    --metric-accent: #0284c7;
}
.report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 24px;
}
.report-grid .panel {
    min-width: 0;
}
.donut-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 16px 0;
    overflow: hidden;
}
.report-donut {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.report-donut > div {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.report-donut strong {
    font-size: 38px;
}
.report-donut span {
    color: var(--muted);
    font-size: 13px;
}
.status-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}
.status-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: 12px;
}
.status-legend strong {
    margin-left: auto;
}
.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.trend-chart {
    display: flex;
    align-items: stretch;
    gap: 4px;
    height: 260px;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to top, transparent 0, transparent 64px, #e2e8f0 65px);
    margin-top: 40px;
}
.trend-column {
    flex: 1;
    display: flex;
    align-items: flex-end;
    min-width: 0;
}
.trend-column > div {
    width: 100%;
    background: linear-gradient(#38bdf8, #0284c7);
    border-radius: 5px 5px 0 0;
}
.daily-counts {
    max-height: 300px;
    margin-top: 15px;
}
.signup-page {
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(140deg, #e0f2fe, #f0f7ff);
}
.signup-panel {
    max-width: 850px;
    margin: auto;
}
.partner-workspace .profile-button {
    text-decoration: none;
    color: var(--ink);
}

@media(max-width:1000px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}
@media(max-width:480px) {
    .partner-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .trend-chart {
        gap: 2px;
    }
    .partner-sidebar-account {
        padding-bottom: 24px;
    }
}

/* Student reports: one colourful overview instead of individual status cards. */
.student-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    padding: 18px 24px;
    border: 1px solid #bae6fd;
    border-radius: 14px;
    background: linear-gradient(110deg, #f0f9ff, #e0f2fe);
    color: #0369a1;
}
.student-report-summary strong {
    font-size: 24px;
    color: var(--ink);
    margin: 0 5px;
}
.student-pie {
    width: min(280px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 12px 35px rgba(2, 132, 199, 0.12);
    border: 6px solid white;
    outline: 1px solid #e2e8f0;
}
.partner-workspace .nav-item > span[aria-hidden] {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.status-legend small {
    font-size: 11px;
    font-weight: 400;
    margin-left: 5px;
}
@media(max-width:480px) {
    .student-report-summary {
        padding: 16px;
        gap: 12px;
    }
    .student-report-summary > span {
        width: 100%;
    }
}

/* Reference-inspired student progress ring, with labels on and inside slices. */
.student-progress-donut {
    display: block;
    width: 100%;
    max-width: 380px;
    height: auto;
    aspect-ratio: 1;
    flex-shrink: 1;
    overflow: hidden;
}
.student-progress-donut .donut-percentage {
    fill: #fff;
    font-size: 23px;
    font-weight: 500;
    paint-order: stroke;
    stroke: #00000026;
    stroke-width: 1px;
}
.student-progress-donut .donut-status-label {
    font-size: 13px;
    font-weight: 500;
}
.student-progress-donut .donut-empty-label {
    fill: var(--muted);
    font-size: 18px;
}
.report-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
@media(max-width:1100px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}

/* Shared internal / partner workspace and persistent theme. */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: 6px;
}
.dashboard-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.dashboard-shortcuts a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    color: var(--ink);
    transition: transform 0.15s, border-color 0.15s;
}
.dashboard-shortcuts a:hover {
    border-color: #38bdf8;
    text-decoration: none;
    transform: translateY(-1px);
}
.internal-workspace .nav-item > span[aria-hidden] {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.internal-workspace .chart-row:nth-child(3n+1) .chart-bar {
    background: #8b5cf6;
}
.internal-workspace .chart-row:nth-child(3n+2) .chart-bar {
    background: #0ea5e9;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --sky: #38bdf8;
    --sky-hover: #7dd3fc;
    --sky-active: #bae6fd;
    --teal: #38bdf8;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: #334155;
    --paper: #0b1329;
    --surface: #1e293b;
    --bs-primary: #0284c7;
    --bs-primary-rgb: 2, 132, 199;
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--ink);
    --bs-secondary-color: var(--muted);
    --bs-border-color: var(--line);
    --bs-link-color: var(--sky);
    --bs-link-hover-color: var(--sky-hover);
    --bs-card-bg: var(--surface);
    --scrollbar-thumb: #334155;
    --scrollbar-thumb-hover: #475569;
    accent-color: var(--sky);
}

[data-bs-theme="dark"] body {
    color: var(--ink);
    background-color: var(--paper);
}

[data-bs-theme="dark"] a {
    color: var(--sky);
}
[data-bs-theme="dark"] a:hover {
    color: var(--sky-hover);
}

[data-bs-theme="dark"] .sidebar,
[data-bs-theme="dark"] .topbar,
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .dashboard-shortcuts a,
[data-bs-theme="dark"] .login-panel,
[data-bs-theme="dark"] .card {
    background-color: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

[data-bs-theme="dark"] .card-body {
    color: var(--ink);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: rgba(15, 23, 42, 0.6);
    border-color: var(--line);
    color: var(--ink);
}

[data-bs-theme="dark"] .partner-metrics .metric-card {
    background: linear-gradient(145deg, #1e293b, #131d2e);
    border-color: var(--line);
}

[data-bs-theme="dark"] .nav-item {
    color: #94a3b8;
}
[data-bs-theme="dark"] .nav-item:hover {
    color: #f8fafc;
    background: rgba(56, 189, 248, 0.08);
}
[data-bs-theme="dark"] .nav-item.selected {
    background: rgba(56, 189, 248, 0.15);
    color: var(--sky);
}

[data-bs-theme="dark"] .metric-card > span,
[data-bs-theme="dark"] .metric-card small,
[data-bs-theme="dark"] .empty-state p {
    color: var(--muted);
}

[data-bs-theme="dark"] .avatar {
    background: #0369a1;
    color: #f0f9ff;
}

[data-bs-theme="dark"] .brand-mark {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

[data-bs-theme="dark"] .soft-badge {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}

[data-bs-theme="dark"] .soft-badge.neutral {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .status-lost,
[data-bs-theme="dark"] .status-not_interested,
[data-bs-theme="dark"] .status-wrong_number,
[data-bs-theme="dark"] .status-not_eligible {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-bs-theme="dark"] .status-new,
[data-bs-theme="dark"] .status-assigned,
[data-bs-theme="dark"] .status-no_response {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

[data-bs-theme="dark"] .priority-low {
    background: #334155;
    color: #94a3b8;
}
[data-bs-theme="dark"] .priority-medium {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}
[data-bs-theme="dark"] .priority-high {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}
[data-bs-theme="dark"] .priority-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: rgba(56, 189, 248, 0.05);
}
[data-bs-theme="dark"] .table tr:hover td {
    background-color: rgba(56, 189, 248, 0.05);
}
[data-bs-theme="dark"] .table th {
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
[data-bs-theme="dark"] .table td {
    border-bottom: 1px solid var(--line);
}

[data-bs-theme="dark"] .field-row input:not([type=checkbox]),
[data-bs-theme="dark"] .field-row select,
[data-bs-theme="dark"] .field-row textarea,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .bulk-toolbar select {
    background-color: #0f172a;
    color: var(--ink);
    border-color: var(--line);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .field-row input:focus,
[data-bs-theme="dark"] .field-row select:focus,
[data-bs-theme="dark"] .field-row textarea:focus {
    background-color: #0f172a;
    color: var(--ink);
    border-color: var(--sky);
    outline: 2px solid var(--sky);
    outline-offset: 1px;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b;
    opacity: 1;
}

[data-bs-theme="dark"] select option {
    background-color: #0f172a;
    color: var(--ink);
}

[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled {
    background-color: #1e293b;
    color: #64748b;
    border-color: #334155;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #334155;
    color: #fff;
}
[data-bs-theme="dark"] .dropdown-item-text {
    color: var(--muted) !important;
}
[data-bs-theme="dark"] .dropdown-divider {
    border-color: var(--line);
}

[data-bs-theme="dark"] .student-report-summary {
    background: linear-gradient(110deg, #1e293b, #0f172a);
    border-color: var(--line);
    color: #cbd5e1;
}

[data-bs-theme="dark"] .student-pie {
    border-color: #1e293b;
    outline-color: var(--line);
}

[data-bs-theme="dark"] .report-donut > div {
    background-color: #1e293b;
    color: var(--ink);
}

[data-bs-theme="dark"] .empty-icon {
    background-color: #0f172a;
    color: var(--sky);
}

[data-bs-theme="dark"] .check-row span {
    background: rgba(56, 189, 248, 0.15);
    color: var(--sky);
}

[data-bs-theme="dark"] .partner-header {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

[data-bs-theme="dark"] .chart-track {
    background: #334155;
}

[data-bs-theme="dark"] .chart-bar {
    background: var(--sky);
}

[data-bs-theme="dark"] .trend-chart {
    background: repeating-linear-gradient(to top, transparent 0, transparent 64px, #334155 65px);
}

[data-bs-theme="dark"] .trend-column > div {
    background: linear-gradient(to top, #0284c7, #38bdf8);
}

[data-bs-theme="dark"] .timeline article {
    border-color: var(--line);
}

[data-bs-theme="dark"] .signup-page {
    background: linear-gradient(140deg, #0b1329 0%, #0f172a 50%, #1e293b 100%);
}

[data-bs-theme="dark"] .login-story {
    background: linear-gradient(145deg, #020617 0%, #082f49 50%, #0c4a6e 100%);
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #0284c7;
    --bs-btn-border-color: #0284c7;
    --bs-btn-hover-bg: #0ea5e9;
    --bs-btn-hover-border-color: #0ea5e9;
    --bs-btn-active-bg: #0369a1;
    --bs-btn-active-border-color: #0369a1;
    color: #fff;
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #38bdf8;
    --bs-btn-border-color: #38bdf8;
    --bs-btn-hover-bg: #0284c7;
    --bs-btn-hover-border-color: #0284c7;
    --bs-btn-hover-color: #fff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: #475569;
    --bs-btn-hover-bg: #334155;
    --bs-btn-hover-border-color: #64748b;
    --bs-btn-hover-color: #fff;
}

[data-bs-theme="dark"] .bulk-toolbar {
    background: #0f172a;
    border-color: #334155;
}
[data-bs-theme="dark"] .lead-actions a {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}
[data-bs-theme="dark"] .lead-actions a:hover {
    background: #0284c7;
    color: #fff;
}
[data-bs-theme="dark"] .btn-outline-danger {
    color: #f87171;
    border-color: #7f1d1d;
}
[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
[data-bs-theme="dark"] .btn-outline-success {
    color: #34d399;
    border-color: #064e3b;
}
[data-bs-theme="dark"] .btn-outline-success:hover {
    background-color: #10b981;
    border-color: #10b981;
    color: #fff;
}
[data-bs-theme="dark"] .pagination-bar {
    border-top-color: #334155;
}

[data-bs-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #082f49 0%, #0c4a6e 50%, #0369a1 100%);
}
[data-bs-theme="dark"] .welcome-banner .btn-light {
    background: #0f172a;
    color: #38bdf8;
    border: 1px solid #0284c7;
}
[data-bs-theme="dark"] .welcome-banner .btn-light:hover {
    background: #1e293b;
    color: #7dd3fc;
}

[data-bs-theme="dark"] .errorlist {
    color: #f87171;
}

[data-bs-theme="dark"] .source-row {
    border-bottom-color: var(--line);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

@media(max-width:767px) {
    .topbar-actions {
        gap: 10px;
    }
    .theme-label {
        display: none;
    }
    .theme-toggle {
        padding: 8px 10px;
    }
    .topbar-actions .profile-button {
        max-width: 180px;
    }
    .dashboard-shortcuts a {
        flex: 1 1 140px;
    }
}
/* ============================================================
   ASPIRING LIFE PARTNERS
   FIXED CRM WORKSPACE
   ============================================================ */

/* ------------------------------------------------------------
   1. ROOT
   ------------------------------------------------------------ */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
}

body {
    min-height: 100vh;
}


/* ------------------------------------------------------------
   2. CRM WORKSPACE
   ------------------------------------------------------------ */

.workspace.internal-workspace {
    position: relative;

    display: flex;

    width: 100%;
    height: 100vh;
    min-height: 100vh;

    margin: 0;
    padding: 0;

    overflow: hidden !important;
}


/* ============================================================
   3. SIDEBAR
   ============================================================ */

.internal-workspace .sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 245px;
    height: 100vh;

    margin: 0;
    padding: 32px 20px 20px;

    background: #fff;
    border-right: 1px solid var(--line);

    display: flex;
    flex-direction: column;

    overflow: hidden !important;

    z-index: 1040;
}


/* ------------------------------------------------------------
   Sidebar logo / brand
   ------------------------------------------------------------ */

.internal-workspace .sidebar > .brand {
    display: flex;

    flex: 0 0 auto;

    min-height: 47px;

    overflow: hidden;
}


/* ------------------------------------------------------------
   Sidebar navigation
   ONLY THIS PART SCROLLS
   ------------------------------------------------------------ */

.internal-workspace .sidebar > nav {
    display: block;

    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    margin: 0;
    padding: 0;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    scrollbar-width: thin;
}


/* Chrome / Edge scrollbar */

.internal-workspace .sidebar > nav::-webkit-scrollbar {
    width: 6px;
}

.internal-workspace .sidebar > nav::-webkit-scrollbar-track {
    background: transparent;
}

.internal-workspace .sidebar > nav::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 10px;
}


/* ------------------------------------------------------------
   Sidebar footer
   LOGOUT STAYS FIXED
   ------------------------------------------------------------ */

.internal-workspace .sidebar > .sidebar-footer {
    position: relative;

    flex: 0 0 auto;

    width: 100%;

    margin-top: auto;

    padding: 20px 8px 0;

    background: #fff;

    border-top: 1px solid var(--line);

    z-index: 10;
}


/* ============================================================
   4. MAIN AREA
   ============================================================ */

.internal-workspace .main-area {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;
    left: 245px;

    width: auto;
    height: 100vh;

    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;

    overflow: hidden !important;
}


/* ============================================================
   5. TOP HEADER
   HEADER NEVER SCROLLS
   ============================================================ */

.internal-workspace .main-area > .topbar {
    position: relative;

    flex: 0 0 88px;

    width: 100%;
    height: 88px;
    min-height: 88px;

    margin: 0;
    padding: 0 42px;

    background: #fff;

    border-bottom: 1px solid var(--line);

    z-index: 100;
}


/* ============================================================
   6. MAIN PAGE CONTENT
   ONLY THIS PART SCROLLS
   ============================================================ */

.internal-workspace .main-area > .page-content {
    position: relative;

    flex: 1 1 auto;

    width: 100%;
    max-width: none;

    min-width: 0;
    min-height: 0;

    margin: 0;
    padding: 37px 42px;

    overflow-x: auto !important;
    overflow-y: auto !important;

    scrollbar-width: thin;

    /*
       VERY IMPORTANT:
       This is the ONLY vertical scrolling area
       in the main workspace.
    */
}


/* Main content scrollbar */

.internal-workspace .main-area > .page-content::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.internal-workspace .main-area > .page-content::-webkit-scrollbar-track {
    background: transparent;
}

.internal-workspace .main-area > .page-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 10px;
}

.internal-workspace .main-area > .page-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #94a3b8);
}


/* ============================================================
   7. FOOTER
   FOOTER STAYS FIXED
   ============================================================ */

.internal-workspace .main-area > .page-footer {
    position: relative;

    flex: 0 0 auto;

    width: 100%;

    min-height: 61px;

    margin: 0;
    padding: 18px 42px 25px;

    background: var(--paper);

    z-index: 50;
}


/* ============================================================
   8. DARK MODE
   ============================================================ */

[data-bs-theme="dark"] .internal-workspace .sidebar,
[data-bs-theme="dark"] .internal-workspace .sidebar-footer,
[data-bs-theme="dark"] .internal-workspace .topbar {
    background: #1e293b;
    border-color: var(--line);
}

[data-bs-theme="dark"] .internal-workspace .page-footer {
    background: var(--paper);
    border-color: var(--line);
    color: var(--muted);
}


/* ============================================================
   9. DESKTOP / TABLET
   ============================================================ */

@media (max-width: 1100px) {

    .internal-workspace .sidebar {
        width: 215px;
    }

    .internal-workspace .main-area {
        left: 215px;
    }

    .internal-workspace .main-area > .topbar {
        padding-left: 28px;
        padding-right: 28px;
    }

    .internal-workspace .main-area > .page-content {
        padding: 28px;
    }

    .internal-workspace .main-area > .page-footer {
        padding-left: 28px;
        padding-right: 28px;
    }
}


/* ============================================================
   10. MOBILE
   ============================================================ */

@media (max-width: 767px) {

    /*
       Sidebar becomes an overlay.
    */

    .internal-workspace .sidebar {
        position: fixed;

        top: 75px;
        left: 0;
        bottom: 0;

        width: 235px;
        height: calc(100vh - 75px);

        padding: 24px 20px 20px;

        transform: translateX(-100%);

        transition: transform .2s ease;

        overflow: hidden !important;
    }


    /*
       Open mobile sidebar.
    */

    .internal-workspace .sidebar.is-open {
        transform: translateX(0);

        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.15);
    }


    /*
       Main area occupies entire screen.
    */

    .internal-workspace .main-area {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 100vh;

        margin: 0;

        overflow: hidden !important;
    }


    /*
       Mobile header.
    */

    .internal-workspace .main-area > .topbar {
        flex: 0 0 75px;

        width: 100%;
        height: 75px;
        min-height: 75px;

        padding: 0 18px;
    }


    /*
       Mobile content.
    */

    .internal-workspace .main-area > .page-content {
        flex: 1 1 auto;

        min-height: 0;

        padding: 25px 18px;

        overflow-x: auto !important;
        overflow-y: auto !important;
    }


    /*
       Mobile footer remains fixed.
    */

    .internal-workspace .main-area > .page-footer {
        flex: 0 0 auto;

        min-height: 61px;

        padding: 18px 20px 20px;
    }
}


/* ============================================================
   11. VERY SMALL SCREENS
   ============================================================ */

@media (max-width: 480px) {

    .internal-workspace .sidebar {
        width: 225px;
    }

    .internal-workspace .main-area > .page-content {
        padding: 20px 16px;
    }

    .internal-workspace .main-area > .page-footer {
        padding: 16px;
    }
}

/* ============================================================
   PARTNER WORKSPACE
   Fixed header + fixed logout
   Scrollable navigation + page content
   ============================================================ */


/* ------------------------------------------------------------
   PARTNER ROOT
   ------------------------------------------------------------ */

html,
body {
    overflow: hidden !important;
}


/* ------------------------------------------------------------
   PARTNER WORKSPACE
   ------------------------------------------------------------ */

.workspace.partner-workspace {
    position: relative;

    width: 100%;
    height: 100vh;
    min-height: 100vh;

    margin: 0;
    padding: 0;

    display: flex;

    overflow: hidden !important;
}


/* ============================================================
   PARTNER SIDEBAR
   ============================================================ */

.partner-workspace .sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 245px;
    height: 100vh;

    margin: 0;
    padding: 32px 20px 20px;

    display: flex;
    flex-direction: column;

    overflow: hidden !important;

    z-index: 1040;
}


/* ------------------------------------------------------------
   Partner logo
   ------------------------------------------------------------ */

.partner-workspace .sidebar > .brand {
    flex: 0 0 auto;

    min-height: 47px;

    overflow: hidden;
}


/* ------------------------------------------------------------
   Partner navigation
   ONLY NAVIGATION SCROLLS
   ------------------------------------------------------------ */

.partner-workspace .sidebar > nav {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    margin: 0;
    padding: 0;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    scrollbar-width: thin;
}


/* Partner navigation scrollbar */

.partner-workspace .sidebar > nav::-webkit-scrollbar {
    width: 6px;
}

.partner-workspace .sidebar > nav::-webkit-scrollbar-track {
    background: transparent;
}

.partner-workspace .sidebar > nav::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 10px;
}


/* ------------------------------------------------------------
   Partner sidebar footer
   LOGOUT STAYS FIXED
   ------------------------------------------------------------ */

.partner-workspace .sidebar > .sidebar-footer,
.partner-workspace .sidebar .partner-sidebar-account {
    flex: 0 0 auto;

    margin-top: auto;

    background: #fff;

    z-index: 10;
}


/* ============================================================
   PARTNER MAIN AREA
   ============================================================ */

.partner-workspace .main-area {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;
    left: 245px;

    width: auto;
    height: 100vh;

    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 0;

    overflow: hidden !important;
}


/* ============================================================
   PARTNER TOPBAR
   ============================================================ */

.partner-workspace .main-area > .topbar {
    position: relative;

    flex: 0 0 88px;

    width: 100%;
    height: 88px;
    min-height: 88px;

    background: #fff;

    z-index: 100;
}


/* ============================================================
   PARTNER PAGE CONTENT
   ONLY THIS AREA SCROLLS
   ============================================================ */

.partner-workspace .main-area > .page-content {
    flex: 1 1 auto;

    width: 100%;
    max-width: none;

    min-width: 0;
    min-height: 0;

    margin: 0;

    overflow-x: auto !important;
    overflow-y: auto !important;

    scrollbar-width: thin;
}


/* Partner page scrollbar */

.partner-workspace .main-area > .page-content::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.partner-workspace .main-area > .page-content::-webkit-scrollbar-track {
    background: transparent;
}

.partner-workspace .main-area > .page-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 10px;
}


/* ============================================================
   PARTNER FOOTER
   FIXED
   ============================================================ */

.partner-workspace .main-area > .page-footer {
    position: relative;

    flex: 0 0 auto;

    width: 100%;

    min-height: 61px;

    margin: 0;

    background: var(--paper);

    z-index: 50;
}


/* ============================================================
   PARTNER DARK MODE
   ============================================================ */

[data-bs-theme="dark"] .partner-workspace .sidebar,
[data-bs-theme="dark"] .partner-workspace .sidebar-footer,
[data-bs-theme="dark"] .partner-workspace .sidebar .partner-sidebar-account,
[data-bs-theme="dark"] .partner-workspace .topbar {
    background: #1e293b;
    border-color: var(--line);
}

[data-bs-theme="dark"] .partner-workspace .page-footer {
    background: var(--paper);
    border-color: var(--line);
    color: var(--muted);
}


/* ============================================================
   PARTNER TABLET
   ============================================================ */

@media (max-width: 1100px) {

    .partner-workspace .sidebar {
        width: 215px;
    }

    .partner-workspace .main-area {
        left: 215px;
    }

    .partner-workspace .main-area > .topbar {
        padding-left: 28px;
        padding-right: 28px;
    }
}


/* ============================================================
   PARTNER MOBILE
   ============================================================ */

@media (max-width: 767px) {

    .partner-workspace .sidebar {
        position: fixed;

        top: 75px;
        left: 0;
        bottom: 0;

        width: 235px;
        height: calc(100vh - 75px);

        padding: 24px 20px 20px;

        transform: translateX(-100%);

        transition: transform .2s ease;

        overflow: hidden !important;
    }


    .partner-workspace .sidebar.is-open {
        transform: translateX(0);

        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.15);
    }


    .partner-workspace .main-area {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 100vh;

        margin: 0;

        overflow: hidden !important;
    }


    .partner-workspace .main-area > .topbar {
        flex: 0 0 75px;

        height: 75px;
        min-height: 75px;

        padding: 0 18px;
    }


    .partner-workspace .main-area > .page-content {
        flex: 1 1 auto;

        min-height: 0;

        overflow-x: auto !important;
        overflow-y: auto !important;
    }


    .partner-workspace .main-area > .page-footer {
        flex: 0 0 auto;

        min-height: 61px;
    }
}

/* ============================================================
   PARTNER STUDENT REPORTS
   Admin-style analytics dashboard
   ============================================================ */

.partner-report-metrics {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}


/* ------------------------------------------------------------
   Chart grid
   ------------------------------------------------------------ */

.partner-report-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 24px;
}

.partner-report-panel {
    min-width: 0;
    overflow: hidden;
}


/* ------------------------------------------------------------
   Chart center
   ------------------------------------------------------------ */

.partner-chart-center {
    width: 100%;
    max-width: 330px;

    margin: 10px auto 20px;

    position: relative;
}

.partner-chart-center canvas {
    width: 100% !important;
    height: auto !important;
}


/* ------------------------------------------------------------
   Chart legend
   ------------------------------------------------------------ */

.partner-chart-legend {
    margin-top: 10px;
}

.partner-legend-item {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 0;

    border-bottom: 1px solid var(--line);

    font-size: 12px;
}

.partner-legend-item:last-child {
    border-bottom: 0;
}

.partner-legend-item strong {
    margin-left: auto;

    font-weight: 600;
}

.partner-legend-item strong small {
    color: var(--muted);

    font-size: 10px;

    font-weight: 400;
}

.partner-legend-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    flex-shrink: 0;
}


/* ------------------------------------------------------------
   Trend chart
   ------------------------------------------------------------ */

.partner-line-chart-wrapper {
    position: relative;

    width: 100%;

    height: 320px;

    margin-top: 10px;
}

.partner-line-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}


/* ------------------------------------------------------------
   Pipeline bar chart
   ------------------------------------------------------------ */

.partner-bar-chart-wrapper {
    position: relative;

    width: 100%;

    height: 420px;

    margin-top: 10px;
}

.partner-bar-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}


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

@media (max-width: 1100px) {

    .partner-report-metrics {
        grid-template-columns:
            repeat(2, minmax(170px, 1fr));
    }

    .partner-report-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 767px) {

    .partner-report-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .partner-line-chart-wrapper {
        height: 260px;
    }

    .partner-bar-chart-wrapper {
        height: 350px;
    }
}


@media (max-width: 480px) {

    .partner-report-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .partner-report-panel {
        padding: 18px;
    }

    .partner-chart-center {
        max-width: 280px;
    }

    .partner-line-chart-wrapper {
        height: 230px;
    }

    .partner-bar-chart-wrapper {
        height: 320px;
    }
}


/* ------------------------------------------------------------
   Dark mode
   ------------------------------------------------------------ */

[data-bs-theme="dark"] .partner-legend-item {
    border-color: var(--line);
}