/* ================================================================
   Shipo — Dashboard "Inicio" (panel de control personal)
   Mantiene la paleta y el lenguaje visual existentes de Shipo.
   ================================================================ */

#dashboard_page {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    visibility: visible;
    background: #0d0f14;
    overflow: hidden;
}

/* Cuando el dashboard "Inicio" está activo, el topnav es redundante
   (el propio grid del dashboard navega a todos los módulos). Se oculta
   solo en este estado y el dashboard pasa a ocupar toda la altura. */
body.dash-focus .topnav {
    display: none;
}
body.dash-focus #dashboard_page {
    top: 0;
}

.dash_root {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #0d0f14;
    color: #c8d6e5;
    overflow: hidden;
}

.dash_scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 22px 40px;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 184, 232, 0.35) transparent;
}

.dash_inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* ------------------------------ Cabecera ------------------------------ */

.dash_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.dash_welcome {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.dash_avatar {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: cover;
    background: #13161d;
    border: 1px solid rgba(77, 184, 232, 0.35);
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.dash_avatar:hover,
.dash_avatar:focus-visible {
    border-color: #4db8e8;
    transform: scale(1.05);
}

.dash_welcome h1 {
    margin: 0 0 3px;
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash_welcome p {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(200, 214, 229, 0.55);
}

.dash_actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash_customize_btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid rgba(77, 184, 232, 0.35);
    border-radius: 10px;
    background: #13161d;
    color: #c8d6e5;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dash_customize_btn:hover {
    background: #1a2130;
    border-color: #4db8e8;
}

.dash_customize_btn.active {
    background: rgba(77, 184, 232, 0.16);
    border-color: #4db8e8;
    color: #ffffff;
}

/* ------------------------------ Secciones ------------------------------ */

.dash_section {
    margin-bottom: 26px;
}

.dash_section_title {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(200, 214, 229, 0.55);
}

.dash_section_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash_section_head .dash_section_title {
    margin: 0;
}

.dash_reopen_all {
    border: 1px solid rgba(77, 184, 232, 0.35);
    background: rgba(77, 184, 232, 0.12);
    color: #4db8e8;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}

.dash_reopen_all:hover {
    background: rgba(77, 184, 232, 0.22);
}

/* ------------------------------ Continuar ------------------------------ */

.dash_continue_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.dash_continue_card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 34px 14px 15px;
    border: 1px solid rgba(77, 184, 232, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg, #13161d 0%, #1a2130 100%);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.dash_continue_card:hover {
    transform: translateY(-2px);
    border-color: #4db8e8;
    background: linear-gradient(135deg, #161b26 0%, #1e2736 100%);
}

.dash_continue_icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 184, 232, 0.14);
    color: #4db8e8;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.dash_continue_meta {
    min-width: 0;
}

.dash_continue_label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash_continue_sub {
    font-size: 0.74rem;
    color: rgba(200, 214, 229, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash_continue_close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(200, 214, 229, 0.6);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dash_continue_close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

/* ------------------------------ Módulos ------------------------------ */

.dash_modules_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.dash_module {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 15px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: #13161d;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
    user-select: none;
}

.dash_module:hover {
    transform: translateY(-2px);
    border-color: rgba(77, 184, 232, 0.5);
    background: #171c27;
}

.dash_module.dragging {
    opacity: 0.45;
    border-style: dashed;
    border-color: #4db8e8;
}

.dash_module_icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 184, 232, 0.12);
    color: #4db8e8;
    font-size: 1.05rem;
}

.dash_module_label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e8edf3;
}

/* Controles de personalización (visibles sólo en modo edición) */
.dash_module_edit {
    position: absolute;
    top: 8px;
    right: 8px;
    display: none;
    gap: 4px;
}

#dashboard_page.dash_editing .dash_module_edit {
    display: flex;
}

#dashboard_page.dash_editing .dash_module {
    cursor: default;
}

.dash_edit_btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #c8d6e5;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.dash_edit_btn:hover {
    background: rgba(77, 184, 232, 0.18);
    border-color: #4db8e8;
    color: #ffffff;
}

