:root {
    --app-sidebar-width: 292px;
    --app-sidebar-collapsed-width: 76px;
    --app-topbar-height: 64px;
    --app-primary: #168daa;
    --app-primary-dark: #116f87;
    --app-sidebar-bg: #174b59;
    --app-sidebar-border: #2c6471;
    --app-page-bg: #f3f5f7;
    --app-text: #26323d;
}

/* Espaciado compacto en las cuatro pantallas de cuenta. */
body.app-shell-enabled.account-compact-spacing { padding-top: 0; }
body.account-compact-spacing .app-shell-content { padding-top: 16px; }
body.account-compact-spacing .app-content-container .register-user-form,
body.account-compact-spacing .app-content-container .personal-data-card,
body.account-compact-spacing .app-content-container .vehicle-registration { margin-top: 0; }

body.app-shell-enabled {
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    overflow-x: hidden;
    background: var(--app-page-bg);
}

.app-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--app-sidebar-width);
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background: var(--app-sidebar-bg);
    border-right: 1px solid var(--app-sidebar-border);
    transition: width .22s ease, transform .22s ease;
}

.app-sidebar__brand-row {
    display: grid;
    width: 100%;
    min-height: var(--app-topbar-height);
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    background: #175565;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.app-sidebar__brand {
    display: flex;
    min-width: 0;
    min-height: var(--app-topbar-height);
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    color: #fff;
    background: #175565;
    text-decoration: none;
    white-space: nowrap;
}

.app-sidebar__brand:hover,
.app-sidebar__brand:focus {
    color: #fff;
    background: var(--app-primary-dark);
    text-decoration: none;
}

.app-sidebar__brand-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 10px;
    font-size: 1.15rem;
}

.app-sidebar__brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-sidebar__brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.app-sidebar__brand-subtitle {
    margin-top: 3px;
    color: #d7f4fa;
    font-size: .72rem;
    font-weight: 650;
}

.app-sidebar__toggle-host {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    padding-left: 8px;
}
.app-sidebar__toggle-host .app-topbar__toggle {
    color: #fff;
    background: rgba(0, 82, 109, .34);
    border-color: rgba(255, 255, 255, .55);
    flex-shrink: 0;
}
.app-sidebar__toggle-host .app-topbar__toggle:hover,
.app-sidebar__toggle-host .app-topbar__toggle:focus {
    color: #fff;
    background: #00779d;
}
body.app-sidebar-collapsed .app-sidebar__toggle-host {
    flex: 1 1 auto;
    justify-content: center;
    padding-left: 0;
}
body.app-sidebar-collapsed .app-sidebar__brand-row { grid-template-columns: 1fr; }
body.app-sidebar-collapsed .app-sidebar__brand { display: none; }
@media (max-width: 991.98px) {
    .app-sidebar__brand-row { grid-template-columns: minmax(0, 1fr); }
    .app-sidebar__toggle-host { display: none; }
    body.app-sidebar-collapsed .app-sidebar__brand { display: flex; }
}

.app-sidebar__nav {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 9px 18px;
}

.app-sidebar__section-title {
    margin: 12px 10px 7px;
    color: #a9dce7;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-sidebar__link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 13px;
    margin-bottom: 4px;
    padding: 10px 12px;
    color: #e7edf2;
    border-radius: 10px;
    font-size: .92rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.app-sidebar__link:hover,
.app-sidebar__link:focus {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    text-decoration: none;
}

.app-sidebar__link.is-active {
    color: #fff;
    background: var(--app-primary);
    box-shadow: inset 3px 0 0 #eafcff, 0 5px 12px rgba(4, 40, 50, .16);
}

.app-sidebar__icon {
    width: 28px;
    flex: 0 0 28px;
    text-align: center;
    font-size: 1rem;
}

.app-sidebar__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar__footer {
    padding: 12px 18px;
    color: #aeb9c3;
    border-top: 1px solid var(--app-sidebar-border);
    font-size: .84rem;
    white-space: nowrap;
}

.app-topbar {
    position: fixed;
    z-index: 1030;
    top: 0;
    right: 0;
    left: var(--app-sidebar-width);
    display: flex;
    min-height: var(--app-topbar-height);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: #fff;
    border-bottom: 1px solid #dce2e7;
    box-shadow: 0 2px 8px rgba(24, 39, 52, .06);
    transition: left .22s ease;
}

.app-topbar__start,
.app-topbar__account {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-topbar__toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--app-text);
    background: #f4f7f9;
    border: 1px solid #dce3e8;
    border-radius: 8px;
    cursor: pointer;
}

