/* SaaS shell — complements Tailwind CDN (design tokens live in head_saas.php) */

@layer utilities {
    .text-balance {
        text-wrap: balance;
    }

    .line-clamp-2,
    .line-clamp-4 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .line-clamp-2 {
    line-clamp: 2;
        -webkit-line-clamp: 2;
    }

    .line-clamp-4 {
    line-clamp: 4;
        -webkit-line-clamp: 4;
    }
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.45) rgba(15, 23, 42, 0.08);
}

body,
* {
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.72) 0%, rgba(59, 130, 246, 0.72) 100%);
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.9) 0%, rgba(59, 130, 246, 0.9) 100%);
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

.dark html {
    scrollbar-color: rgba(129, 140, 248, 0.55) rgba(148, 163, 184, 0.08);
}

.dark *::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.08);
}

.dark *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.78) 0%, rgba(96, 165, 250, 0.72) 100%);
    background-clip: padding-box;
}

.dark *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(165, 180, 252, 0.9) 0%, rgba(125, 211, 252, 0.86) 100%);
    background-clip: padding-box;
}

/* Page enter (paired with app.js) */
.saas-shell {
    position: relative;
    --saas-shell-side: calc((100vw - min(1680px, 100vw)) / 2 + 1.5rem);
    --saas-stage-width: min(1040px, calc(100vw - 3rem));
    --saas-sidebar-width: 292px;
    --saas-shell-gap: 3.25rem;
    --saas-stage-left: calc(var(--saas-shell-side) + var(--saas-sidebar-width) + var(--saas-shell-gap));
    --saas-stage-right: var(--saas-shell-side);
    --saas-rail-left: calc(50vw - (var(--saas-stage-width) / 2));
    --saas-rail-right: calc(50vw - (var(--saas-stage-width) / 2));
    --saas-sidebar-left: max(0.75rem, calc(var(--saas-rail-left) - var(--saas-sidebar-width) - var(--saas-shell-gap)));
}

.saas-stage {
    display: flex;
    min-width: 0;
    min-height: calc(100vh - 1.5rem);
    flex-direction: column;
    gap: 1rem;
}

