/* App layout overrides */

.app-logo {
    display: block;
    object-fit: contain;
}

.app-logo-default {
    height: 2rem;
    width: auto;
    max-width: 9.5rem;
}

.app-logo-custom {
    height: 2.25rem;
    width: auto;
    max-width: 11rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    float: none;
    padding: 0;
}

.auth-brand .app-logo-auth,
.app-logo-auth {
    display: block;
    height: 4.5rem;
    width: auto;
    max-width: 18rem;
    object-fit: contain;
}

.permission-group-card .list-group-item {
    cursor: pointer;
}

.permission-group-card .list-group-item:hover {
    background-color: var(--tblr-bg-surface-secondary);
}

.permission-group-card .form-check-input {
    margin-top: 0;
}

#settings-tabs .list-group-header {
    padding: 0.75rem 1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface);
}

.layout-fluid .navbar > .container-fluid,
.layout-fluid .navbar .container-fluid {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    .layout-fluid .navbar > .container-fluid,
    .layout-fluid .navbar .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Select2 + Tabler */
.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.4285714286em + 0.875rem + calc(var(--tblr-border-width) * 2));
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    margin-top: 0.2rem;
}

/* Wider searchable filter dropdowns (open menu) */
.select2-dropdown.select2-dropdown-expanded,
.select2-container--open .select2-dropdown-expanded {
    min-width: 320px !important;
    width: 320px !important;
    max-width: min(480px, 94vw) !important;
}
.select2-container--open:has(.select2-dropdown-expanded) {
    min-width: 320px !important;
    z-index: 3000 !important;
}
.select2-dropdown-expanded .select2-results__options {
    max-height: 420px !important;
}
.select2-dropdown-expanded .select2-results__option {
    white-space: normal;
    line-height: 1.35;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.select2-dropdown-expanded .select2-search__field {
    width: 100% !important;
}

/* Guided tour (keep in main CSS so overlay never paints unstyled) */
.crm-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.crm-tour-overlay.is-ready {
    opacity: 1;
}
.crm-tour-hole {
    position: fixed;
    border-radius: 0.65rem;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
    transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
    pointer-events: none;
}
.crm-tour-target {
    position: relative;
    z-index: 2001 !important;
    box-shadow: 0 0 0 3px rgba(6, 111, 209, 0.55);
    border-radius: 0.5rem;
}
.crm-tour-panel {
    position: fixed;
    z-index: 2002;
    width: min(360px, calc(100vw - 1.5rem));
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid rgba(32, 107, 196, 0.14);
    border-radius: 0.85rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    padding: 1rem 1.05rem 0.95rem;
    pointer-events: auto;
}
.crm-tour-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.crm-tour-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tblr-secondary, #667382);
    margin-bottom: 0.15rem;
}
.crm-tour-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}
.crm-tour-stepcount {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--tblr-secondary, #667382);
    background: rgba(6, 111, 209, 0.08);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}
.crm-tour-content {
    margin: 0 0 0.9rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--tblr-secondary, #667382);
}
.crm-tour-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.crm-tour-nav {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
}

/* Shared lead-flow columns (dashboard + campaign board) */
.lead-flow-dashboard,
.lead-flow-campaign {
    --lf-blue: #dbeafe;
    --lf-blue-strong: #1d4ed8;
    --lf-yellow: #fef3c7;
    --lf-yellow-strong: #ca8a04;
    --lf-green: #dcfce7;
    --lf-green-strong: #15803d;
    --lf-red: #fee2e2;
    --lf-red-strong: #dc2626;
    --lf-navy: #1e3a5f;
}

.lead-flow-columns {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.lead-flow-arrow {
    display: flex;
    align-items: center;
    color: #94a3b8;
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.lead-flow-column {
    flex: 1 1 0;
    min-width: 240px;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
    min-height: 28rem;
}

.lead-flow-column.theme-blue { background: var(--lf-blue); }
.lead-flow-column.theme-yellow { background: var(--lf-yellow); }
.lead-flow-column.theme-green { background: var(--lf-green); }
.lead-flow-column.theme-red { background: var(--lf-red); }

.lead-flow-column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}

.lead-flow-column-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.lead-flow-step {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex: 0 0 auto;
}

.theme-blue .lead-flow-step { background: var(--lf-blue-strong); }
.theme-yellow .lead-flow-step { background: var(--lf-yellow-strong); }
.theme-green .lead-flow-step { background: var(--lf-green-strong); }
.theme-red .lead-flow-step { background: var(--lf-red-strong); }

.lead-flow-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}

.theme-blue .lead-flow-icon { background: var(--lf-blue-strong); }
.theme-yellow .lead-flow-icon { background: var(--lf-yellow-strong); }
.theme-green .lead-flow-icon { background: var(--lf-green-strong); }
.theme-red .lead-flow-icon { background: var(--lf-red-strong); }

.lead-flow-column-title {
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.92rem;
    line-height: 1.2;
    color: #0f172a;
}

.lead-flow-column-total {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.theme-blue .lead-flow-column-total { color: var(--lf-blue-strong); }
.theme-yellow .lead-flow-column-total { color: var(--lf-yellow-strong); }
.theme-green .lead-flow-column-total { color: var(--lf-green-strong); }
.theme-red .lead-flow-column-total { color: var(--lf-red-strong); }

.lead-flow-column-body {
    padding: 0.35rem 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.lead-flow-status-card,
.lead-flow-lead-card {
    display: block;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.04);
    transition: transform .15s ease, box-shadow .15s ease;
}

.lead-flow-status-card:hover,
.lead-flow-lead-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.lead-flow-status-count {
    font-weight: 800;
    color: #0f172a;
}

.theme-blue .lead-flow-status-count { color: var(--lf-blue-strong); }
.theme-yellow .lead-flow-status-count { color: var(--lf-yellow-strong); }
.theme-green .lead-flow-status-count { color: var(--lf-green-strong); }
.theme-red .lead-flow-status-count { color: var(--lf-red-strong); }

.lead-flow-status-desc {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
}

.lead-flow-lead-card {
    margin: 0;
    cursor: default;
}

.lead-flow-lead-card.sortable-ghost {
    opacity: .4;
}

.lead-flow-lead-card.sortable-chosen {
    cursor: grabbing;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.lead-flow-drag-handle {
    cursor: grab;
    color: #64748b;
}

.lead-flow-drag-handle:active,
.lead-flow-lead-card.sortable-chosen .lead-flow-drag-handle {
    cursor: grabbing;
}

.lead-flow-empty {
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.55);
    color: #64748b;
    font-size: 0.82rem;
    text-align: center;
    padding: 1.25rem 0.75rem;
}

@media (max-width: 768px) {
    .lead-flow-arrow { display: none; }
}

.lead-flow-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
}

.lead-flow-metric {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    min-height: 5rem;
}

.lead-flow-metric.metric-primary {
    background: var(--lf-navy);
    border-color: var(--lf-navy);
    color: #fff;
}

.lead-flow-metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.metric-primary .lead-flow-metric-icon {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.lead-flow-metric-label {
    font-size: 0.8rem;
    color: #64748b;
}

.metric-primary .lead-flow-metric-label {
    color: rgba(255,255,255,.78);
}

.lead-flow-metric-value {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
}

.metric-primary .lead-flow-metric-value {
    color: #fff;
}

@media (max-width: 1200px) {
    .lead-flow-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .lead-flow-metrics {
        grid-template-columns: 1fr;
    }
}

.page-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-filters .select2-container {
    width: 100% !important;
}

.dashboard-filters .select2-selection {
    min-height: 2.5rem;
}