.app-topbar__toggle:hover,
.app-topbar__toggle:focus {
    color: var(--app-primary-dark);
    background: #eaf6fa;
    border-color: #a9d9e8;
}

.app-topbar__title {
    margin: 0;
    color: var(--app-text);
    font-size: 1.08rem;
    font-weight: 700;
}

.app-topbar__context {
    display: block;
    margin-top: 2px;
    color: #74818c;
    font-size: .76rem;
}

.app-topbar__account .text-white {
    color: var(--app-text) !important;
}

.app-topbar__account .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 190px;
}

.app-shell-main {
    display: flex;
    min-height: 100vh;
    margin-left: var(--app-sidebar-width);
    padding-top: var(--app-topbar-height);
    flex-direction: column;
    transition: margin-left .22s ease;
}

.app-shell-content {
    flex: 1 0 auto;
    padding: 24px;
}

.app-content-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.app-shell-footer {
    flex: 0 0 auto;
    padding: 12px 24px 0;
    color: #65727d;
    background: #fff;
    border-top: 1px solid #dce2e7;
}

.app-sidebar-backdrop {
    display: none;
}

body.app-sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-collapsed-width);
}

body.app-sidebar-collapsed .app-topbar {
    left: var(--app-sidebar-collapsed-width);
}

body.app-sidebar-collapsed .app-shell-main {
    margin-left: var(--app-sidebar-collapsed-width);
}

body.app-sidebar-collapsed .app-sidebar__brand-copy,
body.app-sidebar-collapsed .app-sidebar__label,
body.app-sidebar-collapsed .app-sidebar__section-title,
body.app-sidebar-collapsed .app-sidebar__footer-copy {
    visibility: hidden;
    width: 0;
}