.saas-topbar-wrap,
.saas-flash-wrap,
.saas-content-shell,
.saas-footer-wrap {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

.saas-content-wrap {
    margin: 0 auto;
    width: 100%;
    max-width: 1040px;
    padding: 0.5rem 0 7rem;
}

.saas-dock {
    border: 1px solid rgba(255, 255, 255, 0.55);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.62) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 18px 50px -24px rgba(15, 23, 42, 0.28),
        0 10px 24px -18px rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.saas-dock-blur {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.saas-dock-blur-top {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.34) 0%,
        rgba(15, 23, 42, 0.26) 22%,
        rgba(15, 23, 42, 0.16) 42%,
        rgba(15, 23, 42, 0.07) 62%,
        rgba(15, 23, 42, 0) 100%
    );
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.saas-dock-blur-bottom {
    background: linear-gradient(
        0deg,
        rgba(15, 23, 42, 0.32) 0%,
        rgba(15, 23, 42, 0.23) 22%,
        rgba(15, 23, 42, 0.14) 42%,
        rgba(15, 23, 42, 0.06) 62%,
        rgba(15, 23, 42, 0) 100%
    );
    mask-image: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.dark .saas-dock {
    border-color: rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(2, 6, 23, 0.72) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 50px -24px rgba(2, 6, 23, 0.72),
        0 10px 24px -18px rgba(59, 130, 246, 0.2);
}

.dark .saas-dock-blur-top {
    background: linear-gradient(
        180deg,
        rgba(2, 6, 23, 0.66) 0%,
        rgba(2, 6, 23, 0.44) 22%,
        rgba(2, 6, 23, 0.24) 42%,
        rgba(2, 6, 23, 0.1) 62%,
        rgba(2, 6, 23, 0) 100%
    );
}

.dark .saas-dock-blur-bottom {
    background: linear-gradient(
        0deg,
        rgba(2, 6, 23, 0.62) 0%,
        rgba(2, 6, 23, 0.4) 22%,
        rgba(2, 6, 23, 0.21) 42%,
        rgba(2, 6, 23, 0.09) 62%,
        rgba(2, 6, 23, 0) 100%
    );
}

.saas-dock-top {
    border-radius: 1.75rem;
}

.saas-dock-sidebar {
    border-radius: 1.9rem;
}

.saas-sidebar-shell {
    min-width: 0;
}

.saas-rail-fixed {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 30;
}

.saas-topbar-wrap.saas-rail-fixed {
    top: 0.75rem;
    z-index: 35;
}

.saas-footer-wrap.saas-rail-fixed {
    bottom: 0.75rem;
}

.saas-page {
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 0.45s ease-out,
        transform 0.45s ease-out;
}

.saas-page.is-ready {
    opacity: 1;
    transform: none;
}

@media (min-width: 1024px) {
    .saas-shell {
        display: block;
    }

    .saas-sidebar-shell {
        position: fixed;
        left: var(--saas-sidebar-left);
        top: 50vh;
        width: var(--saas-sidebar-width);
        height: calc(100vh - 3rem);
        transform: translateY(-50%);
        z-index: 32;
    }

    .saas-dock-sidebar {
        width: 100%;
        max-height: calc(100vh - 3rem);
        overflow: hidden;
    }

    .saas-stage {
        width: var(--saas-stage-width);
        min-height: calc(100vh - 3rem);
        gap: 1.25rem;
        padding-top: 6.5rem;
        margin: 0 auto;
    }

    .saas-rail-fixed {
        left: 50%;
        right: auto;
        width: var(--saas-stage-width);
        transform: translateX(-50%);
    }

    .saas-content-wrap {
        padding-top: 0.35rem;
        padding-bottom: 8rem;
    }

    .saas-topbar-wrap.saas-rail-fixed {
        top: 1.5rem;
    }

    .saas-footer-wrap.saas-rail-fixed {
        bottom: 1.5rem;
    }
}

@media (max-width: 1023px) {
    .saas-shell {
        padding-bottom: 5rem;
    }

    .saas-stage {
        min-height: auto;
        padding-top: 4.75rem;
    }

    .saas-topbar-wrap,
    .saas-flash-wrap,
    .saas-content-shell,
    .saas-footer-wrap,
    .saas-content-wrap {
        max-width: 100%;
    }

    .saas-dock-sidebar {
        max-height: calc(100vh - 1.5rem);
    }

    .saas-content-wrap {
        padding-top: 0;
        padding-bottom: 8rem;
    }
}

.category-admin-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-admin-eyebrow,
.category-admin-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(99 102 241);
}

.category-admin-hero__title {
    margin-top: 0.5rem;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    color: rgb(15 23 42);
}

.category-admin-hero__text,
.category-admin-panel__text,
.category-admin-empty-copy {
    margin-top: 0.75rem;
    max-width: 44rem;
    font-size: 0.96rem;
    line-height: 1.7;
    color: rgb(100 116 139);
}

.category-admin-stats,
.category-admin-detail-grid,
.category-admin-actions-grid,
.category-admin-subgrid {
    display: grid;
    gap: 1rem;
}

.category-admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-admin-stat-card,
.category-admin-info-card,
.category-admin-subcard,
.category-admin-actions-card,
.category-admin-panel,
.category-admin-empty {
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.7));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 24px 60px -34px rgba(15, 23, 42, 0.3),
        0 16px 36px -26px rgba(99, 102, 241, 0.24);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.category-admin-stat-card {
    border-radius: 1.65rem;
    padding: 1rem 1.1rem;
}

.category-admin-stat-card--success {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(220, 252, 231, 0.78));
}

.category-admin-stat-card--accent {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.95), rgba(224, 231, 255, 0.78));
}

.category-admin-stat-label,
.category-admin-info-card__label,
.category-admin-detail-hero__slug,
.category-admin-mini-note {
    font-size: 0.78rem;
    color: rgb(100 116 139);
}

