:root {
    --ink: #0b1f1c;
    --paper: #f4f5ef;
    --line: rgba(11, 31, 28, 0.10);
    --green: #0e7c66;
    --lime: #d8f27a;
    --muted: #5c6b67;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.admin-sidebar {
    width: 248px;
    flex: 0 0 248px;
    background: var(--ink);
    color: #fff;
    padding: 22px 14px 18px;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 24px;
    color: #fff;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--lime);
    color: var(--ink);
    font-weight: 800;
    font-size: 21px;
    line-height: 1;
    flex: 0 0 auto;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.admin-brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.admin-brand-sub {
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
    font-weight: 700;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13.5px;
    font-weight: 600;
    transition: background-color .16s ease, color .16s ease;
}

.side-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.side-link.active {
    background: var(--lime);
    color: var(--ink);
    font-weight: 800;
}

.side-link i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-link-btn {
    background: none;
    border: 0;
    text-align: left;
}

.admin-offcanvas {
    background: var(--ink);
    color: #fff;
}

.admin-offcanvas .admin-brand-name {
    color: #fff;
}

/* ---------- Main ---------- */

.admin-main {
    flex: 1;
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.topbar-sub {
    font-size: 11px;
    color: var(--muted);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
}

.admin-content {
    padding: 26px 28px 48px;
    max-width: 1240px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0;
    line-height: 1.1;
}

.page-sub {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 0;
}

/* ---------- Stats ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
}

.stat-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 9px;
}

.stat-value {
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
}

.stat-value.accent {
    color: var(--green);
}

/* ---------- Panels ---------- */

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-title {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
}

.panel-body {
    padding: 20px;
}

.panel-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--green);
}

/* ---------- Table ---------- */

.table {
    margin: 0;
    font-size: 13.5px;
}

.table thead th {
    background: #fafbf6;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--line);
    padding: 11px 14px;
    font-weight: 800;
    white-space: nowrap;
}

.table td {
    padding: 13px 14px;
    border-color: #eef0e8;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #fbfcf7;
}

.table a.lead-name {
    color: var(--ink);
    font-weight: 700;
}

.table a.lead-name:hover {
    color: var(--green);
}

.phone-link {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.phone-link:hover {
    color: var(--green);
}

/* ---------- Status ---------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}

.status-new {
    background: #eef8c9;
    color: #3f4a12;
}

.status-progress {
    background: #e0f2fe;
    color: #075985;
}

.status-done {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ---------- Filters ---------- */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--line);
    padding: 5px;
    border-radius: 999px;
}

.filter-tab {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--ink);
}

.filter-tab.active {
    background: var(--ink);
    color: #fff;
}

.filter-tab .count {
    opacity: 0.55;
    margin-left: 3px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.search-form .form-control {
    min-width: 220px;
    background: #fff;
}
.search-form .btn {
    padding-left: 12px;
    padding-right: 12px;
}

/* ---------- Buttons / forms ---------- */

.btn-dark-pill {
    background: var(--ink);
    border: 1px solid var(--ink);
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 700;
}

.btn-dark-pill:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.btn-ghost-sm {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
}

.btn-ghost-sm:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    font-size: 13.5px;
    border-radius: 10px;
    border-color: var(--line);
    padding: 9px 12px;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.12);
}

.btn-save {
    background: var(--ink);
    border: 1px solid var(--ink);
    color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
}

.btn-save:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.btn-danger-soft {
    background: #fff;
    border: 1px solid #fecdca;
    color: #b42318;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 700;
}

.btn-danger-soft:hover {
    background: #fef3f2;
    color: #912018;
}

/* ---------- Lead detail ---------- */

.lead-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: start;
}

.detail-list {
    display: grid;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1ea;
    font-size: 13.5px;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-value {
    font-weight: 600;
    word-break: break-word;
}

.comment-box {
    background: #fafbf6;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-line;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #eef0e8;
    font-size: 12px;
    color: var(--muted);
}

.meta-row:last-child {
    border-bottom: 0;
}

.meta-row span:last-child {
    color: var(--ink);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    max-width: 65%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 14px;
}

.back-link:hover {
    color: var(--green);
}

/* ---------- Empty / alerts ---------- */

.empty-state {
    text-align: center;
    padding: 54px 20px;
    color: var(--muted);
}

.empty-state i {
    display: block;
    font-size: 34px;
    color: var(--green);
    margin-bottom: 12px;
}

.empty-state p {
    margin: 0;
    font-size: 13.5px;
}

.alert {
    border-radius: 12px;
    font-size: 13px;
    padding: 11px 14px;
}

/* ---------- Pagination ---------- */

.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
}

.pagination {
    margin: 0;
    gap: 5px;
}

.pagination .page-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
}

.pagination .page-item.active .page-link {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

/* ---------- Login ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 80% 10%, rgba(216, 242, 122, 0.5), transparent 45%),
        radial-gradient(ellipse at 10% 90%, rgba(18, 164, 136, 0.12), transparent 45%),
        var(--paper);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 26px 60px rgba(11, 31, 28, 0.10);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.login-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.login-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
}

.login-foot {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
}

.login-foot a {
    color: var(--muted);
    font-weight: 600;
}

.login-foot a:hover {
    color: var(--green);
}

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

@media (max-width: 991px) {
    .admin-content {
        padding: 18px 18px 40px;
    }

    .admin-topbar {
        padding: 0 18px;
    }

    .lead-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 575px) {
    .page-title {
        font-size: 22px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 26px;
    }

    .topbar-user span {
        display: none;
    }

    .search-form {
        width: 100%;
        margin-left: 0;
    }

    .search-form .form-control {
        min-width: 0;
        flex: 1;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .login-card {
        padding: 24px;
    }
}
