/* ===== Shell de la aplicación (barra lateral + barra superior) ===== */
/* Rediseño basado en el artboard "Dashboard" del canvas EDPSE – Rediseño */

.app-shell {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* --- Barra superior --- */
.app-shell .app-topbar {
    border-bottom: 1px solid var(--mud-palette-divider);
}

.app-shell .app-topbar .mud-toolbar {
    gap: 12px;
    padding-left: 32px;
    padding-right: 24px;
}

.app-menu-btn {
    display: none !important;
}

.app-search {
    flex: 1 1 280px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    background: var(--mud-palette-background);
    box-sizing: border-box;
}

.app-search:focus-within {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px rgba(43, 76, 140, 0.15);
}

.app-search-icon {
    color: var(--mud-palette-text-secondary);
}

.app-search input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    width: 100%;
    color: var(--mud-palette-text-primary);
}

.app-search input::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 1;
}

/* --- Barra lateral --- */
.app-shell .app-drawer {
    border-right: 0;
}

.app-drawer-inner {
    min-height: 100%;
    padding: 22px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.app-shell .app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    text-decoration: none;
    color: #FFFFFF;
}

.app-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #C08A2E;
    color: #14213D;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-brand-name {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.04em;
}

.app-brand-sub {
    font-size: 12px;
    color: #9AA6BD;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-nav-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #8995AC;
    padding: 18px 12px 6px;
}

.app-nav-title:first-child {
    padding-top: 0;
}

.app-nav .mud-nav-link {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #C9D2E3;
    white-space: normal;
}

.app-nav .mud-nav-link .mud-nav-link-icon {
    color: inherit;
    font-size: 20px;
}

.app-nav .mud-nav-link .mud-nav-link-text {
    margin-left: 12px;
    font-weight: 600;
}

.app-nav .mud-nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
}

.app-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: #2B4C8C;
    color: #FFFFFF;
}

.app-nav .mud-nav-link:focus-visible {
    outline: 2px solid #E2B865;
    outline-offset: 1px;
}

.app-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: #1C2C4F;
}

.app-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #C08A2E;
    color: #14213D;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.app-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.app-user-name {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-role {
    font-size: 12px;
    color: #9AA6BD;
}

.app-shell .app-user-logout {
    color: #C9D2E3;
}

.app-shell .app-user-logout:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Contenido --- */
.app-shell .app-main {
    min-height: 100vh;
    background: var(--mud-palette-background);
}

.content-wrapper {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --- Responsive --- */
@media (max-width: 959.98px) {
    .app-menu-btn {
        display: inline-flex !important;
    }

    .app-shell .app-topbar .mud-toolbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-wrapper {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .content-wrapper {
        padding: 16px 12px;
    }
}