.category-admin-stat-value,
.category-admin-info-card__value {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.55rem;
    font-weight: 800;
    color: rgb(15 23 42);
}

.category-admin-layout {
    display: grid;
    gap: 1.25rem;
}

.category-admin-mobile-switch {
    display: inline-flex;
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.75);
    padding: 0.25rem;
}

.category-admin-mobile-switch__btn {
    flex: 1 1 0%;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(71 85 105);
}

.category-admin-mobile-switch__btn.is-active {
    background: linear-gradient(135deg, rgb(99 102 241), rgb(59 130 246));
    color: white;
    box-shadow: 0 16px 28px -18px rgba(59, 130, 246, 0.8);
}

.category-admin-panel,
.category-admin-empty {
    border-radius: 2rem;
    padding: 1.2rem;
}

.category-admin-panel {
    min-width: 0;
    flex-direction: column;
    gap: 1rem;
}

.category-admin-panel__top,
.category-admin-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.category-admin-panel__title,
.category-admin-section-heading__title {
    margin-top: 0.3rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-admin-ghost-btn,
.category-admin-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.category-admin-ghost-btn {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.8);
    color: rgb(30 41 59);
}

.category-admin-primary-btn {
    border: 0;
    background: linear-gradient(135deg, rgb(99 102 241), rgb(37 99 235));
    color: white;
    box-shadow: 0 20px 34px -22px rgba(37, 99, 235, 0.9);
}

.category-admin-primary-btn--compact {
    padding-inline: 1rem;
    white-space: nowrap;
}

.category-admin-ghost-btn:hover,
.category-admin-primary-btn:hover {
    transform: translateY(-1px);
}

.category-admin-search {
    position: relative;
}

.category-admin-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    height: 1rem;
    width: 1rem;
    transform: translateY(-50%);
    color: rgb(148 163 184);
}

.category-admin-search__input {
    width: 100%;
    border-radius: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.82);
    padding: 0.95rem 1rem 0.95rem 2.75rem;
    font-size: 0.92rem;
    color: rgb(15 23 42);
}

.category-admin-tree-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: rgb(100 116 139);
}

.category-admin-tree {
    min-height: 18rem;
    max-height: 60vh;
    overflow: auto;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.78), rgba(255, 255, 255, 0.54));
    padding: 0.65rem;
}

.category-admin-node__row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-left: var(--node-indent);
    border-radius: 1.2rem;
    border: 1px solid transparent;
    background: transparent;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.category-admin-node__row:hover,
.category-admin-node__row.is-selected {
    border-color: rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 242, 255, 0.9));
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.5);
}

.category-admin-node__toggle,
.category-admin-node__spacer {
    display: inline-flex;
    height: 2.2rem;
    width: 2.2rem;
    flex: 0 0 2.2rem;
    align-items: center;
    justify-content: center;
    color: rgb(100 116 139);
}

.category-admin-node__link {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem 0.8rem 0.1rem;
}

.category-admin-node__main {
    min-width: 0;
}

.category-admin-node__title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-admin-node__meta,
.category-admin-info-card__hint,
.category-admin-child-row small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.77rem;
    color: rgb(100 116 139);
}

.category-admin-node__badges,
.category-admin-detail-hero__status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.category-admin-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.88);
    padding: 0.38rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgb(51 65 85);
}

.category-admin-status-pill.is-active {
    background: rgba(16, 185, 129, 0.12);
    color: rgb(4 120 87);
}

.category-admin-status-pill.is-passive {
    background: rgba(148, 163, 184, 0.16);
    color: rgb(71 85 105);
}

.category-admin-inline-create {
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.55);
    padding: 1rem;
}

.category-admin-inline-create__label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgb(71 85 105);
}

.category-admin-inline-create__row {
    display: grid;
    gap: 0.8rem;
}

.category-admin-detail-hero {
    border-radius: 1.8rem;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72));
    padding: 1.8rem;
}

.category-admin-detail-hero__title {
    margin-top: 1rem;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    font-weight: 800;
    color: rgb(15 23 42);
}

