:root {
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body.brand-body {
    margin: 0;
    min-height: 100vh;
    color: var(--brand-text);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--brand-accent) 22%, transparent), transparent 28%),
        radial-gradient(circle at bottom right, color-mix(in srgb, var(--brand-primary) 18%, transparent), transparent 30%),
        linear-gradient(140deg, #f8fafc 0%, #eef4f8 35%, #fffdf8 100%);
    font-family: var(--brand-font-body);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-height: 100vh;
    padding: 1.2rem;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    overflow-x: hidden;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.5rem 0;
}

.app-sidebar-brand-name {
    font-family: var(--brand-font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-primary);
    text-align: center;
}

.app-nav {
    display: grid;
    gap: 0.55rem;
}

.app-nav-logout {
    margin: 0;
    margin-top: 0.75rem;
}

.app-nav-link {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    color: var(--brand-text);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.12);
    min-width: 0;
}

.app-nav-link-logout {
    width: 100%;
    text-align: center;
    cursor: pointer;
    font: inherit;
    color: white;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.app-nav-link-logout:hover {
    opacity: 0.88;
}

.app-nav-link-logout .app-nav-link-note {
    color: rgba(255, 255, 255, 0.72);
}

.app-nav-link-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.app-nav-link-note {
    color: var(--brand-muted);
    font-size: 0.8rem;
    font-weight: 450;
}

.app-nav-link-label {
    font-weight: 550;
    font-size: 0.96rem;
}

.app-nav-link.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 16%, white), white);
    border-color: color-mix(in srgb, var(--brand-primary) 28%, white);
}

.app-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.9rem;
}

.app-user-card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    text-align: center;
    justify-items: center;
}

.app-user-card-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-secondary) 14%, white);
    color: var(--brand-secondary);
    font-size: 0.95rem;
    font-weight: 800;
}

.app-user-card small {
    color: var(--brand-muted);
    overflow-wrap: anywhere;
}

.app-user-card strong,
.app-sidebar-brand div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 1rem;
}

a {
    text-decoration: none;
}

.hero-shell,
.auth-shell,
.portal-shell {
    position: relative;
    min-height: 100vh;
}

.hero-backdrop,
.auth-backdrop {
    position: absolute;
    inset: 0;
    background-image: var(--brand-background);
    background-size: cover;
    background-position: center;
    opacity: 0.35;
}

.auth-backdrop {
    background-image: var(--brand-login-background);
}

.hero-card,
.auth-card,
.portal-card,
.portal-header {
    position: relative;
    z-index: 1;
}

.hero-card {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 2rem;
    align-items: stretch;
    max-width: 1160px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.hero-copy,
.hero-panel,
.auth-card,
.portal-card,
.portal-header {
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 12%, white);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.hero-copy,
.hero-panel,
.auth-card {
    border-radius: 28px;
    padding: 2rem;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 520px;
}

.hero-copy h1,
.auth-card h1,
.portal-header h1,
.empty-state h2,
.document-card h2,
.hero-panel h2 {
    margin: 0;
    font-family: var(--brand-font-heading);
}

.hero-copy h1 {
    font-size: clamp(2.8rem, 7vw, 5rem);
    line-height: 0.94;
    max-width: 11ch;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-primary) 14%, white);
    color: var(--brand-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead {
    color: var(--brand-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-actions,
.portal-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 16px 28px color-mix(in srgb, var(--brand-primary) 28%, transparent);
}

.button-secondary {
    color: var(--brand-text);
    background: white;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 18%, white);
}

.button-block {
    width: 100%;
}

.button-small {
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.button.is-disabled,
.button[aria-disabled='true'],
.button:disabled {
    opacity: 0.55;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.button-danger {
    color: white;
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--brand-primary) 10%, white), white 48%),
        white;
}

.hero-login-panel {
    gap: 1.2rem;
    justify-content: center;
    align-items: center;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.hero-login-form {
    margin-top: 0;
    width: 100%;
    max-width: 420px;
    align-self: center;
}

.brand-logo {
    display: block;
    width: auto;
    object-fit: contain;
}

.brand-logo-sidebar {
    max-width: 100%;
    max-height: 52px;
    margin: 0 auto;
}

.brand-logo-login {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
    align-self: center;
}

.feature-list {
    display: grid;
    gap: 0.85rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: min(100%, 460px);
}

.auth-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    background: white;
}

.field input:focus {
    outline: 2px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
    outline-offset: 2px;
}

