:root {
    --lf-bg: #f4f7fb;
    --lf-card: #ffffff;
    --lf-dark: #101828;
    --lf-muted: #667085;
    --lf-border: #e5e7eb;
    --lf-primary: #2563eb;
    --lf-primary-dark: #1d4ed8;
    --lf-sidebar: #0f172a;
    --lf-sidebar-soft: #1e293b;
    --lf-green: #16a34a;
    --lf-red: #dc2626;
    --lf-orange: #f97316;
    --lf-yellow: #ca8a04;
    --lf-purple: #7c3aed;
    --lf-blue: #2563eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--lf-dark);
    background: var(--lf-bg);
}

a {
    text-decoration: none;
}

.lf-app {
    min-height: 100vh;
    display: flex;
}

/* Login */
.lf-login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 35%),
        linear-gradient(135deg, #0f172a 0%, #111827 45%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lf-login-wrapper {
    width: 100%;
    max-width: 430px;
}

.lf-login-card {
    background: rgba(255,255,255,.96);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.35);
}

.lf-login-brand {
    text-align: center;
    margin-bottom: 26px;
}

.lf-logo-mark,
.lf-brand-mark {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(37,99,235,.35);
}

.lf-login-brand h1 {
    margin: 16px 0 6px;
    font-size: 28px;
}

.lf-login-brand p {
    margin: 0;
    color: var(--lf-muted);
    font-size: 14px;
}

.lf-form-group {
    margin-bottom: 18px;
}

.lf-form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

.lf-form-group input,
.lf-form-group select,
.lf-form-group textarea {
    width: 100%;
    border: 1px solid var(--lf-border);
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.lf-form-group input:focus,
.lf-form-group select:focus,
.lf-form-group textarea:focus {
    border-color: var(--lf-primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.lf-login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--lf-muted);
    font-size: 13px;
}

/* Buttons */
.lf-btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}

.lf-btn-primary {
    background: linear-gradient(135deg, var(--lf-primary), var(--lf-purple));
    color: #fff;
    box-shadow: 0 12px 26px rgba(37,99,235,.25);
}

.lf-btn-primary:hover {
    filter: brightness(.96);
}

.lf-btn-full {
    width: 100%;
}

/* Alerts */
.lf-alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

/* Sidebar */
.lf-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    padding: 22px 18px;
}

.lf-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 6px 6px 24px;
}

.lf-sidebar-brand .lf-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.lf-sidebar-brand h2 {
    margin: 0;
    font-size: 20px;
}

.lf-sidebar-brand span {
    color: #94a3b8;
    font-size: 13px;
}

.lf-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5px;
}

.lf-sidebar-nav a {
    color: #cbd5e1;
    padding: 13px 14px;
    border-radius: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lf-sidebar-nav a:hover,
.lf-sidebar-nav a.active {
    background: rgba(255,255,255,.10);
    color: #fff;
}

.lf-nav-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 18px 14px 6px;
    letter-spacing: .08em;
}

/* Main */
.lf-main {
    width: 100%;
    margin-left: 280px;
    padding: 26px;
}

.lf-topbar {
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: 24px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 14px 40px rgba(15,23,42,.05);
    margin-bottom: 24px;
}

.lf-topbar h1 {
    margin: 0 0 5px;
    font-size: 27px;
}

.lf-topbar p {
    margin: 0;
    color: var(--lf-muted);
}

.lf-user-pill {
    display: flex;
    align-items: center;
    gap: 11px;
    background: #f8fafc;
    border: 1px solid var(--lf-border);
    padding: 10px 13px;
    border-radius: 18px;
}

.lf-user-pill span {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.lf-user-pill strong,
.lf-user-pill small {
    display: block;
}

.lf-user-pill small {
    color: var(--lf-muted);
}

.lf-menu-btn {
    display: none;
    border: 0;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
}

/* Stats */
.lf-stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.lf-stat-card {
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: 22px;
    padding: 19px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 12px 34px rgba(15,23,42,.05);
}

.lf-stat-card span {
    color: var(--lf-muted);
    font-size: 13px;
    font-weight: 700;
}

.lf-stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: 25px;
}

