/* ============================================================
   Marketplace Styles
   ============================================================ */

:root {
    --mk-sidebar-w: 280px;
    --mk-green:     #40916c;
    --mk-green-d:   #2d6a4f;
    --mk-green-l:   #d8f3dc;
    --mk-card-r:    10px;
}

/* ── Marketplace Layout ── */
.mk-page { min-height: 100vh; background: #f0f4f1; display: flex; flex-direction: column; }

.mk-navbar {
    background: var(--mk-green-d);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 300;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.mk-navbar-logo {
    display: flex; align-items: center; gap: 12px;
    color: #fff; text-decoration: none; flex-shrink: 0;
}
.mk-navbar-logo svg { flex-shrink: 0; }
.mk-navbar-logo span { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.mk-navbar-logo small { font-size: 11px; color: #b7e4c7; display: block; line-height: 1; }

/* Desktop nav links */
.mk-nav-actions { display: flex; align-items: center; gap: 8px; }
.mk-nav-actions a { text-decoration: none; }

.btn-outline-white {
    border: 1.5px solid rgba(255,255,255,.55);
    color: #fff;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
    background: transparent;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.btn-outline-white:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.8); }
.btn-white-solid {
    background: #fff;
    color: var(--mk-green-d);
    padding: 7px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    transition: all .15s;
    border: none;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.btn-white-solid:hover { background: #e8f5e9; }

.mk-user-badge {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 7px;
    padding: 6px 13px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.mk-user-badge .balance-chip {
    background: #52b788;
    border-radius: 5px;
    padding: 2px 9px;
    font-weight: 700;
    font-size: 12px;
}

/* Mobile hamburger (hidden on desktop) */
.mk-hamburger {
    display: none;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.mk-hamburger:hover { background: rgba(255,255,255,.22); }

/* Mobile nav drawer */
.mk-nav-drawer {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--mk-green-d);
    z-index: 299;
    flex-direction: column;
    padding: 12px 16px 20px;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    border-top: 1px solid rgba(255,255,255,.1);
    animation: drawerIn .2s ease;
}
.mk-nav-drawer.open { display: flex; }
@keyframes drawerIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.mk-drawer-user {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 4px 14px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 6px;
}
.mk-drawer-avatar {
    width: 42px; height: 42px;
    background: #52b788;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.mk-drawer-uname { font-size: 14px; font-weight: 700; color: #fff; }
.mk-drawer-bal { font-size: 12px; color: #b7e4c7; margin-top: 2px; }

.mk-drawer-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    border-radius: 9px;
    font-size: 14px; font-weight: 500;
    transition: background .13s;
}
.mk-drawer-link i { width: 18px; text-align: center; font-size: 15px; color: #74c69d; }
.mk-drawer-link:hover { background: rgba(255,255,255,.1); }
.mk-drawer-link.primary {
    background: #52b788; color: #fff; font-weight: 700; margin-top: 4px;
}
.mk-drawer-link.primary i { color: #fff; }
.mk-drawer-link.primary:hover { background: #40916c; }
.mk-drawer-link.danger { color: #fca5a5; }
.mk-drawer-link.danger i { color: #fca5a5; }
.mk-drawer-link.danger:hover { background: rgba(239,68,68,.15); }
.mk-drawer-divider { height: 1px; background: rgba(255,255,255,.1); margin: 6px 0; }

/* ── Body ── */
.mk-body {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 16px;
    gap: 20px;
    align-items: flex-start;
}

/* ── Filter Sidebar ── */
.mk-filters {
    width: var(--mk-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    background: #fff;
    border-radius: var(--mk-card-r);
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    overflow: hidden;
}
.mk-filters-header {
    background: var(--mk-green-d);
    color: #fff;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mk-filters-header button {
    background: none;
    border: 1.5px solid rgba(255,255,255,.5);
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.filter-section { padding: 16px 18px; border-bottom: 1px solid #e9ecef; }
.filter-section:last-child { border-bottom: none; }
.filter-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; margin-bottom: 12px; }

/* Location */
.geo-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--mk-green-l);
    color: var(--mk-green-d);
    border: 1.5px solid #b7e4c7;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: all .15s;
}
.geo-btn:hover { background: #b7e4c7; }
.geo-btn.active { background: var(--mk-green-d); color: #fff; border-color: var(--mk-green-d); }
.geo-status { font-size: 12px; color: #6c757d; margin-bottom: 10px; }
.geo-status.ok { color: var(--mk-green); }
.geo-status.err { color: #dc3545; }

.city-select {
    width: 100%;
    border: 1.5px solid #dee2e6;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    color: #495057;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236c757d' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.city-select:focus { outline: none; border-color: var(--mk-green); }

/* Distance Slider */
.distance-wrap { margin-top: 10px; }
.distance-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.distance-label span { font-size: 13px; color: #495057; }
.distance-label strong { font-size: 14px; color: var(--mk-green-d); }
input[type=range].distance-slider {
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--mk-green) 0%, var(--mk-green) var(--pct, 40%), #dee2e6 var(--pct, 40%), #dee2e6 100%);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
input[type=range].distance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--mk-green-d);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--mk-green);
    cursor: pointer;
}

/* Appliance Checkboxes */
.appliance-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.appliance-list::-webkit-scrollbar { width: 4px; }
.appliance-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 2px; }
.appliance-list::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 2px; }
.appliance-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.appliance-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--mk-green-d); cursor: pointer; }
.appliance-check span { font-size: 13px; color: #495057; user-select: none; }
.appliance-check:hover span { color: var(--mk-green-d); }

/* ── Leads Main ── */
.mk-leads-main { flex: 1; min-width: 0; }

.mk-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.mk-results-bar h2 { font-size: 16px; font-weight: 700; color: #2d3748; }
.mk-results-bar span { font-size: 13px; color: #6c757d; }
.mk-sort-select {
    border: 1.5px solid #dee2e6;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

/* Lead Cards */
.leads-list { display: flex; flex-direction: column; gap: 14px; }

.lead-card {
    background: #fff;
    border-radius: var(--mk-card-r);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
    border: 1.5px solid transparent;
}
.lead-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.11); transform: translateY(-1px); border-color: #b7e4c7; }
.lead-card.sold { opacity: .65; }

.lead-card-icon {
    width: 80px;
    flex-shrink: 0;
    background: var(--mk-green-l);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
}
.lead-card-icon i { font-size: 22px; color: var(--mk-green-d); }
.lead-card-icon span { font-size: 10px; font-weight: 600; color: var(--mk-green-d); text-align: center; line-height: 1.2; }

.lead-card-body { flex: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.lead-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lead-card-title { font-size: 15px; font-weight: 700; color: #2d3748; }
.lead-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
}
.lead-badge.available { background: #d4edda; color: #155724; }
.lead-badge.sold { background: #f8d7da; color: #721c24; }

.lead-card-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lead-card-meta span { font-size: 12px; color: #6c757d; display: flex; align-items: center; gap: 5px; }
.lead-card-meta span i { color: var(--mk-green); }

.lead-card-desc { font-size: 13px; color: #495057; line-height: 1.5; }

.lead-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 8px;
}
.lead-price { font-size: 20px; font-weight: 800; color: var(--mk-green-d); }
.lead-price small { font-size: 12px; font-weight: 400; color: #6c757d; }

.btn-get-lead {
    background: var(--mk-green-d);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background .15s;
    text-decoration: none;
}
.btn-get-lead:hover { background: #1b4332; }
.btn-get-lead.sold-btn { background: #6c757d; cursor: not-allowed; }
.btn-get-lead i { font-size: 12px; }

/* Skeleton loader */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card { background: #fff; border-radius: var(--mk-card-r); padding: 20px; height: 110px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* Empty state */
.leads-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}
.leads-empty i { font-size: 48px; color: #dee2e6; margin-bottom: 16px; display: block; }
.leads-empty h3 { font-size: 18px; margin-bottom: 8px; color: #495057; }

/* ── Modal ── */
.mk-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.mk-modal-overlay.open { opacity: 1; pointer-events: auto; }
.mk-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    padding: 28px;
    transform: translateY(12px);
    transition: transform .2s;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.mk-modal-overlay.open .mk-modal { transform: translateY(0); }
.mk-modal h3 { font-size: 18px; font-weight: 700; color: #2d3748; margin-bottom: 6px; }
.mk-modal p { font-size: 14px; color: #6c757d; margin-bottom: 20px; }
.mk-modal-lead-preview {
    background: var(--mk-green-l);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.mk-modal-lead-preview i { font-size: 24px; color: var(--mk-green-d); }
.mk-modal-lead-preview div { flex: 1; }
.mk-modal-lead-preview strong { font-size: 14px; color: #2d3748; display: block; }
.mk-modal-lead-preview span { font-size: 12px; color: #6c757d; }
.mk-modal-balance { display: flex; justify-content: space-between; font-size: 14px; color: #495057; margin-bottom: 8px; }
.mk-modal-balance strong { color: var(--mk-green-d); }
.mk-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel { background: #f8f9fa; color: #495057; border: 1.5px solid #dee2e6; border-radius: 7px; padding: 9px 20px; font-size: 13px; cursor: pointer; }
.btn-cancel:hover { background: #e9ecef; }
.btn-confirm-buy { background: var(--mk-green-d); color: #fff; border: none; border-radius: 7px; padding: 9px 22px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-confirm-buy:hover { background: #1b4332; }

/* ── Purchase Success Panel ── */
.mk-success-header { text-align: center; padding: 8px 0 20px; }
.mk-success-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #40916c, #52b788);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 24px; color: #fff;
    box-shadow: 0 4px 16px rgba(64,145,108,.35);
}
.mk-success-header h3 { font-size: 20px; font-weight: 800; color: #1a202c; margin: 0 0 6px; }
.mk-success-header p  { font-size: 13px; color: #6c757d; margin: 0; }

.mk-contact-grid { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.mk-contact-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 12px 14px;
    background: #f8fffe;
    border-radius: 10px;
    border: 1px solid #e6f4f1;
}
.mk-contact-row i { color: var(--mk-green); font-size: 15px; margin-top: 2px; width: 16px; flex-shrink: 0; }
.mk-contact-row label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #a0aec0; margin-bottom: 3px; }
.mk-contact-row span, .mk-contact-row a { font-size: 14px; font-weight: 600; color: #1a202c; text-decoration: none; }
.mk-contact-row a:hover { color: var(--mk-green); text-decoration: underline; }

/* ── Register / Login Pages ── */
.auth-page { min-height: 100vh; background: #f0f4f1; display: flex; flex-direction: column; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 30px rgba(0,0,0,.10);
    width: 100%;
    max-width: 480px;
    padding: 36px 40px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--mk-green-d); margin-top: 10px; }
.auth-logo p { font-size: 13px; color: #6c757d; margin-top: 4px; }

.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; color: #495057; margin-bottom: 6px; }
.auth-form input[type=text],
.auth-form input[type=email],
.auth-form input[type=password],
.auth-form input[type=tel],
.auth-form select,
.auth-form textarea {
    width: 100%;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #495057;
    transition: border-color .15s;
    background: #fff;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
    outline: none;
    border-color: var(--mk-green);
    box-shadow: 0 0 0 3px rgba(64,145,108,.12);
}
.auth-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cert-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.cert-upload-area:hover { border-color: var(--mk-green); background: var(--mk-green-l); }
.cert-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cert-upload-area i { font-size: 32px; color: #ced4da; display: block; margin-bottom: 8px; }
.cert-upload-area p { font-size: 13px; color: #6c757d; margin: 0; }
.cert-upload-area small { font-size: 12px; color: #adb5bd; }
.cert-upload-area.has-file { border-color: var(--mk-green); background: var(--mk-green-l); }
.cert-upload-area.has-file i { color: var(--mk-green-d); }

.btn-auth {
    width: 100%;
    background: var(--mk-green-d);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background .15s;
}
.btn-auth:hover { background: #1b4332; }

.auth-links { text-align: center; margin-top: 20px; font-size: 13px; color: #6c757d; }
.auth-links a { color: var(--mk-green-d); font-weight: 600; text-decoration: none; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warn { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── Admin Panel ── */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    background: var(--mk-green-d);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.admin-logo { padding: 20px 18px 12px; }
.admin-logo a { color: #fff; text-decoration: none; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.admin-logo small { font-size: 11px; color: #b7e4c7; display: block; }
.admin-nav { padding: 8px 0; flex: 1; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #b7e4c7;
    text-decoration: none;
    font-size: 13px;
    transition: all .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.admin-nav a i { width: 18px; text-align: center; }
.admin-nav .nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.4); padding: 12px 18px 4px; }

.admin-main { margin-left: 220px; flex: 1; min-width: 0; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar h1 { font-size: 16px; font-weight: 700; color: #2d3748; }
.admin-content { padding: 24px; }

/* Admin cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-card .stat-icon.green { background: var(--mk-green-l); color: var(--mk-green-d); }
.stat-card .stat-icon.blue { background: #dbeafe; color: #1e40af; }
.stat-card .stat-icon.amber { background: #fef3c7; color: #92400e; }
.stat-card .stat-icon.red { background: #fee2e2; color: #991b1b; }
.stat-card .stat-val { font-size: 26px; font-weight: 800; color: #2d3748; }
.stat-card .stat-label { font-size: 12px; color: #6c757d; }

.admin-table-wrap { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.admin-table-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e9ecef; flex-wrap: wrap; gap: 10px; }
.admin-table-head h3 { font-size: 15px; font-weight: 700; color: #2d3748; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; background: #f8f9fa; border-bottom: 1px solid #e9ecef; }
table.admin-table td { padding: 12px 14px; font-size: 13px; color: #495057; border-bottom: 1px solid #f1f3f5; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: #f8fffe; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-pill.approved { background: #d4edda; color: #155724; }
.status-pill.pending { background: #fff3cd; color: #856404; }
.status-pill.rejected { background: #f8d7da; color: #721c24; }
.status-pill.none { background: #e9ecef; color: #6c757d; }

.btn-sm { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; border: none; transition: all .13s; }
.btn-sm.green { background: var(--mk-green-l); color: var(--mk-green-d); }
.btn-sm.green:hover { background: #b7e4c7; }
.btn-sm.red { background: #fee2e2; color: #991b1b; }
.btn-sm.red:hover { background: #fecaca; }
.btn-sm.blue { background: #dbeafe; color: #1e40af; }
.btn-sm.blue:hover { background: #bfdbfe; }
.btn-sm.primary { background: var(--mk-green-d); color: #fff; }
.btn-sm.primary:hover { background: #1b4332; }

.btn-primary {
    background: var(--mk-green-d);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s;
    text-decoration: none;
}
.btn-primary:hover { background: #1b4332; }

/* Admin Form */
.admin-form .form-group { margin-bottom: 16px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; color: #495057; margin-bottom: 6px; }
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #495057;
    background: #fff;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { outline: none; border-color: var(--mk-green); box-shadow: 0 0 0 3px rgba(64,145,108,.12); }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.form-panel { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 24px; margin-bottom: 24px; }
.form-panel h3 { font-size: 15px; font-weight: 700; color: #2d3748; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #e9ecef; }

/* Pagination */
.mk-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.mk-pagination a, .mk-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    color: #495057;
    border: 1.5px solid #dee2e6;
    background: #fff;
    transition: all .13s;
}
.mk-pagination a:hover { border-color: var(--mk-green); color: var(--mk-green-d); }
.mk-pagination .active { background: var(--mk-green-d); color: #fff; border-color: var(--mk-green-d); }

/* Toast */
.mk-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #2d3748;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    transform: translateY(80px);
    opacity: 0;
    transition: all .3s;
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.mk-toast.show { transform: translateY(0); opacity: 1; }
.mk-toast.success { background: var(--mk-green-d); }
.mk-toast.error { background: #991b1b; }

/* Mobile filter toggle button (hidden on desktop) */
.mk-filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--mk-green-d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    /* Leads marketplace: move filters above cards */
    .mk-body { flex-direction: column; padding: 12px; gap: 0; }
    .mk-filters {
        width: 100%;
        position: static;
        height: auto;
        overflow: visible;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        border-right: none;
        border-bottom: 1px solid var(--mk-border);
        padding: 12px;
        border-radius: 12px 12px 0 0;
    }
    .mk-filter-section { flex: 1; min-width: 140px; }
    .mk-filter-section h4 { display: none; }
    .mk-leads-area { padding: 12px; }
    .mk-lead-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Navbar: hide desktop links, show hamburger */
    .mk-navbar { padding: 0 16px; height: 58px; }
    .mk-nav-actions { display: none; }
    .mk-hamburger { display: flex; }
    .mk-nav-drawer { top: 58px; }

    /* Show filter toggle button, hide filters by default */
    .mk-filter-toggle-btn { display: flex; }
    .mk-filters { display: none; }
    .mk-filters.mob-open { display: flex; }
    .mk-results-bar { flex-wrap: wrap; gap: 8px; }

    /* Auth forms */
    .auth-card { padding: 24px 16px; }
    .auth-form .form-row { grid-template-columns: 1fr; }
    .auth-card { max-width: 100%; margin: 12px; }

    /* Profile settings */
    .ps-grid { grid-template-columns: 1fr !important; }

    /* Lead cards */
    .mk-lead-card { border-radius: 10px; }
    .mk-lead-header { padding: 14px 14px 8px; }
    .mk-lead-body { padding: 0 14px 12px; }
    .mk-lead-footer { padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Filter sidebar collapsed to horizontal scroll row */
    .mk-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        border-radius: 0;
        padding: 10px 12px;
    }
    .mk-filter-section { min-width: 180px; }
    .mk-filter-section .mk-checkbox-list { max-height: 120px; }

    /* Distance slider */
    .mk-distance-val { font-size: 14px; }
}

/* Certificate image preview */
.cert-preview { margin-top: 10px; }
.cert-preview img { max-width: 100%; max-height: 150px; border-radius: 6px; border: 1px solid #dee2e6; }

/* Balance input inline */
.balance-inline { display: flex; gap: 6px; }
.balance-inline input { flex: 1; border: 1.5px solid #dee2e6; border-radius: 6px; padding: 5px 10px; font-size: 13px; }
.balance-inline button { padding: 5px 12px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.balance-inline .add-btn { background: #d4edda; color: #155724; }
.balance-inline .sub-btn { background: #f8d7da; color: #721c24; }
