/**
 * Nanban CRM — bento list UI (students vs enquiries)
 */

#listSection .nb-crm-hero {
    margin-bottom: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    border: 1px solid rgba(28, 25, 23, 0.1);
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(28, 25, 23, 0.06);
}

#listSection .nb-crm-hero__eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #dc2626;
    margin-bottom: 6px;
}

#listSection .nb-crm-hero__title {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0c0a09;
}

#listSection .nb-crm-hero__sub {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
    max-width: 52rem;
}

#listMgmtSubnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

#listMgmtSubnav .list-mgmt-subtab {
    border: 1px solid rgba(28, 25, 23, 0.12);
    background: #ffffff;
    color: #4b5563;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#listMgmtSubnav .list-mgmt-subtab--active {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.25);
    color: #b91c1c;
}

#listMgmtSubnav .list-mgmt-subtab[data-mgmt-view="enquiries"].list-mgmt-subtab--active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
}

#listSection .list-filter-shell.nb-crm-filter-shell {
    background: #ffffff !important;
    border: 1px solid rgba(28, 25, 23, 0.12) !important;
    border-radius: 16px !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 2px 12px rgba(28, 25, 23, 0.06) !important;
    margin-bottom: 1.25rem !important;
}

#listSection .list-filter-shell.nb-crm-filter-shell::before {
    display: none !important;
}

#listSection .nb-crm-search-row input,
#listSection .nb-crm-filter-shell select,
#listSection #enquiryMgmtToolbar select {
    background: #ffffff !important;
    border: 1px solid rgba(28, 25, 23, 0.14) !important;
    color: #1c1917 !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

#listSection #studentCountBadge {
    background: #f5f5f4 !important;
    border: 1px solid rgba(28, 25, 23, 0.1) !important;
    color: #374151 !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

#listSection .nb-student-date-range {
    background: #fafaf9 !important;
    border: 1px solid rgba(28, 25, 23, 0.12) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    box-shadow: none;
}

#listSection .nb-student-date-range__label {
    font-size: 12px;
    font-weight: 800;
    color: #374151;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

#listSection .nb-student-date-range__sep {
    font-weight: 800;
    color: #6b7280;
}

#listSection .nb-student-date-range input[type="date"] {
    flex: 1 1 120px;
    min-width: 0;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 1px solid rgba(28, 25, 23, 0.14) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #1c1917 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer;
    outline: none;
    color-scheme: light;
}

#listSection .nb-student-export-pdf-btn {
    min-height: 48px;
    font-weight: 800 !important;
    border-radius: 12px !important;
    white-space: nowrap;
}

#listSection #enquiryMgmtToolbar {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(129, 140, 248, 0.2);
    background: rgba(99, 102, 241, 0.08);
}

.nb-crm-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 16px;
    align-items: start;
}

.nb-crm-card {
    border-radius: 16px;
    border: 1px solid rgba(28, 25, 23, 0.12);
    background: #ffffff;
    padding: 1.25rem 1.35rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.05);
}

.nb-crm-card:hover {
    border-color: rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(28, 25, 23, 0.08);
}

.nb-crm-btn--danger {
    background: rgba(220, 38, 38, 0.92) !important;
    border: 1px solid rgba(248, 113, 113, 0.55) !important;
    color: #fff !important;
    font-weight: 800;
}

.nb-crm-btn--danger:hover {
    background: #dc2626 !important;
}

.nb-crm-card--student.nb-crm-row--active {
    border-left: 3px solid rgba(34, 211, 238, 0.55);
}

.nb-crm-card--student.nb-crm-row--follow {
    border-left: 3px solid rgba(251, 191, 36, 0.55);
}

.nb-crm-card--student.nb-crm-row--hold {
    border-left: 3px solid rgba(161, 161, 170, 0.45);
}

.nb-crm-card--lead.nb-crm-row--follow,
.nb-crm-card--lead .nb-crm-pill--due {
    border-left: 3px solid rgba(251, 191, 36, 0.55);
}

.nb-crm-card--lead.nb-crm-row--cold {
    border-left: 3px solid rgba(113, 113, 122, 0.5);
    opacity: 0.92;
}

.nb-crm-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.nb-crm-card__name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0c0a09 !important;
    text-transform: capitalize;
    cursor: pointer;
}

.nb-crm-card__phone {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.nb-crm-card__service {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-align: right;
    max-width: 42%;
}

.nb-crm-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(28, 25, 23, 0.1);
    color: #374151;
    background: #f5f5f4;
    white-space: nowrap;
}

.nb-crm-pill--due {
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.3);
    background: #fffbeb;
}

.nb-crm-pill--lost {
    color: #a1a1aa;
}

.nb-crm-card__meta,
.nb-crm-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.nb-crm-meta-chip {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f5f5f4;
    border: 1px solid rgba(28, 25, 23, 0.08);
}

.nb-crm-meta-chip--due {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.25);
}

.nb-crm-meta-chip--cold {
    color: #d4d4d8;
}

.nb-crm-bento-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.nb-crm-stat {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fafaf9;
    border: 1px solid rgba(28, 25, 23, 0.08);
}

.nb-crm-stat__lbl {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 4px;
}

.nb-crm-stat__val {
    font-size: 15px;
    font-weight: 800;
    color: #0c0a09;
    font-variant-numeric: tabular-nums;
}

.nb-crm-stat--ok {
    color: #6ee7b7;
}

.nb-crm-stat--warn {
    color: #fcd34d;
}

.nb-crm-journey {
    position: relative;
    height: 28px;
    margin-bottom: 12px;
    background: #f5f5f4;
    border: 1px solid rgba(28, 25, 23, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.nb-crm-journey__bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(99, 102, 241, 0.45));
    border-radius: 999px;
}

.nb-crm-journey__steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 4px 10px;
    z-index: 1;
}

.nb-crm-journey__dot {
    font-size: 9px;
    font-weight: 800;
    color: #71717a;
}

.nb-crm-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nb-crm-btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(28, 25, 23, 0.12);
    background: #ffffff;
    color: #374151;
    cursor: pointer;
}

.nb-crm-btn--primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: transparent;
    color: #ffffff;
}

.nb-crm-btn:hover {
    filter: brightness(1.08);
}

.nb-crm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    border-radius: 16px;
    border: 2px dashed rgba(28, 25, 23, 0.12);
    background: linear-gradient(180deg, #fafaf9, #ffffff);
}

.nb-crm-empty__title {
    font-size: 18px;
    font-weight: 800;
    color: #0c0a09;
    margin-bottom: 8px;
}

.nb-crm-empty__sub {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .nb-crm-bento-grid,
    #dashboard-kpis.bento-grid,
    .dashboard-container .dash-grid,
    body.nanban-pro-app #mainApp #nbAppMain .nb-crm-bento-grid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .nb-crm-bento-stats {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .nb-crm-bento-stats .nb-crm-stat {
        width: 100% !important;
        max-width: 100% !important;
        grid-column: auto !important;
    }

    .card,
    .metric-card,
    .dashboard-card,
    .nb-crm-stat,
    .nb-crm-bento-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .form-section,
    .bento-buttons {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }

    #listSection .nb-crm-hero {
        padding: 1rem 1.15rem;
    }

    #listMgmtSubnav .list-mgmt-subtab {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
        min-width: 0;
    }
}