.category-admin-detail-hero__text {
    margin-top: 0.9rem;
    max-width: 48rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgb(71 85 105);
}

.category-admin-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.category-admin-info-card,
.category-admin-actions-card,
.category-admin-subcard {
    border-radius: 1.7rem;
    padding: 1.4rem;
}

.category-admin-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.category-admin-actions-card {
    margin-top: 0.15rem;
}

.category-admin-action-row {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.category-admin-action-menu__item {
    display: block;
    min-width: 8.5rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.66);
    padding: 1rem 1.15rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(30 41 59);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.category-admin-action-menu__item:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.28);
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(224, 231, 255, 0.92));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 14px 28px -20px rgba(79, 70, 229, 0.45);
}

.category-admin-action-menu__item--danger {
    border-color: rgba(127, 29, 29, 0.24);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.12), rgba(69, 10, 10, 0.18));
    color: rgb(127 29 29);
}

.category-admin-action-menu__item--danger:hover {
    border-color: rgba(127, 29, 29, 0.42);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.92), rgba(69, 10, 10, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(254, 226, 226, 0.14),
        0 16px 30px -22px rgba(127, 29, 29, 0.8);
    color: rgb(254 226 226);
}

.category-admin-action-tile {
    display: block;
    width: 100%;
    border-radius: 1.3rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.65);
    padding: 1rem;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.category-admin-action-tile strong,
.category-admin-child-row strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-admin-action-tile span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgb(100 116 139);
}

.category-admin-action-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.22);
}

.category-admin-action-tile--danger {
    border-color: rgba(248, 113, 113, 0.22);
}

.category-admin-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-admin-children-list {
    display: grid;
    gap: 0.7rem;
}

.category-admin-child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.64);
    padding: 0.95rem 1rem;
}

.category-admin-empty {
    padding: 3rem 1.5rem;
    text-align: center;
}

.category-admin-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    height: 4rem;
    width: 4rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(59, 130, 246, 0.1));
    color: rgb(79 70 229);
}

.category-admin-empty__form {
    margin: 1.5rem auto 0;
    display: grid;
    max-width: 36rem;
    gap: 0.75rem;
}

.category-file-admin {
    display: grid;
    gap: 1rem;
}

.category-file-admin__topbar,
.category-file-admin__body,
.category-file-admin__actions,
.category-file-admin__breadcrumb,
.category-file-item,
.category-file-item__meta {
    display: flex;
}

.category-file-admin__topbar,
.category-file-admin__body {
    gap: 1rem;
}

.category-file-admin__body {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.category-file-admin__topbar {
    align-items: center;
    justify-content: space-between;
}

.category-file-admin__search {
    flex: 1 1 auto;
}

.category-file-admin__actions {
    flex: 0 0 auto;
}

.category-file-admin__breadcrumb {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.1rem;
}

.category-file-admin__crumb,
.category-file-admin__crumb-sep {
    font-size: 0.88rem;
    color: rgb(100 116 139);
}

.category-file-admin__crumb {
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.category-file-admin__crumb:hover,
.category-file-admin__crumb.is-active {
    background: rgba(99, 102, 241, 0.1);
    color: rgb(49 46 129);
}

.category-file-admin__columns {
    display: flex;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding-bottom: 0.35rem;
}

.category-file-column,
.category-file-detail {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 1.7rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        0 24px 60px -34px rgba(15, 23, 42, 0.3),
        0 16px 36px -26px rgba(99, 102, 241, 0.24);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.category-file-column {
    display: flex;
    width: 260px;
    min-width: 260px;
    min-height: 28rem;
    flex-direction: column;
    padding: 0.9rem;
}

.category-file-detail {
    width: 100%;
    flex: 1 1 auto;
    padding: 1rem;
}

.category-file-detail--full {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
}

body.category-confirm-open {
    overflow: hidden;
}

.category-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.category-confirm-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.category-confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 35%),
        rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.category-confirm-modal__dialog {
    position: relative;
    width: min(100%, 31rem);
    max-width: 31rem;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 1.9rem;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 30px 80px -36px rgba(15, 23, 42, 0.5);
    padding: 1.55rem;
    color: rgb(15 23 42);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    transform: translateY(0) scale(1);
    transition: transform 0.22s ease, opacity 0.22s ease;
    opacity: 1;
    pointer-events: auto;
}

.category-confirm-modal.hidden .category-confirm-modal__dialog {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
}

.category-confirm-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: rgb(71 85 105);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.category-confirm-modal__close svg,
.category-confirm-modal__icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.category-confirm-modal__close:hover {
    border-color: rgba(99, 102, 241, 0.22);
    background: rgba(238, 242, 255, 0.92);
    color: rgb(49 46 129);
}

.category-confirm-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.12), rgba(69, 10, 10, 0.18));
    color: rgb(127 29 29);
}