.dash_edit_btn.eye-off {
    color: rgba(200, 214, 229, 0.4);
}

/* ------------------------------ Estado vacío ------------------------------ */

.dash_empty {
    padding: 18px 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: rgba(200, 214, 229, 0.55);
    font-size: 0.82rem;
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 640px) {
    #dashboard_page {
        top: 36px;
    }

    .dash_scroll {
        padding: 14px 12px 24px;
    }

    .dash_head {
        margin-bottom: 12px;
    }

    .dash_avatar {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .dash_welcome h1 {
        font-size: 1.12rem;
    }

    .dash_continue_grid {
        grid-template-columns: 1fr;
    }

    .dash_modules_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .dash_module {
        padding: 13px 12px;
        gap: 8px;
    }
}

/* ------------------------------ Tema claro ------------------------------ */

html[data-theme="light"] #dashboard_page,
html[data-theme="light"] .dash_root {
    background: #f5f7fa;
    color: #1a2d42;
}

html[data-theme="light"] .dash_avatar {
    background: #e8ecf0;
    border-color: #d0d8e4;
}

html[data-theme="light"] .dash_welcome h1 {
    color: #1a2d42;
}

html[data-theme="light"] .dash_welcome p {
    color: rgba(26, 45, 66, 0.6);
}

html[data-theme="light"] .dash_customize_btn {
    background: #ffffff;
    border-color: #d0d8e4;
    color: #1a2d42;
}

html[data-theme="light"] .dash_customize_btn:hover {
    background: #e8ecf0;
    border-color: #1565c0;
}

html[data-theme="light"] .dash_customize_btn.active {
    background: rgba(21, 101, 192, 0.12);
    border-color: #1565c0;
    color: #0d47a1;
}

html[data-theme="light"] .dash_section_title {
    color: rgba(26, 45, 66, 0.55);
}

html[data-theme="light"] .dash_reopen_all {
    border-color: #d0d8e4;
    background: rgba(21, 101, 192, 0.08);
    color: #1565c0;
}

html[data-theme="light"] .dash_continue_card {
    background: linear-gradient(135deg, #ffffff 0%, #eef2f7 100%);
    border-color: #d0d8e4;
}

html[data-theme="light"] .dash_continue_card:hover {
    background: linear-gradient(135deg, #ffffff 0%, #e4ecf5 100%);
    border-color: #1565c0;
}

html[data-theme="light"] .dash_continue_icon {
    background: rgba(21, 101, 192, 0.12);
    color: #1565c0;
}

html[data-theme="light"] .dash_continue_label {
    color: #1a2d42;
}

html[data-theme="light"] .dash_continue_sub {
    color: rgba(26, 45, 66, 0.55);
}

html[data-theme="light"] .dash_continue_close {
    background: rgba(26, 45, 66, 0.08);
    color: rgba(26, 45, 66, 0.55);
}

html[data-theme="light"] .dash_continue_close:hover {
    background: rgba(26, 45, 66, 0.14);
    color: #1a2d42;
}

html[data-theme="light"] .dash_module {
    background: #ffffff;
    border-color: #d0d8e4;
}

html[data-theme="light"] .dash_module:hover {
    background: #eef2f7;
    border-color: #1565c0;
}

html[data-theme="light"] .dash_module_label {
    color: #1a2d42;
}

html[data-theme="light"] .dash_edit_btn {
    background: rgba(26, 45, 66, 0.06);
    border-color: #d0d8e4;
    color: #1a2d42;
}

html[data-theme="light"] .dash_edit_btn:hover {
    background: rgba(21, 101, 192, 0.12);
    border-color: #1565c0;
    color: #0d47a1;
}

html[data-theme="light"] .dash_edit_btn.eye-off {
    color: rgba(26, 45, 66, 0.4);
}

html[data-theme="light"] .dash_empty {
    border-color: #d0d8e4;
    color: rgba(26, 45, 66, 0.55);
}
