:root {
    --sp-navy-950: #061629;
    --sp-navy-900: #0a1d33;
    --sp-navy-800: #102a45;
    --sp-blue-600: #155eef;
    --sp-blue-500: #2674ff;
    --sp-blue-100: #eaf2ff;
    --sp-ink: #101828;
    --sp-muted: #667085;
    --sp-line: #e4e9f1;
    --sp-surface: #ffffff;
    --sp-canvas: #f4f6fa;
    --sp-success: #12a06a;
    --sp-sidebar-width: 244px;
    --sp-topbar-height: 72px;
    --sp-shadow: 0 12px 36px rgba(16, 24, 40, .08);
}

* {
    box-sizing: border-box;
}

body.sp-shell-page {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background: var(--sp-canvas);
    color: var(--sp-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.sp-shell-page > .app-footer,
.sp-shell-page .sp-workspace-content > .app-navbar,
.sp-shell-page #alertaLimite {
    display: none !important;
}

.sp-workspace-shell {
    display: grid;
    grid-template-columns: var(--sp-sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    background: var(--sp-canvas);
}

.sp-sidebar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sp-sidebar-width);
    height: 100vh;
    overflow: hidden;
    color: #d7e4f1;
    background:
        radial-gradient(circle at 12% 8%, rgba(42, 118, 255, .22), transparent 28%),
        linear-gradient(180deg, var(--sp-navy-900), var(--sp-navy-950));
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.sp-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    padding: 17px 18px 13px;
}

.sp-sidebar-brand img {
    display: block;
    width: 152px;
    max-height: 42px;
    object-fit: contain;
    object-position: left center;
}

.sp-sidebar-brand > button {
    display: none;
    width: 36px;
    height: 36px;
    color: #d7e4f1;
    background: rgba(255, 255, 255, .08);
    border: 0;
    border-radius: 10px;
}

.sp-sidebar-nav,
.sp-sidebar-tools {
    display: grid;
    gap: 4px;
    padding: 0 12px;
}

.sp-sidebar-nav {
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sp-sidebar-nav a,
.sp-sidebar-tools a {
    display: flex;
    align-items: center;
    min-width: 0;
    color: #aebed0;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.sp-sidebar-nav a {
    gap: 12px;
    min-height: 43px;
    padding: 9px 12px;
    font-size: .86rem;
    font-weight: 650;
}

.sp-sidebar-nav a > i {
    width: 20px;
    color: #8fa9c3;
    font-size: 1rem;
    text-align: center;
}

.sp-sidebar-nav a:hover,
.sp-sidebar-tools a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    transform: translateX(2px);
}

.sp-sidebar-nav a.is-active,
.sp-sidebar-tools a.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(30, 114, 255, .32), rgba(30, 114, 255, .13));
    border-color: rgba(84, 151, 255, .25);
    box-shadow: inset 3px 0 0 #4b8dff;
}

.sp-sidebar-nav a.is-active > i {
    color: #75a7ff;
}

.sp-sidebar-section {
    min-height: 0;
    flex: 1;
    padding-top: 17px;
    overflow: hidden;
}

.sp-sidebar-label {
    display: block;
    padding: 0 22px 10px;
    color: #6f88a2;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sp-sidebar-tools {
    height: calc(100% - 31px);
    gap: 3px;
    overflow-y: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sp-sidebar-tools a {
    gap: 10px;
    min-height: 42px;
    padding: 7px 9px;
    font-size: .78rem;
    font-weight: 620;
}

.sp-sidebar-tools a.is-disabled {
    opacity: .46;
    cursor: not-allowed;
    pointer-events: none;
}
.sp-sidebar-tools a > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-tool-nav-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #cfe0f1;
    background: rgba(255,255,255,.08);
    border-radius: 8px;
}

.sp-sidebar-tools a.is-active .sp-tool-nav-icon {
    color: #fff;
    background: rgba(42, 116, 255, .65);
}