.category-confirm-modal__content {
    margin-top: 1rem;
}

.category-confirm-modal__eyebrow {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(127 29 29);
}

.category-confirm-modal__title {
    margin-top: 0.45rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-confirm-modal__text {
    margin-top: 0.65rem;
    font-size: 0.96rem;
    line-height: 1.75;
    color: rgb(71 85 105);
}

.category-confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    margin-top: 1.6rem;
}

.category-confirm-modal__button {
    appearance: none;
    cursor: pointer;
    min-width: 7.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0.9rem 1.2rem;
    font-size: 0.92rem;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.category-confirm-modal__button:hover {
    transform: translateY(-1px);
}

.category-confirm-modal__button--ghost {
    background: rgba(255, 255, 255, 0.74);
    color: rgb(30 41 59);
}

.category-confirm-modal__button--ghost:hover {
    border-color: rgba(99, 102, 241, 0.22);
    background: rgba(238, 242, 255, 0.92);
}

.category-confirm-modal__button--danger {
    border-color: rgba(127, 29, 29, 0.32);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.94), rgba(69, 10, 10, 1));
    box-shadow: 0 18px 32px -22px rgba(127, 29, 29, 0.75);
    color: rgb(254 242 242);
}

.category-confirm-modal__button--danger:hover {
    border-color: rgba(153, 27, 27, 0.48);
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.98), rgba(69, 10, 10, 1));
}

.category-create-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.category-create-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.category-create-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 35%),
        rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.category-create-modal__dialog {
    position: relative;
    width: min(100%, 42rem);
    max-height: min(90vh, 52rem);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 2rem;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.86));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 30px 80px -36px rgba(15, 23, 42, 0.5);
    padding: 1.7rem;
    color: rgb(15 23 42);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    transform: translateY(0) scale(1);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.category-create-modal.hidden .category-create-modal__dialog {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
}

.category-create-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: rgb(71 85 105);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.category-create-modal__close:hover {
    border-color: rgba(99, 102, 241, 0.22);
    background: rgba(238, 242, 255, 0.92);
    color: rgb(49 46 129);
}

.category-create-modal__close svg {
    width: 1.2rem;
    height: 1.2rem;
}

.category-create-modal__eyebrow {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(79 70 229);
}

.category-create-modal__title {
    margin-top: 0.45rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.category-create-modal__text {
    margin-top: 0.7rem;
    max-width: 34rem;
    font-size: 0.96rem;
    line-height: 1.7;
    color: rgb(71 85 105);
}

.category-create-modal__form {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
}

.category-create-modal__feedback {
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: rgb(51 65 85);
}

.category-create-modal__feedback.hidden {
    display: none;
}

.category-create-modal__feedback.is-error {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.88);
    color: rgb(153 27 27);
}

.category-create-modal__parent {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1.3rem;
    background: rgba(255, 255, 255, 0.58);
    padding: 1rem 1.1rem;
}

.category-create-modal__parent-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-create-modal__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-create-modal__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.95rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgb(51 65 85);
}

.category-create-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    padding-top: 0.4rem;
}

.category-file-column__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.2rem 0.8rem;
}

