:root {
    --cc-primary:      #2980b9;
    --cc-primary-hover: #2471a3;
    --cc-black:        #2c3340;
    --cc-dark:         #3d4a5c;
    --cc-gray:         #6b7280;
    --cc-light-gray:   #f3f4f6;
    --cc-surface:      #f7f8fa;
    --cc-border:       #d0d6de;
    --cc-white:        #ffffff;
    --cc-text:         #2c3340;
    --cc-header-height: 70px;
    --cc-button-height: 30px;
    --cc-button-radius: 0.375rem;
    --cc-button-gap: 0.35rem;
}

/* ── General ── */
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--cc-black);
    background: var(--cc-white);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Header privado ── */
.cc-header {
    height: var(--cc-header-height);
    background: var(--cc-surface);
    border-bottom: 1.5px solid var(--cc-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* ── Brand: logo + CLOUD ── */
.cc-header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    margin-right: 1.5rem;
    line-height: 1;
}

.cc-header-brand .cc-logo {
    height: 42px;
}

.cc-header-cloud {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: var(--cc-gray);
    margin-top: 2px;
}

/* ── Header titulo ── */
.cc-header-title {
    flex: 1;
}

/* ── Navegación pública en header privado ── */
.cc-header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cc-header-nav a {
    color: var(--cc-gray);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.cc-header-nav a:hover {
    color: var(--cc-primary);
    background: #f0f6fb;
}

.cc-header-nav a.active,
.cc-header-nav a[aria-current="page"] {
    color: var(--cc-primary);
    background: #edf6fc;
    font-weight: 700;
}

/* ── Header usuario ── */
.cc-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Header publico ── */
.cc-public-header {
    height: var(--cc-header-height);
    background: var(--cc-white);
    border-bottom: 2px solid var(--cc-black);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.cc-public-header .cc-logo {
    height: 42px;
    margin-right: auto;
}

.cc-public-header nav a {
    color: var(--cc-black);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.cc-public-header nav a:hover {
    color: var(--cc-gray);
}

.cc-public-content {
    margin-top: var(--cc-header-height);
}

/* ── Layout privado ── */
.cc-app-wrapper {
    margin-top: var(--cc-header-height);
    display: flex;
    background: var(--cc-light-gray);
    min-height: calc(100vh - var(--cc-header-height));
}

.cc-app-content {
    position: relative;
    padding: 1.5rem;
    flex: 1;
    min-height: calc(100vh - var(--cc-header-height));
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── Botones comunes de la aplicación ─────────────────────────────────────
   Bootstrap define las variantes semánticas. Confidat fija aquí la geometría
   compartida de los botones compactos usados en herramientas y modales. */
.cc-app-content .btn-sm,
.modal .btn-sm,
.cc-toolbar-actions .btn {
    min-height: var(--cc-button-height);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--cc-button-gap);
    padding: 0.25rem 0.65rem;
    border-radius: var(--cc-button-radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* Compatibilidad temporal de altura mientras los botones DevExtreme antiguos
   de las barras de herramientas se migran progresivamente a Bootstrap. */
.cc-toolbar-actions .dx-button {
    height: var(--cc-button-height);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

/* ── Hero ── */
.cc-hero {
    background: var(--cc-light-gray);
    color: var(--cc-black);
    padding: 6rem 2rem 4rem;
    text-align: center;
    border-bottom: 1px solid var(--cc-border);
}

.cc-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cc-hero p {
    font-size: 1.2rem;
    color: var(--cc-gray);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ── Botones ── */
.cc-btn-primary {
    background: var(--cc-black);
    color: var(--cc-white);
    border: 2px solid var(--cc-black);
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.cc-btn-primary:hover {
    background: var(--cc-white);
    color: var(--cc-black);
}

/* ── Secciones ── */
.cc-section {
    padding: 4rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.cc-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--cc-black);
    padding-bottom: 0.5rem;
}

/* ── Cards ── */
.cc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.cc-card {
    background: var(--cc-white);
    border: 1px solid var(--cc-border);
    padding: 1.5rem;
    border-top: 3px solid var(--cc-black);
    height: 100%;            /* ← hereda la altura del ítem de grid */
    box-sizing: border-box;  /* ← el padding no desborda la altura */
}

.cc-cards .cc-card,
.cc-cards .cc-card * {
    cursor: pointer;
}

.cc-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cc-card p {
    color: var(--cc-gray);
    font-size: 0.95rem;
}

/* ── Footer ── */
.cc-footer {
    background: var(--cc-light-gray);
    color: var(--cc-gray);
    border-top: 1px solid var(--cc-border);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
}

/* ── Link Recarga ── */
.cc-link-recarga {
    display: inline-block;
    background: var(--cc-primary);
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Hamburger del menú público dentro del header privado (oculto en escritorio) ── */
.cc-nav-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--cc-black);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
}

.cc-nav-hamburger:hover {
    background: var(--cc-light-gray);
}

/* ── Responsive: móvil ── */
@media (max-width: 640px) {
    .cc-header {
        padding: 0 0.6rem;
        gap: 0.4rem;
    }

    /* Logo centrado entre los botones de la izquierda (menú) y la derecha (usuario/login) */
    .cc-header-brand {
        order: 2;
        margin: 0 auto;
    }

        .cc-header-brand .cc-logo {
            height: 32px;
        }

    .cc-nav-hamburger {
        order: 1;
        display: block;
    }

    .cc-header-nav {
        order: 4;
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: var(--cc-header-height);
        left: 0;
        right: 0;
        background: var(--cc-surface);
        border-bottom: 1.5px solid var(--cc-border);
        padding: 0.75rem;
        gap: 0.25rem;
        z-index: 999;
    }

        .cc-header-nav.open {
            display: flex;
        }

        .cc-header-nav a {
            padding: 0.6rem 0.75rem;
        }

        .cc-header-user {
        order: 3;
        gap: 0.4rem;
    }

    /* ── Botón "Iniciar sesión" (usuario no autenticado): solo icono en móvil ── */
    .cc-header-user .cc-nav-btn-outline {
        padding: 0.38rem 0.6rem !important;
    }

        .cc-header-user .cc-nav-btn-outline .cc-login-text {
            display: none;
        }

        .cc-header-user .cc-nav-btn-outline span:first-child {
            margin-right: 0 !important;
        }

    /* ── DropDownButtons de cabecera (Mi Sesión / Usuario): solo icono en móvil ── */
    .cc-header-user .dx-dropdownbutton .dx-button-text {
        display: none;
    }

    .cc-header-user .dx-dropdownbutton .dx-icon {
        margin: 0 !important;
    }

    .cc-header-user .dx-dropdownbutton .dx-button-content {
        padding-left: 0.5rem !important;
        padding-right: 0.35rem !important;
    }

    .cc-app-content {
        padding: 1rem;
    }

    .cc-cards {
        grid-template-columns: 1fr;
    }
}