.sp-sidebar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 72px;
    padding: 12px;
    background: rgba(0, 0, 0, .13);
    border-top: 1px solid rgba(255, 255, 255, .08);
}

/* Shared preferences remain reachable in the existing mobile navigation. */
.sp-presentation-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: #edf3fc;
}
.sp-presentation-controls label {
    grid-column: 1 / -1;
    margin: 0;
    font-size: .8rem;
}
.sp-presentation-controls select,
.sp-presentation-controls button {
    min-width: 0;
    min-height: 40px;
    padding: 7px 9px;
    color: #edf3fc;
    background: #102a45;
    border: 1px solid #71849c;
    border-radius: 8px;
    font: inherit;
    font-size: .8rem;
}
.sp-presentation-controls button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.sp-presentation-controls :focus-visible {
    outline: 3px solid #a5c7ff;
    outline-offset: 2px;
}

.sp-workspace-main > .app-footer {
    margin-top: 0;
    color: var(--sp-muted);
    background: var(--sp-surface);
    border-top: 1px solid var(--sp-line);
}
.sp-workspace-main > .app-footer .app-shell { padding: 0 24px; }
.sp-workspace-main > .app-footer .app-footer-contenido {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 78px;
    padding: 16px 0;
}
.sp-workspace-main > .app-footer .app-footer-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: var(--sp-muted);
    font-size: .8rem;
}
.sp-workspace-main > .app-footer .sectorpdf-brand-slogan {
    font-size: .8rem;
    line-height: 1.5;
    color: var(--sp-muted);
}
.sectorpdf-footer-version { white-space: nowrap; }

/* The full-screen FAP editor keeps its existing chrome and viewport. */
body[data-fap-phase="workspace"] .sp-workspace-main > .app-footer { display: none; }

/* Use the existing dark-mode state without changing the approved layout. */
body.dark-mode.sp-shell-page {
    --sp-ink: #edf3fc;
    --sp-muted: #b5c2d5;
    --sp-line: #34445c;
    --sp-surface: #1b293d;
    --sp-canvas: #111c2c;
}
body.dark-mode .sp-topbar,
body.dark-mode .sp-icon-button,
body.dark-mode .sp-home-button,
body.dark-mode .sp-topbar-link,
body.dark-mode .sp-catalog-search,
body.dark-mode .sp-catalog-filters button,
body.dark-mode .sp-catalog-card,
body.dark-mode .sp-catalog-empty,
body.dark-mode .sp-capability,
body.dark-mode .sp-profile-card,
body.dark-mode .sp-activity-card {
    color: var(--sp-ink);
    background: var(--sp-surface);
    border-color: var(--sp-line);
}
body.dark-mode .sp-active-tool strong,
body.dark-mode .sp-catalog-heading h1,
body.dark-mode .sp-catalog-card h2,
body.dark-mode .sp-capability strong,
body.dark-mode .sp-section-header h1,
body.dark-mode .sp-profile-card h2,
body.dark-mode .sp-profile-details dd,
body.dark-mode .sp-activity-heading h2,
body.dark-mode .sp-activity-item strong,
body.dark-mode .sp-empty-state h3 { color: var(--sp-ink); }
body.dark-mode .sp-active-tool small,
body.dark-mode .sp-live-status,
body.dark-mode .sp-catalog-count,
body.dark-mode .sp-catalog-card p,
body.dark-mode .sp-catalog-card-category,
body.dark-mode .sp-catalog-card-status,
body.dark-mode .sp-capability small,
body.dark-mode .sp-section-header p,
body.dark-mode .sp-profile-card > p,
body.dark-mode .sp-profile-details dt,
body.dark-mode .sp-activity-item small,
body.dark-mode .sp-activity-meta,
body.dark-mode .sp-empty-state { color: var(--sp-muted); }
body.dark-mode .sp-catalog-eyebrow,
body.dark-mode .sp-capability > i,
body.dark-mode .sp-activity-heading span:first-child { color: #91b9ff; }
body.dark-mode .sp-catalog-filters button:hover,
body.dark-mode .sp-catalog-filters button.active {
    color: #d9e8ff;
    background: #213f6d;
    border-color: #7ba7ed;
}

/* Tool preparation retains its existing light palette; its editor owns its theme. */
body.dark-mode .sp-aw-preparation,
body.dark-mode .fap-preparation { background: #f4f6fa; }

.sp-user-card {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
}

.sp-user-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 35px;
    height: 35px;
    color: #fff;
    background: linear-gradient(145deg, #2d7dff, #1257d9);
    border: 2px solid rgba(255,255,255,.16);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 800;
}

.sp-user-copy {
    display: grid;
    min-width: 0;
}

.sp-user-copy strong,
.sp-user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-user-copy strong {
    color: #f6f9fc;
    font-size: .76rem;
    font-weight: 700;
}

.sp-user-copy small {
    color: #8fa4ba;
    font-size: .65rem;
}

.sp-user-copy em {
    width: max-content;
    margin-top: 3px;
    padding: 2px 5px;
    color: #9dc0ff;
    background: rgba(37, 105, 226, .18);
    border-radius: 5px;
    font-size: .56rem;
    font-style: normal;
    font-weight: 750;
}

.sp-logout {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #9eb1c5;
    text-decoration: none;
    border-radius: 9px;
}

.sp-logout:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.sp-login-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
    background: #1766e8;
    border-radius: 10px;
}

.sp-workspace-main {
    min-width: 0;
}

.sp-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    min-height: var(--sp-topbar-height);
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--sp-line);
    backdrop-filter: blur(14px);
}