.category-file-column__title {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-file-column__count {
    display: inline-flex;
    min-width: 2rem;
    justify-content: center;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: rgb(79 70 229);
}

.category-file-column__list {
    display: grid;
    gap: 0.7rem;
    align-content: start;
    height: 100%;
    overflow: auto;
    padding-right: 0.15rem;
}

.category-file-item {
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.74);
    padding: 0.95rem 1rem;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.category-file-item:hover,
.category-file-item.is-active {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.24);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 255, 0.92));
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.45);
}

.category-file-item--add {
    border-style: dashed;
    background: rgba(99, 102, 241, 0.06);
}

.category-file-item--add:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.12);
}

.category-file-item__main {
    min-width: 0;
}

.category-file-item__main strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.category-file-item__main small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.76rem;
    color: rgb(100 116 139);
}

.category-file-item__meta {
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
}

.category-file-item__arrow {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    padding: 0.35rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgb(71 85 105);
}

.dark .category-admin-hero__title,
.dark .category-admin-panel__title,
.dark .category-admin-section-heading__title,
.dark .category-admin-stat-value,
.dark .category-admin-info-card__value,
.dark .category-admin-detail-hero__title,
.dark .category-admin-node__title,
.dark .category-admin-action-tile strong,
.dark .category-admin-child-row strong,
.dark .category-file-column__title,
.dark .category-file-item__main strong {
    color: rgb(248 250 252);
}

.dark .category-admin-hero__text,
.dark .category-admin-panel__text,
.dark .category-admin-empty-copy,
.dark .category-admin-stat-label,
.dark .category-admin-info-card__label,
.dark .category-admin-detail-hero__slug,
.dark .category-admin-node__meta,
.dark .category-admin-info-card__hint,
.dark .category-admin-child-row small,
.dark .category-admin-action-tile span,
.dark .category-admin-tree-meta,
.dark .category-admin-mini-note,
.dark .category-file-admin__crumb,
.dark .category-file-admin__crumb-sep,
.dark .category-file-item__main small,
.dark .category-file-item__arrow,
.dark .category-file-column__count {
    color: rgb(148 163 184);
}

.dark .category-admin-stat-card,
.dark .category-admin-info-card,
.dark .category-admin-subcard,
.dark .category-admin-actions-card,
.dark .category-admin-panel,
.dark .category-admin-empty,
.dark .category-file-column,
.dark .category-file-detail {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.76));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 24px 60px -34px rgba(2, 6, 23, 0.8),
        0 16px 36px -26px rgba(59, 130, 246, 0.22);
}

.dark .category-admin-stat-card--success {
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.42), rgba(2, 44, 34, 0.42));
}

.dark .category-admin-stat-card--accent {
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.48), rgba(30, 41, 59, 0.5));
}

.dark .category-admin-mobile-switch,
.dark .category-admin-search__input,
.dark .category-admin-tree,
.dark .category-admin-inline-create,
.dark .category-admin-action-tile,
.dark .category-admin-action-menu__item,
.dark .category-admin-child-row,
.dark .category-admin-status-pill,
.dark .category-admin-ghost-btn,
.dark .category-admin-detail-hero,
.dark .category-file-item {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.72);
    color: rgb(226 232 240);
}

.dark .category-admin-action-menu__item:hover {
    border-color: rgba(129, 140, 248, 0.34);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(49, 46, 129, 0.52));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 14px 28px -20px rgba(79, 70, 229, 0.45);
}

.dark .category-admin-action-menu__item--danger {
    border-color: rgba(127, 29, 29, 0.3);
    background: linear-gradient(180deg, rgba(69, 10, 10, 0.78), rgba(45, 6, 6, 0.88));
    color: rgb(252 165 165);
}

.dark .category-admin-action-menu__item--danger:hover {
    border-color: rgba(220, 38, 38, 0.52);
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.96), rgba(69, 10, 10, 1));
    color: rgb(254 242 242);
}

.dark .category-confirm-modal__dialog {
    border-color: rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.2), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 30px 80px -36px rgba(2, 6, 23, 0.86);
    color: rgb(241 245 249);
}

.dark .category-confirm-modal__close {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.74);
    color: rgb(148 163 184);
}