.field-error {
    color: #b91c1c;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--brand-muted);
}

.portal-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem 0 3rem;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1.4rem;
    border-radius: 24px;
    margin-bottom: 1rem;
}

.portal-card {
    border-radius: 28px;
    padding: 1.2rem;
}

.document-browser-card {
    margin-top: 1rem;
    padding: 0;
    overflow: hidden;
}

.portal-admin-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.portal-inline-card {
    padding: 1.2rem;
}

.portal-admin-tools-bottom {
    margin-top: 1rem;
}

.document-toolbar {
    margin-bottom: 1rem;
}

.document-admin-panels {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.document-admin-panel {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.document-admin-panel p {
    margin: 0 0 0.8rem;
    color: var(--brand-muted);
}

.document-inline-form {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.document-hidden-form {
    display: none;
}

.account-section-header {
    margin-bottom: 1rem;
}

.account-section-header h2 {
    margin: 0;
    font-family: var(--brand-font-heading);
}

.account-section-header p {
    margin: 0.35rem 0 0;
    color: var(--brand-muted);
}

.account-card-spaced {
    margin-top: 1rem;
}

.move-actions-block {
    align-content: end;
}

.status-banner {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: color-mix(in srgb, var(--brand-primary) 10%, white);
    color: var(--brand-secondary);
}

.auth-brand + * {
    margin-top: 1.5rem;
}

.status-banner-error {
    background: #fee2e2;
    color: #991b1b;
}

.user-pill,
.document-folder,
.document-ext {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.84rem;
}

.user-pill,
.document-folder {
    background: color-mix(in srgb, var(--brand-primary) 12%, white);
    color: var(--brand-secondary);
}

.document-ext {
    background: color-mix(in srgb, var(--brand-accent) 18%, white);
    color: #8a4b00;
    text-transform: uppercase;
    font-weight: 700;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.library-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.library-stat {
    padding: 1.1rem 1.2rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.library-stat-label {
    display: block;
    color: var(--brand-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.library-stat strong {
    font-size: 1.4rem;
    font-family: var(--brand-font-heading);
}

.folder-jump-list {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.folder-jump {
    display: grid;
    gap: 0.2rem;
    min-width: 170px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--brand-text);
}

.folder-jump small {
    color: var(--brand-muted);
}

.folder-group-list {
    display: grid;
    gap: 1rem;
}

.doc-tree-card {
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.document-browser-header {
    display: grid;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.94);
}

.document-browser-title {
    min-width: 0;
}

.document-browser-header h2 {
    margin: 0;
    font-family: var(--brand-font-heading);
}

.document-browser-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.document-breadcrumbs {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.document-breadcrumb {
    color: var(--brand-text);
    font-weight: 700;
}

.document-breadcrumb.active {
    color: var(--brand-secondary);
}

.document-breadcrumb-separator {
    color: var(--brand-muted);
}

.document-table-wrap {
    max-height: min(62vh, 860px);
    overflow: auto;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.document-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(248, 250, 252, 0.96);
}

.document-table td,
.document-table th {
    white-space: nowrap;
}

.document-table td:nth-child(2),
.document-table th:nth-child(2) {
    width: 100%;
    white-space: normal;
}

.document-meta-col {
    text-align: right !important;
    white-space: nowrap;
}

.document-row-table {
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.document-row-table:hover {
    background: rgba(248, 250, 252, 0.96);
}

.document-row-table.is-selected {
    background: color-mix(in srgb, var(--brand-primary) 10%, white);
}

.document-entry {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
}

.document-entry-copy {
    min-width: 0;
}

.document-entry-copy strong,
.document-entry-link {
    display: block;
    font-weight: 700;
    color: var(--brand-text);
}

.document-entry-copy p {
    margin: 0.18rem 0 0;
    color: var(--brand-muted);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.doc-icon {
    position: relative;
    display: inline-flex;
    align-items: end;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
    height: 1.65rem;
    flex: 0 0 auto;
}

.doc-icon-folder-tab,
.doc-icon-folder-body,
.doc-icon-file-shape,
.doc-icon-file-label {
    position: absolute;
}

.doc-icon-folder-tab {
    top: 0.15rem;
    left: 0.18rem;
    width: 0.9rem;
    height: 0.38rem;
    border-radius: 0.22rem 0.22rem 0 0;
    background: linear-gradient(180deg, #fde68a, #facc15);
    border: 1px solid #eab308;
    border-bottom: none;
}

.doc-icon-folder-body {
    left: 0.08rem;
    right: 0.08rem;
    bottom: 0.08rem;
    height: 1rem;
    border-radius: 0.22rem;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    border: 1px solid #d97706;
}

.doc-icon-file-shape {
    left: 0.28rem;
    right: 0.28rem;
    bottom: 0.08rem;
    top: 0.08rem;
    border-radius: 0.22rem;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: inset 0 -0.7rem 0 rgba(241, 245, 249, 0.85);
}

.doc-icon-file-label {
    bottom: 0.18rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.05rem 0.22rem;
    border-radius: 999px;
    color: white;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #64748b;
}

.doc-icon-pdf .doc-icon-file-label {
    background: #b91c1c;
}

.doc-icon-doc .doc-icon-file-label {
    background: #1d4ed8;
}

.doc-icon-xls .doc-icon-file-label {
    background: #15803d;
}

.doc-icon-ppt .doc-icon-file-label {
    background: #c2410c;
}

.doc-icon-img .doc-icon-file-label {
    background: #7c3aed;
}

.doc-icon-zip .doc-icon-file-label {
    background: #374151;
}

.document-table-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--brand-muted);
}

.document-download-bar {
    margin: 0;
    padding: 1rem 1.2rem 1.2rem;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.context-menu {
    position: fixed;
    z-index: 40;
    min-width: 220px;
    padding: 0.45rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
}

.context-menu[hidden] {
    display: none;
}

.context-menu-item {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: none;
    border-radius: 12px;
    color: var(--brand-text);
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.context-menu-item:hover {
    background: color-mix(in srgb, var(--brand-primary) 10%, white);
}

.context-menu-divider {
    height: 1px;
    margin: 0.35rem 0;
    background: rgba(148, 163, 184, 0.22);
}

.doc-tree-header {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.doc-tree-header h2 {
    margin: 0;
    font-family: var(--brand-font-heading);
}

.doc-tree-header p {
    margin: 0.35rem 0 0;
    color: var(--brand-muted);
}

.doc-tree,
.doc-tree-children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.doc-tree {
    padding: 0.8rem;
}

.doc-tree-children {
    margin-left: 1.35rem;
    padding-left: 0.6rem;
    border-left: 2px solid rgba(148, 163, 184, 0.16);
}

.doc-tree-node + .doc-tree-node {
    margin-top: 0.4rem;
}

.doc-folder > summary {
    list-style: none;
}

.doc-folder > summary::-webkit-details-marker {
    display: none;
}

.doc-folder-summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.72);
}

.doc-folder-summary:hover,
.doc-file-row:hover {
    background: rgba(248, 250, 252, 0.96);
}

.drop-target {
    outline: 2px dashed color-mix(in srgb, var(--brand-primary) 45%, transparent);
    outline-offset: 2px;
}

.doc-folder-summary form {
    margin-left: auto;
}

.doc-folder-arrow {
    width: 0.9rem;
    text-align: center;
    color: #94a3b8;
    transition: transform 0.15s ease;
}

.doc-folder[open] > summary .doc-folder-arrow {
    transform: rotate(90deg);
}

.doc-folder-name {
    flex: 1;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-folder-meta {
    color: var(--brand-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.doc-folder-empty {
    padding: 0.55rem 0.9rem 0.55rem 2.5rem;
    color: #94a3b8;
    font-size: 0.88rem;
    font-style: italic;
}

.doc-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.doc-file-main {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.doc-file-selector {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.doc-item-selector {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.doc-file-main strong {
    display: block;
}

.doc-file-main p {
    margin: 0.18rem 0 0;
    color: var(--brand-muted);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.doc-file-meta {
    display: flex;
    gap: 0.9rem;
    color: var(--brand-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.doc-file-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.folder-group {
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.folder-group-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.folder-group-header h2 {
    margin: 0.45rem 0 0;
    font-size: 1.3rem;
}

.folder-summary-stats,
.document-inline-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.folder-summary-stats dt,
.document-inline-stats dt {
    color: var(--brand-muted);
    font-size: 0.8rem;
}

.folder-summary-stats dd,
.document-inline-stats dd {
    margin: 0.15rem 0 0;
    font-weight: 700;
}

.folder-file-list {
    display: grid;
    gap: 0.75rem;
}

.document-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.document-row-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.document-row-main h3 {
    margin: 0;
    font-size: 1rem;
}

.document-row-main p {
    margin: 0.2rem 0 0;
    color: var(--brand-muted);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.document-card {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.document-card h2 {
    font-size: 1.05rem;
    line-height: 1.35;
}

.document-meta,
.document-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.document-stats {
    justify-content: space-between;
}

.document-stats div {
    min-width: 96px;
}

.document-stats dt {
    color: var(--brand-muted);
    font-size: 0.82rem;
}

.document-stats dd {
    margin: 0.15rem 0 0;
    font-weight: 700;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-toolbar,
.bulk-bar {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.admin-search-field {
    flex: 1;
    min-width: min(100%, 320px);
}

.admin-toolbar-actions,
.bulk-bar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bulk-bar {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.bulk-bar-copy {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.table-sort-link {
    color: inherit;
}

.table-sort-link:hover {
    color: var(--brand-secondary);
}

.admin-check-col {
    width: 52px;
    text-align: center;
}

.admin-check-col input[type='checkbox'] {
    width: 18px;
    height: 18px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--brand-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field-full {
    grid-column: 1 / -1;
}

.field select {
    width: 100%;
    min-height: 48px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    background: white;
}

@media (max-width: 1440px) {
    .portal-shell {
        padding: 1.5rem 0 2.1rem;
    }

    .portal-header {
        padding: 1.2rem 1.25rem;
    }

    .portal-header h1 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 0.98rem;
    }

    .document-table th,
    .document-table td {
        padding: 0.85rem 0.75rem;
    }

    .button {
        font-size: 0.95rem;
    }

    .button-small {
        font-size: 0.86rem;
    }

    .app-nav-link-label {
        font-size: 0.95rem;
    }
}

@media (max-width: 1280px) {
    .app-content {
        padding: 0 0.85rem;
    }

    .portal-shell {
        padding: 1.2rem 0 1.7rem;
    }

    .app-sidebar-brand h2 {
        font-size: 1.25rem;
    }

    .app-nav-link {
        padding: 0.82rem 0.9rem;
    }

    .app-nav-link-label,
    .document-browser-header h2,
    .portal-header h1 {
        font-size: 0.96em;
    }

    .app-nav-link-label {
        font-size: 0.92rem;
    }

    .app-nav-link-note,
    .document-entry-copy p,
    .document-meta-col,
    .bulk-bar-copy,
    .lead {
        font-size: 0.9rem;
    }

    .document-table-wrap {
        max-height: min(58vh, 760px);
    }
}

@media (max-width: 1120px) {
    .document-browser-nav {
        gap: 0.55rem;
    }

    .document-breadcrumbs {
        gap: 0.3rem;
        font-size: 0.88rem;
    }

    .app-nav-link,
    .button {
        font-size: 0.92rem;
    }

    .app-nav-link-label {
        font-size: 0.88rem;
    }

    .app-nav-link-note,
    .button-small,
    .document-entry-copy p,
    .document-meta-col,
    .bulk-bar-copy {
        font-size: 0.84rem;
    }

}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-content {
        padding: 0 0.7rem;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: auto;
    }

    .portal-header {
        flex-direction: column;
    }

    .portal-shell {
        padding: 1rem 0 1.35rem;
    }

    .portal-card {
        padding: 0.9rem;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .library-overview {
        grid-template-columns: 1fr;
    }

    .portal-admin-tools {
        grid-template-columns: 1fr;
    }

    .document-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .folder-group-header,
    .document-row,
    .doc-file-row {
        grid-template-columns: 1fr;
    }

    .document-browser-nav {
        align-items: stretch;
    }

    .document-table td,
    .document-table th {
        white-space: normal;
    }

    .app-nav-link-label,
    .app-nav-link-note {
        white-space: normal;
    }

    .document-meta-col {
        text-align: left !important;
    }

    .doc-folder-summary {
        flex-wrap: wrap;
    }

    .doc-file-meta {
        flex-direction: column;
        gap: 0.2rem;
    }

    .doc-file-actions {
        justify-content: flex-start;
    }
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.confirm-modal-backdrop[hidden] {
    display: none;
}

.confirm-modal {
    width: min(100%, 420px);
    padding: 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    display: grid;
    gap: 0.75rem;
}

.confirm-modal-title {
    margin: 0;
    font-family: var(--brand-font-heading);
    font-size: 1.15rem;
}

.confirm-modal-message {
    margin: 0;
    color: var(--brand-muted);
    font-size: 0.94rem;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