.lf-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.lf-stat-icon.blue { background: #dbeafe; }
.lf-stat-icon.green { background: #dcfce7; }
.lf-stat-icon.purple { background: #ede9fe; }
.lf-stat-icon.orange { background: #ffedd5; }
.lf-stat-icon.success { background: #d1fae5; }
.lf-stat-icon.red { background: #fee2e2; }

/* Cards */
.lf-dashboard-grid {
    display: grid;
    grid-template-columns: 1.7fr .8fr;
    gap: 20px;
}

.lf-card {
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 12px 34px rgba(15,23,42,.05);
}

.lf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.lf-card-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.lf-card-head p {
    margin: 0;
    color: var(--lf-muted);
    font-size: 14px;
}

/* Table */
.lf-table-wrap {
    overflow-x: auto;
}

.lf-table {
    width: 100%;
    border-collapse: collapse;
}

.lf-table th {
    background: #f8fafc;
    text-align: left;
    color: #475467;
    font-size: 13px;
    padding: 13px;
    border-bottom: 1px solid var(--lf-border);
}

.lf-table td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--lf-border);
    font-size: 14px;
    vertical-align: middle;
}

.lf-table td strong {
    display: block;
}

.lf-table td small {
    display: block;
    color: var(--lf-muted);
    margin-top: 3px;
}

.lf-empty {
    text-align: center;
    color: var(--lf-muted);
    padding: 30px !important;
}

/* Badges */
.lf-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-green,
.badge-success { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-dark { background: #111827; color: #fff; }

/* Source List */
.lf-source-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lf-source-item {
    background: #f8fafc;
    border: 1px solid var(--lf-border);
    border-radius: 18px;
    padding: 14px;
}

.lf-source-item strong,
.lf-source-item span {
    display: block;
}

.lf-source-item span {
    color: var(--lf-muted);
    font-size: 13px;
    margin-top: 4px;
}

.lf-source-bar {
    height: 9px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.lf-source-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, var(--lf-primary), var(--lf-purple));
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 1300px) {
    .lf-stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lf-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .lf-sidebar {
        transform: translateX(-110%);
        transition: .25s ease;
    }

    .lf-sidebar.show {
        transform: translateX(0);
    }

    .lf-main {
        margin-left: 0;
        padding: 16px;
    }

    .lf-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .lf-topbar {
        align-items: flex-start;
    }

    .lf-user-pill {
        display: none;
    }

    .lf-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .lf-stat-grid {
        grid-template-columns: 1fr;
    }

    .lf-topbar {
        border-radius: 18px;
        padding: 18px;
    }

    .lf-card {
        padding: 17px;
        border-radius: 18px;
    }

    .lf-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .lf-login-card {
        padding: 25px;
        border-radius: 22px;
    }
}

.lf-btn-light {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.lf-btn-light:hover {
    background: #e2e8f0;
}

.lf-filter-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.lf-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}

.lf-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lf-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 7px 9px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 900;
    font-size: 12px;
}

.lf-mini-btn.edit {
    background: #fff7ed;
    color: #c2410c;
}

.lf-mini-btn.whatsapp {
    background: #dcfce7;
    color: #15803d;
}

.lf-form-section {
    background: #fff;
    border: 1px solid var(--lf-border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 12px 34px rgba(15,23,42,.05);
    margin-bottom: 20px;
}

.lf-section-title {
    margin-bottom: 20px;
}

.lf-section-title h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.lf-section-title p {
    margin: 0;
    color: var(--lf-muted);
    font-size: 14px;
}

.lf-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.lf-form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .lf-form-grid,
    .lf-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lf-filter-actions {
        margin-bottom: 0;
    }
}

@media (max-width: 620px) {
    .lf-form-grid,
    .lf-filter-grid {
        grid-template-columns: 1fr;
    }

    .lf-form-actions {
        flex-direction: column;
    }

    .lf-form-actions .lf-btn {
        width: 100%;
    }
}

.lf-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lf-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.lf-profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.lf-profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--lf-primary), var(--lf-purple));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    box-shadow: 0 15px 35px rgba(37,99,235,.25);
}

.lf-profile-head h2 {
    margin: 0 0 5px;
    font-size: 24px;
}

.lf-profile-head p {
    margin: 0 0 9px;
    color: var(--lf-muted);
}

.lf-profile-badges {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.lf-info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.lf-info-list div {
    background: #f8fafc;
    border: 1px solid var(--lf-border);
    border-radius: 16px;
    padding: 14px;
}

.lf-info-list span {
    display: block;
    color: var(--lf-muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.lf-info-list strong {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.lf-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.lf-btn-whatsapp {
    background: #16a34a;
    color: #fff;
}

.lf-remarks-box {
    background: #f8fafc;
    border: 1px solid var(--lf-border);
    border-radius: 18px;
    padding: 16px;
    min-height: 128px;
    color: #334155;
    line-height: 1.6;
}

.lf-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lf-timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
}

.lf-timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lf-primary);
    margin-top: 7px;
    box-shadow: 0 0 0 5px rgba(37,99,235,.12);
}

.lf-timeline-content {
    background: #f8fafc;
    border: 1px solid var(--lf-border);
    border-radius: 16px;
    padding: 14px;
}

.lf-timeline-content p {
    margin: 0 0 8px;
    color: #334155;
    line-height: 1.55;
}

.lf-timeline-content span {
    color: var(--lf-muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .lf-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .lf-info-list {
        grid-template-columns: 1fr;
    }

    .lf-profile-head {
        align-items: flex-start;
    }

    .lf-top-actions {
        width: 100%;
    }

    .lf-top-actions .lf-btn {
        flex: 1;
    }
}

.lf-stat-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.followup-filter-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
}

.lf-row-overdue {
    background: #fff7f7;
}

.lf-row-today {
    background: #fffaf0;
}

.lf-text-red {
    color: #b91c1c !important;
    font-weight: 900;
}

.lf-text-orange {
    color: #c2410c !important;
    font-weight: 900;
}

.lf-mini-btn.complete {
    background: #dcfce7;
    color: #15803d;
}

.lf-mini-btn.danger {
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 1200px) {
    .lf-stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .followup-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .lf-stat-grid-4,
    .followup-filter-grid {
        grid-template-columns: 1fr;
    }
}
.lf-master-grid {
    display: grid;
    grid-template-columns: .75fr 1.4fr;
    gap: 20px;
}

@media (max-width: 1050px) {
    .lf-master-grid {
        grid-template-columns: 1fr;
    }
}

.lf-report-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.lf-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1350px) {
    .lf-report-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .lf-report-grid {
        grid-template-columns: 1fr;
    }

    .lf-report-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .lf-report-filter-grid {
        grid-template-columns: 1fr;
    }
}

.lf-help-text {
    display: block;
    margin-top: 7px;
    color: var(--lf-muted);
    font-size: 12px;
    font-weight: 700;
}

.lf-promo-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--lf-border);
    background: #f8fafc;
}

.lf-promo-image-box {
    margin-top: 16px;
    border: 1px solid var(--lf-border);
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    max-width: 420px;
}

.lf-promo-image-box img {
    display: block;
    width: 100%;
    height: auto;
}

.lf-current-promo-image {
    margin-bottom: 12px;
    max-width: 260px;
    border: 1px solid var(--lf-border);
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
}

.lf-current-promo-image img {
    display: block;
    width: 100%;
    height: auto;
}

.lf-mini-btn.refresh {
    background: #e0f2fe;
    color: #0369a1;
}