@import url("https://fonts.googleapis.com/css2?family=Handlee&family=Nunito:wght@300;400;600;700;800;900&display=swap");

.cr {
    --c-surface: #ffffff;
    --c-surface3: #eeecfb;
    --c-border: rgba(99, 102, 241, 0.13);
    --c-border-s: rgba(99, 102, 241, 0.28);
    --c-text1: #0f0e17;
    --c-text2: #3d3b5c;
    --c-muted: #8e8bac;
    --c-accent: #5b5ef4;
    --c-accent-h: #4643d4;
    --c-accent-gl: rgba(91, 94, 244, 0.18);
    --c-tag-bg: rgba(91, 94, 244, 0.09);
    --c-tag-tx: #4643d4;
    --c-img-bg: #e4e2f8;
    --c-sh: 0 2px 10px rgba(79, 70, 229, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04);
    --c-sh-h:
        0 16px 40px rgba(79, 70, 229, 0.15), 0 4px 14px rgba(0, 0, 0, 0.07);
}

.dark .cr {
    --c-surface: #141320;
    --c-surface3: #211f38;
    --c-border: rgba(129, 140, 248, 0.13);
    --c-border-s: rgba(129, 140, 248, 0.3);
    --c-text1: #eeedf8;
    --c-text2: #aba8cc;
    --c-muted: #6a678a;
    --c-accent: #818cf8;
    --c-accent-h: #a5b4fc;
    --c-accent-gl: rgba(129, 140, 248, 0.22);
    --c-tag-bg: rgba(129, 140, 248, 0.13);
    --c-tag-tx: #a5b4fc;
    --c-img-bg: #22203a;
    --c-sh: 0 2px 14px rgba(0, 0, 0, 0.3);
    --c-sh-h: 0 20px 48px rgba(0, 0, 0, 0.45), 0 6px 18px rgba(0, 0, 0, 0.3);
}

.cr {
    font-family: "Handlee", sans-serif;
    padding: 6px 0 48px;
}

/* ── Alerta sin matrícula ── */
.cr-no-access {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 64px 32px;
    text-align: center;
    background: var(--c-surface);
    border: 1.5px dashed var(--c-border-s);
    border-radius: 16px;
    gap: 12px;
}

.cr-no-access svg {
    width: 52px;
    height: 52px;
    color: var(--c-muted);
    opacity: 0.35;
}

.cr-no-access h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-text2);
    margin: 0;
}

.cr-no-access p {
    font-size: 0.82rem;
    color: var(--c-muted);
    margin: 0;
    max-width: 340px;
}

/* ── Header ── */
.cr-ph {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 38px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
    gap: 14px;
}

.cr-title {
    font-family: "Handlee", sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--c-text1) !important;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
}

.cr-title em {
    color: var(--c-accent) !important;
    font-style: normal;
}

.cr-subtitle {
    font-size: 0.82rem;
    color: var(--c-muted) !important;
    margin: 5px 0 0;
}

.cr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-tag-bg) !important;
    color: var(--c-tag-tx) !important;
    font-size: 0.73rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--c-border-s);
    white-space: nowrap;
}

.cr-badge svg {
    width: 13px;
    height: 13px;
}

/* ── Ciclo ── */
.cr-cycle {
    margin-bottom: 42px;
}

.cr-cycle-hd {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.cr-stripe {
    width: 3px;
    height: 24px;
    border-radius: 4px;
    background: var(--c-accent) !important;
    flex-shrink: 0;
}

.cr-cname {
    font-family: "Handlee", sans-serif;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--c-accent) !important;
}

.cr-ccount {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--c-muted) !important;
}

/* ── Grid ── */
.cr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* ── Card ── */
.cr-card {
    background: var(--c-surface) !important;
    border: 1px solid var(--c-border) !important;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--c-sh);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.2s ease;
    position: relative;
}

.cr-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--c-sh-h);
    border-color: var(--c-border-s) !important;
}

.cr-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--c-accent) 0%, transparent 100%);
    transform: scaleX(0);
    transform-origin: left;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.3s ease;
    z-index: 1;
}

.cr-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

/* ── Imagen ── */
.cr-img {
    height: 152px;
    overflow: hidden;
    background: var(--c-img-bg) !important;
    flex-shrink: 0;
}

.cr-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cr-card:hover .cr-img img {
    transform: scale(1.05);
}

.cr-img-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface3) !important;
}

.cr-img-ph svg {
    width: 38px;
    height: 38px;
    color: var(--c-accent) !important;
    opacity: 0.28;
}

/* ── Card body ── */
.cr-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--c-surface) !important;
}

.cr-tag {
    display: inline-flex;
    align-items: center;
    background: var(--c-tag-bg) !important;
    color: var(--c-tag-tx) !important;
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 9px;
    border-radius: 100px;
    margin-bottom: 10px;
    width: fit-content;
}

.cr-name {
    font-family: "Handlee", sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c-text1) !important;
    margin: 0 0 8px;
    line-height: 1.28;
}

.cr-desc {
    font-size: 0.79rem;
    color: var(--c-text2) !important;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 18px;
}

/* ── Botón ── */
.cr-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--c-accent) !important;
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: 0.81rem;
    font-weight: 500;
    font-family: "Handlee", sans-serif;
    transition:
        background 0.18s ease,
        transform 0.15s ease,
        box-shadow 0.18s ease;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--c-accent-gl);
}

.cr-btn:hover {
    background: var(--c-accent-h) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--c-accent-gl);
    text-decoration: none !important;
}

.cr-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.cr-btn:hover svg {
    transform: translateX(2px);
}

@media (max-width: 600px) {
    .cr-ph {
        flex-direction: column;
        align-items: flex-start;
    }

    .cr-grid {
        grid-template-columns: 1fr;
    }

    .cr-title {
        font-size: 1.45rem;
    }
}

/* Contenedor Principal */
.cr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    background-color: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
}

/* Contenedor del Icono (Círculo sutil) */
.cr-empty-icon-wrapper {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    color: #9ca3af; /* Gris suave */
}

.cr-empty svg {
    width: 4rem;
    height: 4rem;
}

/* Título */
.cr-empty h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

/* Descripción */
.cr-empty p {
    font-size: 0.95rem;
    color: #6b7280;
    max-width: 300px;
    line-height: 1.5;
    margin: 0;
}

/* --- SOPORTE PARA MODO OSCURO --- */
.dark .cr-empty {
    background-color: #111827;
    border-color: #1f2937;
}

.dark .cr-empty-icon-wrapper {
    background-color: rgba(31, 41, 55, 0.5);
    color: #4b5563;
}

.dark .cr-empty h3 {
    color: #ffffff;
}

.dark .cr-empty p {
    color: #9ca3af;
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
    .cr-empty {
        padding: 3rem 1.5rem;
        margin: 1rem 0;
    }
    
    .cr-empty svg {
        width: 3rem;
        height: 3rem;
    }
}