.dark .category-confirm-modal__close:hover {
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(30, 41, 59, 0.96);
    color: rgb(224 231 255);
}

.dark .category-confirm-modal__icon {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.34), rgba(69, 10, 10, 0.54));
    color: rgb(252 165 165);
}

.dark .category-confirm-modal__text {
    color: rgb(148 163 184);
}

.dark .category-confirm-modal__eyebrow {
    color: rgb(252 165 165);
}

.dark .category-confirm-modal__button--ghost {
    background: rgba(15, 23, 42, 0.78);
    color: rgb(226 232 240);
}

.dark .category-confirm-modal__button--ghost:hover {
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(30, 41, 59, 0.96);
}

.dark .category-create-modal__dialog {
    border-color: rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.2), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 30px 80px -36px rgba(2, 6, 23, 0.86);
    color: rgb(241 245 249);
}

.dark .category-create-modal__close {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.74);
    color: rgb(148 163 184);
}

.dark .category-create-modal__close:hover {
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(30, 41, 59, 0.96);
    color: rgb(224 231 255);
}

.dark .category-create-modal__eyebrow {
    color: rgb(165 180 252);
}

.dark .category-create-modal__text {
    color: rgb(148 163 184);
}

.dark .category-create-modal__feedback {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.72);
    color: rgb(226 232 240);
}

.dark .category-create-modal__feedback.is-error {
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(69, 10, 10, 0.42);
    color: rgb(252 165 165);
}

.dark .category-create-modal__parent,
.dark .category-create-modal__toggle {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.72);
}

.dark .category-create-modal__parent-value,
.dark .category-create-modal__toggle {
    color: rgb(226 232 240);
}

@media (max-width: 640px) {
    .category-create-modal__grid {
        grid-template-columns: 1fr;
    }

    .category-create-modal__actions,
    .category-confirm-modal__actions {
        flex-direction: column-reverse;
    }

    .category-create-modal__actions .category-admin-ghost-btn,
    .category-create-modal__actions .category-admin-primary-btn,
    .category-confirm-modal__button {
        width: 100%;
        justify-content: center;
    }
}

.dark .category-admin-node__row:hover,
.dark .category-admin-node__row.is-selected {
    border-color: rgba(99, 102, 241, 0.34);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(49, 46, 129, 0.44));
}

.dark .category-file-admin__crumb:hover,
.dark .category-file-admin__crumb.is-active,
.dark .category-file-item:hover,
.dark .category-file-item.is-active {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(49, 46, 129, 0.44));
    border-color: rgba(99, 102, 241, 0.34);
    color: rgb(224 231 255);
}

.dark .category-file-item__arrow {
    background: rgba(148, 163, 184, 0.1);
}

.dark .category-admin-action-menu__item--danger {
    color: rgb(252 165 165);
}

.dark .category-file-item--add {
    background: rgba(79, 70, 229, 0.12);
}

@media (min-width: 1024px) {
    .category-admin-hero {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .category-admin-layout {
        grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
        align-items: start;
    }

    .category-admin-panel--tree {
        position: sticky;
        top: 8.2rem;
    }

    .category-file-detail--full {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 900px) {
    .category-admin-stats,
    .category-admin-detail-grid,
    .category-admin-actions-grid,
    .category-admin-subgrid,
    .category-admin-inline-create__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-file-detail {
        width: 100%;
        flex-basis: auto;
    }
}

/* Skeleton shimmer (Tailwind animate-shimmer moves a pseudo element in keyframes — use div overlay) */
.saas-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgb(241 245 249) 0%,
        rgb(226 232 240) 50%,
        rgb(241 245 249) 100%
    );
    background-size: 200% 100%;
    animation: saas-skeleton-shift 1.2s ease-in-out infinite;
}

.dark .saas-skeleton {
    background: linear-gradient(
        90deg,
        rgb(30 41 59) 0%,
        rgb(51 65 85) 50%,
        rgb(30 41 59) 100%
    );
    background-size: 200% 100%;
}

@keyframes saas-skeleton-shift {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .saas-page {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .saas-skeleton {
        animation: none;
    }
}
