:root {
    --bs-primary: #334155;
    --bs-primary-rgb: 51, 65, 85;
    --bs-body-bg: #ffffff;
    --bs-border-radius: 0.5rem;
    --bs-font-sans-serif: 'Inter', system-ui, sans-serif;
    --bs-body-font-family: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bs-body-bg);
}

.container-master {
    max-width: 98%;
    margin: auto;
}

.link-name {
    color: #0d6efd;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.link-name:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.external-link {
    color: #0d6efd;
    text-decoration: none;
}

.external-link:hover {
    text-decoration: underline;
}

.data-card {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 12px;
    border-radius: 8px;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.data-card:hover {
    border-color: #dee2e6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.data-card span.card-label {
    display: block;
    font-size: 0.7em;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 3px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.data-card div.card-value {
    font-size: 0.9em;
    color: #212529;
    word-break: break-word;
}

.copyable {
    cursor: pointer;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 1px;
}

.copyable:hover {
    background-color: #f8f9fa;
    border-bottom: 1px dashed #0d6efd;
    color: #0d6efd;
}

#leadsTable {
    font-size: 0.85rem;
    width: 100% !important;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#leadsTable th,
#leadsTable td {
    vertical-align: middle;
    overflow: hidden;
    border-bottom: 1px solid #dee2e6;
}

#leadsTable thead tr:first-child th:first-child {
    border-top-left-radius: 0.5rem;
}

#leadsTable thead tr:first-child th:last-child {
    border-top-right-radius: 0.5rem;
}

#leadsTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.5rem;
}

#leadsTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.5rem;
}

#leadsTable tbody tr:last-child td {
    border-bottom: none;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    width: 100%;
}

.filter-btn.active {
    font-weight: bold;
    border-bottom: 3px solid #0d6efd;
    border-radius: 0;
    background-color: transparent !important;
    color: #0d6efd !important;
}

.filter-btn {
    color: #6c757d;
    border: none;
    background: transparent;
    padding: 8px 16px;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

@media (max-width: 767.98px) {
    .actions-top {
        flex-wrap: wrap;
        width: 100%;
    }

    .search-group {
        width: 100% !important;
    }

    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}

.login-body {
    background-color: #f4f6f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 30px 20px;
    }
}

.cell-tags {
    white-space: normal !important;
    line-height: 1.2;
}

.badge-tag {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    margin-bottom: 2px;
}

.badge-tag:hover {
    background-color: var(--bs-primary);
    color: #ffffff;
    border-color: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--bs-primary-rgb), 0.3);
}

.status-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

.badge-social {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    margin: 2px 2px;
    white-space: nowrap;
    color: #fff;
    transition: all 0.2s ease;
}

.badge-social:hover {
    opacity: 0.85;
    text-decoration: none;
    color: #fff !important;
}

.lead-modal-layout {
    display: flex;
    height: 100vh;
    background-color: #f8f9fa;
}

.lead-sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--bs-primary);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.lead-sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lead-sidebar-brand i {
    font-size: 1.2rem;
}

.lead-sidebar-nav {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lead-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.lead-nav-item i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.lead-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.lead-nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
}

.lead-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lead-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.75rem;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 5;
}

.lead-main-title {
    margin: 0;
    font-weight: 700;
    color: #212529;
    font-size: 1.05rem;
}

.lead-main-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lead-main-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem 3rem;
}

.lead-hero {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.lead-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.lead-hero-main {
    min-width: 0;
}

.lead-hero-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 0.25rem;
    width: 100%;
}

.lead-hero-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    min-height: 28px;
}

.lead-hero-contact {
    text-align: right;
    font-size: 0.85rem;
    color: #495057;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lead-hero-contact>div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.lead-hero-rating {
    color: #f59e0b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lead-hero-rating .rating-count {
    color: #6c757d;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.lead-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.lead-grid-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (max-width: 991.98px) {
    .lead-sections-grid {
        grid-template-columns: 1fr;
    }
}

.lead-section {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    scroll-margin-top: 1rem;
}

.lead-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
}

.grid-span-2 {
    grid-column: span 2;
}

@media (max-width: 767.98px) {
    .lead-fields-grid {
        grid-template-columns: 1fr;
    }

    .grid-span-2 {
        grid-column: span 1;
    }
}

.lead-section.empty {
    display: none;
}

.lead-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid #f1f3f5;
    font-weight: 700;
    color: #212529;
    font-size: 0.95rem;
}

.lead-section-header i {
    color: var(--bs-primary);
    font-size: 1.1rem;
}

.lead-field {
    margin-bottom: 0.75rem;
}

.lead-field:last-child {
    margin-bottom: 0;
}

.lead-field-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.lead-field-value {
    font-size: 0.85rem;
    color: #1e293b;
    word-break: break-word;
}

.lead-field-value.readonly {
    color: #334155;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ---------- Inline-editable inputs ---------- */
.lead-input,
.lead-textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: #1e293b;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.lead-input:hover,
.lead-textarea:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.lead-input:focus,
.lead-textarea:focus {
    outline: none;
    border-color: #64748b;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}

.lead-textarea {
    min-height: 60px;
    resize: vertical;
}

.lead-hero-name.lead-input {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    background-color: transparent;
    border-color: transparent;
}

.lead-hero-name.lead-input:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.lead-hero-name.lead-input:focus {
    background-color: #fff;
    border-color: #64748b;
}

.lead-hero-tags {
    padding: 0.2rem 0.5rem;
    border: 1px dashed transparent;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.lead-hero-tags:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.lead-team-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lead-team-member {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.lead-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.lead-team-info {
    min-width: 0;
}

.lead-team-name {
    font-weight: 600;
    color: #212529;
}

.lead-team-role {
    font-size: 0.75rem;
    color: #6c757d;
}

.lead-section-action {
    margin-top: 0.5rem;
}

@media (max-width: 991.98px) {
    .lead-sections-grid {
        grid-template-columns: 1fr;
    }

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

    .lead-hero-contact {
        grid-column: 1 / -1;
        text-align: left;
    }

    .lead-hero-contact>div {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .lead-sidebar {
        width: 64px;
    }

    .lead-sidebar-brand span,
    .lead-nav-item span {
        display: none;
    }

    .lead-nav-item {
        justify-content: center;
    }
}