body.app-sidebar-collapsed .app-sidebar__brand,
body.app-sidebar-collapsed .app-sidebar__link {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: min(86vw, var(--app-sidebar-width));
        transform: translateX(-100%);
    }

    .app-topbar {
        left: 0;
        padding-right: 14px;
        padding-left: 14px;
    }

    .app-shell-main,
    body.app-sidebar-collapsed .app-shell-main {
        margin-left: 0;
    }

    .app-shell-content {
        padding: 16px 12px;
    }

    .app-sidebar-backdrop {
        position: fixed;
        z-index: 1035;
        inset: 0;
        display: block;
        visibility: hidden;
        background: rgba(13, 25, 35, .48);
        opacity: 0;
        transition: opacity .2s ease, visibility .2s ease;
    }

    body.app-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.app-sidebar-open .app-sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    body.app-sidebar-collapsed .app-sidebar {
        width: min(86vw, var(--app-sidebar-width));
    }

    body.app-sidebar-collapsed .app-sidebar__brand-copy,
    body.app-sidebar-collapsed .app-sidebar__label,
    body.app-sidebar-collapsed .app-sidebar__section-title,
    body.app-sidebar-collapsed .app-sidebar__footer-copy {
        visibility: visible;
        width: auto;
    }

    body.app-sidebar-collapsed .app-sidebar__brand,
    body.app-sidebar-collapsed .app-sidebar__link {
        justify-content: flex-start;
        padding-right: 12px;
        padding-left: 12px;
    }

    .app-topbar__context {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .app-topbar__title {
        max-width: 42vw;
        overflow: hidden;
        font-size: .95rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-topbar__account .dropdown-toggle {
        display: inline-block;
        max-width: 30vw;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-topbar,
    .app-shell-main,
    .app-sidebar-backdrop {
        transition: none;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .app-sidebar-backdrop {
        display: none !important;
    }

    .app-shell-main {
        margin: 0;
        padding: 0;
    }

    .app-shell-content {
        padding: 0;
    }
}

/* Phase 3: grouped navigation and route states */
.app-sidebar__group {
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    border-radius: 0 11px 11px 0;
    transition: background-color .15s ease, border-color .15s ease;
}

.app-sidebar__group.is-open {
    margin-top: 5px;
    margin-bottom: 7px;
    padding: 4px 4px 6px 5px;
    background: rgba(255, 255, 255, .055);
    border-left-color: #35a8bd;
}

.app-sidebar__group > .app-sidebar__link {
    margin-bottom: 0;
}

.app-sidebar__group-toggle {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    color: #e7edf2;
    background-color: transparent;
    font: inherit;
    font-size: .92rem;
    text-align: left;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.app-sidebar__group.is-active > .app-sidebar__group-toggle {
    color: #fff;
    background: rgba(36, 139, 161, .5);
    box-shadow: inset 3px 0 0 #8dd8e8;
}

.app-sidebar__group.is-open > .app-sidebar__group-toggle {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
}

.app-sidebar__chevron {
    margin-left: auto;
    font-size: .72rem;
    transition: transform .18s ease;
}

.app-sidebar__group-toggle[aria-expanded="true"] .app-sidebar__chevron {
    transform: rotate(180deg);
}

.app-sidebar__submenu {
    margin: 5px 0 0 15px;
    padding: 2px 0 2px 13px;
    border-left: 2px solid rgba(141, 216, 232, .62);
}

.app-sidebar__submenu[hidden] {
    display: none;
}

.app-sidebar__submenu-link {
    position: relative;
    display: block;
    margin: 3px 3px 3px 0;
    padding: 8px 10px;
    color: #d0e0e5;
    border-radius: 6px;
    font-size: .82rem;
    line-height: 1.3;
    text-decoration: none;
}

.app-sidebar__submenu-link::before {
    position: absolute;
    top: 50%;
    left: -11px;
    width: 5px;
    height: 5px;
    background: #82919e;
    border-radius: 50%;
    content: "";
    transform: translateY(-50%);
}

.app-sidebar__submenu-link:hover,
.app-sidebar__submenu-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, .09);
    text-decoration: none;
}

.app-sidebar__submenu-link.is-active {
    color: #fff;
    background: #286b7a;
    border-radius: 9px;
    font-weight: 600;
}

.app-sidebar__access-lock {
    float: right;
    margin: .1rem 0 0 .5rem;
    color: #9de4f0;
    font-size: .72rem;
}

.app-sidebar__submenu-link.is-active::before {
    background: #fff;
}

body.app-sidebar-collapsed .app-sidebar__group {
    width: 100%;
}

body.app-sidebar-collapsed .app-sidebar__group.is-open {
    margin: 0 0 4px;
    padding: 0;
    background: transparent;
    border-left-color: transparent;
}

body.app-sidebar-collapsed .app-sidebar__chevron,
body.app-sidebar-collapsed .app-sidebar__submenu {
    display: none !important;
}

body.app-sidebar-collapsed .app-sidebar__group.is-active > .app-sidebar__group-toggle {
    background: var(--app-primary);
    box-shadow: inset 3px 0 0 #fff;
}

@media (max-width: 991.98px) {
    body.app-sidebar-collapsed .app-sidebar__chevron {
        display: inline-block !important;
    }

    body.app-sidebar-collapsed .app-sidebar__submenu:not([hidden]) {
        display: block !important;
    }
}
/* Phase 4: mobile behavior and accessibility */
.app-skip-link {
    position: fixed;
    z-index: 1100;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: #17212b;
    background: #fff;
    border: 2px solid var(--app-primary);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .18s ease;
}

.app-skip-link:focus {
    color: #17212b;
    text-decoration: none;
    transform: translateY(0);
}

.app-sidebar__mobile-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 8px;
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 6px;
    cursor: pointer;
}

.app-sidebar__mobile-close:hover,
.app-sidebar__mobile-close:focus {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.app-sidebar__brand:focus-visible,
.app-sidebar__link:focus-visible,
.app-sidebar__group-toggle:focus-visible,
.app-sidebar__submenu-link:focus-visible,
.app-sidebar__mobile-close:focus-visible,
.app-topbar__toggle:focus-visible,
.app-topbar a:focus-visible {
    outline: 3px solid #9de4f0;
    outline-offset: -3px;
}

.app-shell-content:focus {
    outline: none;
}

@media (max-width: 991.98px) {
    body.app-sidebar-open {
        overflow: hidden;
    }

    .app-sidebar {
        overscroll-behavior: contain;
    }

    .app-sidebar__brand {
        padding-right: 58px;
    }

    .app-sidebar__mobile-close {
        display: inline-flex;
    }

    .app-sidebar__link,
    .app-sidebar__group-toggle,
    .app-sidebar__submenu-link {
        min-height: 44px;
    }

    body.app-sidebar-open .app-sidebar-backdrop {
        touch-action: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-skip-link,
    .app-sidebar__chevron {
        transition: none;
    }
}

@media (forced-colors: active) {
    .app-sidebar__mobile-close,
    .app-sidebar__link.is-active,
    .app-sidebar__submenu-link.is-active {
        border: 1px solid ButtonText;
    }
}
/* Phase 5: legacy content compatibility */
.app-shell-content {
    min-width: 0;
}

.app-content-container,
.app-content-container > * {
    max-width: 100%;
}

.app-shell-content img,
.app-shell-content video,
.app-shell-content iframe {
    max-width: 100%;
}

.app-shell-content img,
.app-shell-content video {
    height: auto;
}

.app-shell-content h1,
.app-shell-content h2,
.app-shell-content h3,
.app-shell-content h4,
.app-shell-content .alert,
.app-shell-content .field-validation-error,
.app-shell-content .validation-summary-errors {
    overflow-wrap: anywhere;
}

.app-shell-content .form-control,
.app-shell-content .custom-select,
.app-shell-content .input-group {
    max-width: 100%;
    min-width: 0;
}

.app-shell-content .input-group > .form-control,
.app-shell-content .input-group > .custom-select {
    min-width: 0;
}

.app-shell-content .input-group-text {
    max-width: 100%;
    white-space: normal;
}

.app-shell-content .btn {
    white-space: normal;
}

.app-table-scroll {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.app-table-scroll > .table {
    width: 100%;
    margin-bottom: 0;
}

.app-table-scroll--wide > .table {
    min-width: 720px;
}

.app-table-scroll.is-scrollable {
    border: 1px solid #dce2e7;
    background: #fff;
}

.app-table-scroll:focus-visible {
    outline: 3px solid var(--app-primary);
    outline-offset: 2px;
}

.app-table-scroll .table th,
.app-table-scroll .table td {
    vertical-align: middle;
}

.app-shell-footer p {
    margin: 0;
}

@media (max-width: 767.98px) {
    .app-shell-content h1 {
        font-size: 1.75rem;
    }

    .app-shell-content h2 {
        font-size: 1.5rem;
    }

    .app-shell-content h3 {
        font-size: 1.25rem;
    }

    .app-shell-content .form-row > [class*="col-"],
    .app-shell-content .row > [class*="col-"] {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .app-shell-content {
        padding: 12px 8px;
    }

    .app-content-container {
        padding-right: 8px;
        padding-left: 8px;
    }

    .app-shell-content .input-group-prepend,
    .app-shell-content .input-group-append {
        max-width: 100%;
    }

    .app-shell-footer {
        padding: 12px 12px 0;
        font-size: .84rem;
        text-align: center;
    }
}

@media print {
    .app-skip-link {
        display: none !important;
    }

    .app-table-scroll {
        overflow: visible;
        border: 0;
    }

    .app-table-scroll--wide > .table {
        min-width: 0;
    }
}