.sp-topbar-leading,
.sp-topbar-actions {
    display: flex;
    min-width: 0;
    align-items: center;
}

.sp-topbar-leading {
    gap: 12px;
}

.sp-topbar-actions {
    justify-content: flex-end;
    gap: 10px;
}

.sp-icon-button,
.sp-home-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #344054;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 10px;
}

.sp-menu-button {
    display: none;
}

.sp-topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--sp-line);
}

.sp-active-tool {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.sp-active-tool small {
    color: #98a2b3;
    font-size: .63rem;
    font-weight: 750;
    letter-spacing: .02em;
}

.sp-active-tool strong {
    max-width: 260px;
    overflow: hidden;
    color: #1d2939;
    font-size: .84rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475467;
    font-size: .72rem;
    font-weight: 650;
}

.sp-live-status > i {
    width: 8px;
    height: 8px;
    background: var(--sp-success);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(18,160,106,.1);
}

.sp-live-status.is-busy > i {
    background: #f79009;
    box-shadow: 0 0 0 4px rgba(247,144,9,.12);
    animation: spPulse 1.2s infinite;
}

.sp-live-status[data-state="empty"] > i {
    background: #98a2b3;
    box-shadow: 0 0 0 4px rgba(152,162,179,.12);
}

.sp-live-status[data-state="selected"] > i {
    background: #f79009;
    box-shadow: 0 0 0 4px rgba(247,144,9,.12);
}

.sp-live-status[data-state="validating"] > i,
.sp-live-status[data-state="processing"] > i {
    background: var(--sp-blue-600);
    box-shadow: 0 0 0 4px rgba(21,94,239,.12);
}

.sp-live-status[data-state="error"] > i {
    background: #d92d20;
    box-shadow: 0 0 0 4px rgba(217,45,32,.12);
}

.sp-topbar-link,
.sp-primary-action {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 9px;
}

.sp-topbar-link {
    color: #475467;
    background: #fff;
    border: 1px solid var(--sp-line);
}

.sp-primary-action {
    color: #fff;
    background: linear-gradient(135deg, var(--sp-blue-600), #0d55d7);
    border: 1px solid var(--sp-blue-600);
    box-shadow: 0 5px 14px rgba(21,94,239,.2);
}

.sp-workspace-content {
    min-width: 0;
    min-height: calc(100vh - var(--sp-topbar-height));
}

/* Catalog */
.sp-catalog {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 36px 34px 48px;
}

.sp-catalog-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.sp-catalog-heading {
    max-width: 660px;
}

.sp-catalog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: var(--sp-blue-600);
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sp-catalog-heading h1 {
    margin: 0 0 8px;
    color: #101828;
    font-size: clamp(2rem, 3.4vw, 3.1rem);
    font-weight: 790;
    letter-spacing: -.045em;
}

.sp-catalog-heading p {
    margin: 0;
    color: var(--sp-muted);
    font-size: .96rem;
}

.sp-catalog-search {
    display: flex;
    width: min(390px, 100%);
    min-height: 46px;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #d9e0ea;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(16,24,40,.04);
}

.sp-catalog-search:focus-within {
    border-color: #84adff;
    box-shadow: 0 0 0 4px rgba(21,94,239,.1);
}

.sp-catalog-search i {
    color: #98a2b3;
}

.sp-catalog-search input {
    min-width: 0;
    flex: 1;
    color: var(--sp-ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.sp-catalog-search kbd {
    color: #667085;
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
    border-radius: 5px;
    box-shadow: none;
}

.sp-catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
}

.sp-catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-catalog-filters button {
    padding: 8px 12px;
    color: #667085;
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 9px;
    font-size: .72rem;
    font-weight: 730;
}

.sp-catalog-filters button:hover,
.sp-catalog-filters button.active {
    color: #124fc4;
    background: #edf4ff;
    border-color: #b8d0ff;
}

.sp-catalog-count {
    color: #667085;
    font-size: .73rem;
    font-weight: 700;
    white-space: nowrap;
}

.sp-catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sp-catalog-card {
    position: relative;
    display: flex;
    min-height: 172px;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(16,24,40,.03);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.sp-catalog-card:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: #9fbfff;
    box-shadow: var(--sp-shadow);
}

.sp-catalog-card[hidden] {
    display: none;
}

.sp-catalog-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sp-catalog-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    font-size: 1.08rem;
}

.tone-blue { color: #155eef; background: #e9f1ff; }
.tone-pink { color: #db2777; background: #fce7f3; }
.tone-orange { color: #ea580c; background: #fff0e7; }
.tone-violet { color: #7c3aed; background: #f1eaff; }
.tone-amber { color: #d97706; background: #fff4dd; }
.tone-green { color: #07875f; background: #e5f8f1; }
.tone-indigo { color: #334fd7; background: #e9edff; }

.sp-catalog-card-meta {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.sp-catalog-card-category {
    color: #98a2b3;
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sp-catalog-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #667085;
    font-size: .6rem;
    font-weight: 700;
}

.sp-catalog-card-status i {
    width: 6px;
    height: 6px;
    background: #98a2b3;
    border-radius: 50%;
}

.sp-catalog-card-status.status-available {
    color: #087a58;
}

.sp-catalog-card-status.status-available i {
    background: #12a06a;
}

.sp-catalog-card.is-disabled {
    cursor: not-allowed;
    opacity: .65;
}

.sp-catalog-card h2 {
    margin: 0 0 7px;
    color: #101828;
    font-size: 1.02rem;
    font-weight: 760;
    letter-spacing: -.015em;
}

.sp-catalog-card p {
    margin: 0;
    color: #667085;
    font-size: .76rem;
    line-height: 1.48;
}

.sp-catalog-card-arrow {
    position: absolute;
    right: 18px;
    bottom: 17px;
    color: #98a2b3;
    transition: color .2s ease, transform .2s ease;
}

.sp-catalog-card:hover .sp-catalog-card-arrow {
    color: var(--sp-blue-600);
    transform: translate(2px, -2px);
}

.sp-catalog-empty {
    padding: 45px 20px;
    color: #667085;
    text-align: center;
    background: #fff;
    border: 1px dashed #cfd8e5;
    border-radius: 15px;
}

.sp-catalog-empty[hidden] {
    display: none;
}

.sp-catalog-capabilities {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.sp-capability {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 13px 14px;
    background: rgba(255,255,255,.72);
    border: 1px solid #e5eaf1;
    border-radius: 12px;
}

.sp-capability > i {
    color: var(--sp-blue-600);
    font-size: 1rem;
}

.sp-capability strong {
    display: block;
    color: #344054;
    font-size: .69rem;
}

.sp-capability small {
    display: block;
    overflow: hidden;
    color: #98a2b3;
    font-size: .61rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Existing real tool views inside the shared shell */
.sp-shell-page .herramienta-pagina,
.sp-shell-page .workspace-intro,
.sp-shell-page .container-fluid.app-shell {
    max-width: none;
}

.sp-shell-page .herramienta-pagina {
    padding: 24px 26px 38px;
}

.sp-shell-page .herramienta-breadcrumb {
    display: none;
}

.sp-shell-page .herramienta-hero {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 16px;
    margin: 0 0 17px;
    padding: 17px 20px;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(16,24,40,.035);
}

.sp-shell-page .herramienta-hero h1 {
    color: #101828;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    letter-spacing: -.025em;
}

.sp-shell-page .herramienta-hero p {
    max-width: 760px;
    margin-bottom: 0;
    color: #667085;
    font-size: .82rem;
}

.sp-shell-page .herramienta-hero-icono {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
}

.sp-shell-page .herramienta-hero-categoria {
    display: none;
}

.sp-shell-page .herramienta-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 318px);
    gap: 17px !important;
    margin: 0 !important;
    align-items: start;
}

.sp-shell-page .herramienta-layout > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
}

.sp-shell-page .herramienta-trabajo-card,
.sp-shell-page .herramienta-ayuda-card,
.sp-shell-page .galeria-card,
.sp-shell-page .configuracion-pdf-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--sp-line) !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 18px rgba(16,24,40,.045) !important;
}

.sp-shell-page .herramienta-trabajo-card {
    min-height: 430px;
}

.sp-shell-page .herramienta-card-header,
.sp-shell-page .configuracion-pdf-header,
.sp-shell-page .galeria-header {
    background: #fbfcfe !important;
    border-bottom: 1px solid var(--sp-line) !important;
}

.sp-shell-page .herramienta-ayuda-card {
    position: sticky;
    top: calc(var(--sp-topbar-height) + 18px);
}

.sp-shell-page .herramienta-ayuda-card::before {
    display: block;
    padding: 13px 17px 11px;
    color: #155eef;
    content: "AYUDA";
    font-size: .64rem;
    font-weight: 850;
    letter-spacing: .1em;
    border-bottom: 1px solid var(--sp-line);
}

.sp-shell-page .herramienta-file-box,
.sp-shell-page .custom-file-box,
.sp-shell-page .drop-area {
    background: linear-gradient(145deg, #fbfdff, #f5f8ff) !important;
    border: 1.5px dashed #9cbcf0 !important;
    border-radius: 13px !important;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.sp-shell-page .herramienta-file-box.sp-drop-active,
.sp-shell-page .custom-file-box.sp-drop-active,
.sp-shell-page .drop-area.sp-drop-active {
    background: #eef4ff !important;
    border-color: var(--sp-blue-600) !important;
    box-shadow: 0 0 0 4px rgba(21,94,239,.1);
}

.sp-shell-page .herramienta-boton-principal,
.sp-shell-page #btnConvertir {
    color: #fff !important;
    background: linear-gradient(135deg, #1769ee, #0d54d7) !important;
    border-color: #155eef !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 16px rgba(21,94,239,.18);
}

.sp-shell-page .herramienta-boton-principal:disabled,
.sp-shell-page #btnConvertir:disabled {
    color: #98a2b3 !important;
    background: #eaecf0 !important;
    border-color: #e4e7ec !important;
    box-shadow: none;
}

.sp-file-queue {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.sp-file-queue[hidden] {
    display: none;
}

.sp-file-queue-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #667085;
    font-size: .68rem;
    font-weight: 750;
}

.sp-file-item {
    display: grid;
    grid-template-columns: 33px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    background: #f8fafc;
    border: 1px solid #e5eaf1;
    border-radius: 9px;
}

.sp-file-item-icon {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    color: #155eef;
    background: #eaf2ff;
    border-radius: 8px;
}

.sp-file-item-copy {
    min-width: 0;
}

.sp-file-item-copy strong,
.sp-file-item-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-file-item-copy strong {
    color: #344054;
    font-size: .7rem;
}

.sp-file-item-copy small {
    color: #98a2b3;
    font-size: .62rem;
}

.sp-file-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.sp-file-move,
.sp-file-remove {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 7px;
    touch-action: manipulation;
}

.sp-file-move:hover:not(:disabled) {
    color: #155eef;
    background: #eaf2ff;
}

.sp-file-move:disabled {
    color: #d0d5dd;
    cursor: not-allowed;
}

.sp-file-remove:hover {
    color: #d92d20;
    background: #fff0ef;
}

.sp-shell-page .workspace-intro {
    padding: 24px 26px 16px;
}

.sp-shell-page .workspace-intro-row {
    align-items: center;
}

.sp-shell-page .workspace-intro h1 {
    color: #101828;
    font-size: clamp(1.65rem, 2.6vw, 2.25rem);
}

.sp-shell-page .workspace-intro p {
    font-size: .84rem;
}

.sp-shell-page .workspace-breadcrumb {
    display: none;
}

.sp-shell-page .workspace-status span {
    padding: 7px 10px;
    color: #667085;
    background: #fff;
    border-color: var(--sp-line);
    font-size: .65rem;
}

.sp-shell-page .sp-workspace-content > .container-fluid.app-shell {
    padding-right: 26px;
    padding-left: 26px;
}

.sp-shell-page .app-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
    gap: 17px !important;
    margin: 0 !important;
}

.sp-shell-page .app-workspace > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
}

.sp-shell-page .app-sidebar {
    position: sticky !important;
    top: calc(var(--sp-topbar-height) + 18px) !important;
}

.sp-shell-page .drop-area {
    min-height: 250px;
    box-shadow: 0 5px 18px rgba(16,24,40,.045) !important;
}

.sp-shell-page .overlay-progreso {
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.sp-shell-page .caja-progreso {
    border: 1px solid var(--sp-line);
    border-radius: 15px;
    box-shadow: 0 24px 70px rgba(6,22,41,.24);
}

.sp-sidebar-scrim {
    display: none;
}

/* History and account sections */
.sp-section-page {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 32px 30px 46px;
}

.sp-section-header {
    margin-bottom: 22px;
}

.sp-section-header h1 {
    margin: 0 0 7px;
    color: #101828;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 790;
    letter-spacing: -.04em;
}

.sp-section-header p {
    margin: 0;
    color: #667085;
    font-size: .9rem;
}

.sp-account-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sp-profile-card,
.sp-activity-card {
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: 15px;
    box-shadow: 0 6px 22px rgba(16,24,40,.045);
}

.sp-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 22px 20px;
    text-align: center;
}

.sp-profile-avatar {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 14px;
    color: #fff;
    background: linear-gradient(145deg, #2d7dff, #1257d9);
    border: 5px solid #eaf2ff;
    border-radius: 50%;
    font-size: 1.35rem;
    font-weight: 800;
}

.sp-profile-card h2 {
    margin: 0 0 4px;
    color: #101828;
    font-size: 1.15rem;
    font-weight: 760;
}

.sp-profile-card > p {
    margin: 0;
    color: #667085;
    font-size: .76rem;
}

.sp-role-badge {
    margin-top: 10px;
    padding: 5px 9px;
    color: #344054;
    background: #f2f4f7;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 750;
}

.sp-profile-details {
    display: grid;
    width: 100%;
    gap: 0;
    margin: 22px 0 15px;
    text-align: left;
    border-top: 1px solid var(--sp-line);
    border-bottom: 1px solid var(--sp-line);
}

.sp-profile-details > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 1px;
}

.sp-profile-details > div + div {
    border-top: 1px solid var(--sp-line);
}

.sp-profile-details dt,
.sp-profile-details dd {
    margin: 0;
    font-size: .69rem;
}

.sp-profile-details dt {
    color: #667085;
    font-weight: 650;
}

.sp-profile-details dd {
    color: #344054;
    font-weight: 750;
}

.sp-secondary-button,
.sp-danger-button,
.sp-primary-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 8px 12px;
    font-size: .72rem;
    font-weight: 730;
    text-decoration: none;
    border-radius: 9px;
}

.sp-secondary-button,
.sp-danger-button {
    width: 100%;
}

.sp-secondary-button {
    margin-bottom: 8px;
    color: #155eef;
    background: #eef4ff;
    border: 1px solid #c9dcff;
}

.sp-danger-button {
    color: #b42318;
    background: #fff;
    border: 1px solid #f2c9c5;
}

.sp-activity-card {
    min-width: 0;
    padding: 21px;
}

.sp-activity-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--sp-line);
}

.sp-activity-heading span:first-child {
    color: #155eef;
    font-size: .62rem;
    font-weight: 830;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sp-activity-heading h2 {
    margin: 3px 0 0;
    color: #101828;
    font-size: 1rem;
    font-weight: 760;
}

.sp-activity-count {
    padding: 5px 9px;
    color: #667085;
    background: #f2f4f7;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 700;
}

.sp-activity-list {
    display: grid;
}

.sp-activity-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid #edf0f4;
}

.sp-activity-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #155eef;
    background: #eaf2ff;
    border-radius: 10px;
}

.sp-activity-item > span:nth-child(2) {
    min-width: 0;
}

.sp-activity-item strong,
.sp-activity-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-activity-item strong {
    color: #344054;
    font-size: .75rem;
}

.sp-activity-item small {
    color: #98a2b3;
    font-size: .65rem;
}

.sp-activity-meta {
    color: #667085;
    font-size: .63rem;
    line-height: 1.45;
    text-align: right;
}

.sp-primary-inline {
    margin-top: 16px;
    color: #fff;
    background: #155eef;
}

.sp-empty-state {
    padding: 48px 20px;
    color: #667085;
    text-align: center;
}

.sp-empty-state i {
    color: #98a2b3;
    font-size: 1.65rem;
}

.sp-empty-state h3 {
    margin: 10px 0 5px;
    color: #344054;
    font-size: .92rem;
}

.sp-empty-state p {
    margin: 0;
    font-size: .72rem;
}

.sp-history-page .sp-workspace-content > .container-fluid.app-shell {
    padding: 28px 30px 44px !important;
}

.sp-history-page .historial-pagina {
    width: min(1180px, 100%);
    margin: 0 auto;
}

@media (max-width: 760px) {
    .sp-section-page {
        padding: 22px 14px 34px;
    }

    .sp-account-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sp-activity-card {
        padding: 15px;
    }

    .sp-activity-item {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .sp-activity-meta {
        grid-column: 2;
        text-align: left;
    }

    .sp-history-page .sp-workspace-content > .container-fluid.app-shell {
        padding: 18px 12px 32px !important;
    }
}


@keyframes spPulse {
    50% { opacity: .45; transform: scale(.85); }
}

@media (max-width: 1180px) {
    :root {
        --sp-sidebar-width: 220px;
    }

    .sp-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-catalog-capabilities {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sp-shell-page .herramienta-layout {
        grid-template-columns: minmax(0, 1fr) 270px;
    }

    .sp-shell-page .app-workspace {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 900px) {
    .sp-workspace-shell {
        display: block;
    }

    .sp-sidebar {
        position: fixed;
        left: 0;
        width: min(292px, calc(100vw - 44px));
        transform: translateX(-104%);
        box-shadow: 18px 0 60px rgba(6,22,41,.3);
        transition: transform .22s ease;
    }

    .sp-sidebar-brand > button,
    .sp-menu-button {
        display: grid;
    }

    body.sp-sidebar-open {
        overflow: hidden;
    }

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

    .sp-sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 1035;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(4, 15, 29, .48);
        border: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    body.sp-sidebar-open .sp-sidebar-scrim {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sp-topbar {
        padding: 0 18px;
    }

    .sp-catalog {
        padding: 28px 22px 40px;
    }

    .sp-catalog-header {
        align-items: stretch;
        flex-direction: column;
    }

    .sp-catalog-search {
        width: 100%;
    }

    .sp-shell-page .herramienta-layout,
    .sp-shell-page .app-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .sp-shell-page .herramienta-ayuda-card,
    .sp-shell-page .app-sidebar {
        position: static !important;
    }
}

@media (max-width: 640px) {
    :root {
        --sp-topbar-height: 62px;
    }

    .sp-topbar {
        gap: 8px;
        padding: 0 11px;
    }

    .sp-topbar-leading {
        gap: 7px;
    }

    .sp-home-button,
    .sp-topbar-divider,
    .sp-live-status,
    .sp-topbar-link {
        display: none;
    }

    .sp-active-tool small {
        display: none;
    }

    .sp-active-tool strong {
        max-width: 145px;
        font-size: .78rem;
    }

    .sp-primary-action {
        width: 38px;
        padding: 0;
    }

    .sp-primary-action span {
        display: none;
    }

    .sp-catalog {
        padding: 22px 14px 30px;
    }

    .sp-catalog-heading h1 {
        font-size: 1.85rem;
    }

    .sp-catalog-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sp-catalog-filters {
        flex-wrap: nowrap;
        width: calc(100vw - 28px);
        padding-bottom: 3px;
        overflow-x: auto;
    }

    .sp-catalog-filters button {
        flex: 0 0 auto;
    }

    .sp-catalog-grid,
    .sp-catalog-capabilities {
        grid-template-columns: minmax(0, 1fr);
    }

    .sp-catalog-card {
        min-height: 156px;
    }

    .sp-shell-page .herramienta-pagina {
        padding: 14px 12px 28px;
    }

    .sp-shell-page .herramienta-hero {
        min-height: 0;
        align-items: flex-start;
        padding: 14px;
    }

    .sp-shell-page .herramienta-hero-icono {
        width: 42px;
        height: 42px;
    }

    .sp-shell-page .herramienta-hero h1 {
        font-size: 1.24rem;
    }

    .sp-shell-page .herramienta-formulario,
    .sp-shell-page .herramienta-ayuda-card .card-body,
    .sp-shell-page .card-body {
        padding: 15px;
    }

    .sp-shell-page .workspace-intro {
        padding: 16px 13px 12px;
    }

    .sp-shell-page .workspace-intro-row {
        gap: 12px;
    }

    .sp-shell-page .workspace-status {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
    }

    .sp-shell-page .workspace-status span {
        flex: 0 0 auto;
    }

    .sp-shell-page .sp-workspace-content > .container-fluid.app-shell {
        padding-right: 12px;
        padding-left: 12px;
    }

    .sp-file-item {
        grid-template-columns: 31px minmax(0,1fr) auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-sidebar,
    .sp-sidebar a,
    .sp-catalog-card,
    .sp-catalog-card-arrow {
        transition: none !important;
    }
}
