:root {
    --bg: #f5f7f9;
    --ink: #102a43;
    --muted: #486581;
    --panel: rgba(255, 255, 255, 0.9);
    --line: rgba(16, 42, 67, 0.12);
    --accent: #007d8a;
    --accent-2: #f58f29;
    --error: #b42318;
    --success: #027a48;
    --shadow: 0 18px 45px rgba(16, 42, 67, 0.12);
}

.theme-dark {
    --bg: #0b1420;
    --ink: #e5edf5;
    --muted: #92a8bc;
    --panel: rgba(18, 32, 48, 0.9);
    --line: rgba(148, 175, 201, 0.18);
    --shadow: 0 22px 56px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--ink);
    min-height: 100%;
}

h1,
h2,
h3,
strong,
.badge,
.btn {
    font-family: 'Sora', sans-serif;
}

a {
    color: inherit;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none;
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin: 8px 0 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.alert-error {
    border-color: color-mix(in srgb, var(--error) 35%, transparent);
    color: var(--error);
}

.alert-success {
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
    color: var(--success);
}

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(130deg, #4f6274, #6c7f91);
    box-shadow: 0 10px 20px rgba(79, 98, 116, 0.18);
}

.btn-light {
    background: #fff;
    border-color: var(--line);
}

.theme-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.theme-toggle {
    min-width: 132px;
}

.theme-toggle-block {
    width: 100%;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.94rem;
}

input[type='text'],
input[type='password'],
input[type='search'],
input[type='file'] {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 125, 138, 0.12);
}

.upload-native-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.stack {
    display: grid;
    gap: 12px;
}

.login-page {
    background: radial-gradient(circle at 15% 20%, #ffe9d0 0%, #f5f7f9 40%), linear-gradient(180deg, #f5f7f9, #ecf2f7);
    display: flex;
    overflow: hidden;
    min-height: 100dvh;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.35;
    z-index: 0;
    animation: float 10s ease-in-out infinite alternate;
}

.bg-orb-a {
    width: 320px;
    height: 320px;
    right: -90px;
    top: -90px;
    background: #ffd3a5;
}

.bg-orb-b {
    width: 360px;
    height: 360px;
    left: -140px;
    bottom: -130px;
    background: #9ee7ef;
    animation-delay: 0.6s;
}

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: 26px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.login-card {
    width: min(520px, 95vw);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    border-radius: 24px;
    padding: 28px;
    backdrop-filter: blur(10px);
    animation: rise 0.45s ease;
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    background: #e3f8fb;
    color: #0b7285;
    margin: 0 0 14px;
}

.app-page {
    background: linear-gradient(150deg, #f8fafc, #e8f2f4 46%, #fdf6ee);
}

.app-bg {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(16, 42, 67, 0.06) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, #000 40%, transparent 95%);
    pointer-events: none;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    padding: 14px 16px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.side-link {
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.side-link-danger {
    color: #b42318;
}

.role-pill {
    margin: 0 0 8px;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.role-admin {
    background: #ffe5cf;
    color: #a04604;
}

.role-techniker {
    background: #def7ec;
    color: #05603a;
}

.content {
    padding: 12px 20px 22px;
    display: grid;
    gap: 12px;
}

.content-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
}

.crumbs a {
    text-decoration: none;
    color: #475c6d;
}

.crumbs-card {
    margin-bottom: 10px;
}

.card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 18px;
    animation: rise 0.35s ease;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}

.card-head h3 {
    margin: 0 0 4px;
}

.card-head p {
    margin: 0;
}

.card-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    min-width: min(260px, 70vw);
}

.view-switch {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.8);
    display: inline-flex;
    gap: 4px;
}

.view-btn {
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 7px 11px;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
}

.view-btn.is-active {
    background: #d8f3f6;
    color: #0b7285;
}

.card-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.entry-grid {
    display: grid;
    gap: 10px;
}

.entry-grid.mode-list {
    grid-template-columns: 1fr;
}

.entry-grid.mode-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.entry {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    border-radius: 14px;
    padding: 12px;
    text-decoration: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    transition: transform 0.14s ease, border-color 0.14s ease;
}

.entry:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 125, 138, 0.45);
}

.entry-clickable {
    cursor: pointer;
}

.entry-clickable:focus-visible {
    outline: 3px solid rgba(0, 125, 138, 0.25);
    outline-offset: 2px;
}

.entry-folder {
    color: #0b7285;
}

.entry-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: #e8f7f9;
    color: #0b7285;
}

.entry-file .entry-icon {
    background: #fff0dd;
    color: #a04604;
}

.entry-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.entry-main strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-main small {
    color: var(--muted);
}

.entry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-entry-tools {
    justify-content: flex-end;
}

.entry-grid.mode-grid .entry {
    min-height: 122px;
}

.entry-grid.mode-grid .entry.entry-folder {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.entry-grid.mode-grid .entry.entry-file {
    grid-template-columns: 1fr;
    align-items: flex-start;
}

.entry-grid.mode-grid .entry-actions {
    grid-column: 1 / -1;
}

.entry-grid.mode-grid .entry.entry-file .entry-preview {
    width: 100%;
    height: 138px;
}

.entry-icon-logo {
    width: 92px;
    height: 52px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(16, 42, 67, 0.08);
}

.entry-icon-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.entry-preview {
    width: 92px;
    height: 68px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(16, 42, 67, 0.08);
    background: linear-gradient(180deg, #f8fbfd 0%, #edf4f8 100%);
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
}

.entry-preview-canvas {
    display: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(16, 42, 67, 0.08);
    background: #ffffff;
}

.entry-preview-fallback {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #7c4a13;
}

.entry-preview[data-preview-state='ready'] .entry-preview-canvas {
    display: block;
}

.entry-preview[data-preview-state='ready'] .entry-preview-fallback {
    display: none;
}

.entry-preview[data-preview-state='error'] .entry-preview-fallback {
    color: #8a5a24;
}

.is-hidden {
    display: none !important;
}

.empty {
    color: var(--muted);
    margin: 10px 2px;
}

.upload-dropzone {
    border: 2px dashed rgba(0, 125, 138, 0.25);
    border-radius: 16px;
    padding: 18px 16px;
    background: linear-gradient(180deg, #f8fcfd 0%, #eef7f9 100%);
    justify-items: center;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: rgba(0, 125, 138, 0.55);
    background: linear-gradient(180deg, #f2fbfc 0%, #e4f5f8 100%);
    transform: translateY(-1px);
}

.upload-dropzone strong {
    color: var(--ink);
}

.upload-file-name {
    font-weight: 600;
    color: #0b7285;
    word-break: break-word;
}

.viewer-page {
    background: #f0f6f8;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.viewer-toolbar {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.viewer-toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.viewer-title {
    min-width: 220px;
    max-width: min(54vw, 760px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-search,
.toolbar-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-search input {
    min-width: min(340px, 74vw);
}

.viewer-hint {
    font-size: 0.86rem;
}

.viewer-main {
    padding: 12px;
    overflow-y: auto;
    overflow-x: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y proximity;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.pdf-document {
    width: fit-content;
    min-width: 100%;
    max-width: none;
    margin: 0 auto;
    display: grid;
    gap: 14px;
    justify-items: start;
    justify-content: start;
}

.pdf-document.is-pinching {
    will-change: transform;
}

.pdf-page {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(16, 42, 67, 0.08);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
}

.page-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #0b7285;
    background: rgba(227, 248, 251, 0.92);
    border: 1px solid rgba(16, 42, 67, 0.1);
}

.page-canvas {
    display: block;
    background: #fff;
}

.text-layer {
    position: absolute;
    inset: 0;
    color: transparent;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
}

.text-item {
    position: absolute;
    white-space: pre;
    transform-origin: 0 0;
    color: transparent;
}

.text-item mark.search-hit {
    background: rgba(255, 197, 64, 0.62);
    color: transparent;
    border-radius: 2px;
}

.text-item mark.search-hit.is-active {
    background: rgba(255, 138, 0, 0.82);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    from {
        transform: translateY(0) scale(1);
    }
    to {
        transform: translateY(24px) scale(1.03);
    }
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
    }

    .content {
        padding: 8px 10px 14px;
    }

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

    .entry {
        grid-template-columns: auto 1fr;
    }

    .entry-actions {
        grid-column: 1 / -1;
    }

    .search-input {
        min-width: min(220px, 74vw);
    }

    .viewer-toolbar {
        padding: 10px;
        gap: 8px;
    }

    .viewer-toolbar-top {
        align-items: stretch;
    }

    .viewer-title {
        min-width: 0;
        max-width: 100%;
        flex: 1 1 100%;
        order: 3;
        font-size: 0.96rem;
    }

    .toolbar-pages {
        justify-content: space-between;
        width: 100%;
    }

    .toolbar-search {
        width: 100%;
        display: grid;
        gap: 6px;
    }

    .toolbar-search input {
        min-width: 0;
        width: 100%;
    }

    .toolbar-search-actions {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .toolbar-search-actions .muted {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .toolbar-search .btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 10px;
    }

    .toolbar-pages {
        justify-content: flex-end;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .toolbar-pages .btn,
    .toolbar-pages span {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .viewer-hint {
        display: none;
    }

    .viewer-main {
        padding: 8px;
    }

    .pdf-document {
        gap: 10px;
    }

    .page-badge {
        font-size: 0.68rem;
        top: 6px;
        right: 6px;
    }
}

/* Dashboard redesign */
.dashboard-redesign {
    background: radial-gradient(circle at 8% 4%, #e7f2f4 0%, #edf3f6 22%, #f7f9fb 62%);
}

.dashboard-redesign .dash-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.dashboard-redesign .dash-sidebar {
    padding: 22px 16px;
    background: linear-gradient(180deg, #0f2c44 0%, #143851 38%, #154663 100%);
    color: #e9f2f7;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    align-content: start;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.dashboard-redesign .dash-kicker {
    margin: 0 0 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #9fc3d8;
}

.dashboard-redesign .dash-brand-link {
    display: block;
    width: 100%;
    max-width: 208px;
    text-decoration: none;
}

.dashboard-redesign .dash-brand-logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 56px;
    object-fit: contain;
}

.dashboard-redesign .dash-mobile-nav-input,
.dashboard-redesign .dash-mobile-toggle {
    display: none;
}

.dashboard-redesign .dash-brand h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #ffffff;
}

.dashboard-redesign .dash-nav {
    display: grid;
    gap: 8px;
}

.dashboard-redesign .dash-nav-link {
    text-decoration: none;
    color: #d8e8f2;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.dashboard-redesign .dash-nav-link:hover,
.dashboard-redesign .dash-nav-link.is-active {
    background: rgba(0, 195, 214, 0.18);
    border-color: rgba(0, 195, 214, 0.38);
    transform: translateY(-1px);
}

.dashboard-redesign .dash-nav-link-danger {
    color: #ffd8cf;
}

.dashboard-redesign .dash-role-card {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.16);
}

.dashboard-redesign .dash-theme-toggle {
    margin-top: 10px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 8px 10px;
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
}

.dashboard-redesign .dash-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dashboard-redesign .dash-main {
    padding: 14px 18px 24px;
    display: grid;
    align-content: start;
    gap: 12px;
}

.dashboard-redesign .dash-header {
    border: 1px solid rgba(16, 42, 67, 0.08);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 250, 252, 0.94));
    padding: 14px 16px;
    box-shadow: 0 16px 38px rgba(16, 42, 67, 0.08);
    display: grid;
    gap: 8px;
}

.dashboard-redesign .dash-header h1 {
    margin: 0 0 2px;
    font-size: 1.3rem;
}

.dashboard-redesign .dash-header p {
    margin: 0;
}

.dashboard-redesign .dash-crumbs {
    font-size: 0.9rem;
}

.dashboard-redesign .dash-file-card {
    border-radius: 18px;
    border: 1px solid rgba(16, 42, 67, 0.08);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 42px rgba(16, 42, 67, 0.1);
}

.dashboard-redesign .card-head {
    gap: 12px;
}

.dashboard-redesign .card-tools {
    margin-left: auto;
}

.dashboard-redesign .search-input {
    min-width: min(360px, 74vw);
    border-radius: 12px;
    border-color: rgba(16, 42, 67, 0.18);
    background: #fff;
}

.dashboard-redesign .view-switch {
    background: #f5fbfd;
    border-color: rgba(16, 42, 67, 0.12);
}

.dashboard-redesign .view-btn {
    color: #34526b;
}

.dashboard-redesign .view-btn.is-active {
    background: #cff4f9;
    color: #0d7c8a;
}

.dashboard-redesign .entry {
    background: #ffffff;
    border-color: rgba(16, 42, 67, 0.11);
    border-radius: 14px;
    padding: 13px;
    box-shadow: 0 6px 14px rgba(16, 42, 67, 0.05);
}

.dashboard-redesign .entry:hover {
    border-color: rgba(0, 125, 138, 0.5);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.08);
}

.dashboard-redesign .entry-icon {
    border-radius: 12px;
}

.dashboard-redesign .entry-preview {
    border-radius: 12px;
}

.dashboard-redesign .entry-folder .entry-icon {
    background: #e8f7f9;
}

.dashboard-redesign .entry-file .entry-icon {
    background: #fff1dd;
}

.dashboard-redesign .entry-main strong {
    font-size: 0.98rem;
}

.dashboard-redesign .entry-main small {
    font-size: 0.84rem;
}

.dashboard-redesign .dash-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 12px;
}

.dashboard-redesign .dash-admin-card {
    border-radius: 16px;
    border: 1px solid rgba(16, 42, 67, 0.1);
    box-shadow: 0 12px 28px rgba(16, 42, 67, 0.08);
}

.dashboard-redesign .dash-admin-card h3 {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .dashboard-redesign .dash-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-redesign .dash-sidebar {
        position: static;
        height: auto;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 10px;
        padding: 12px;
    }

    .dashboard-redesign .dash-brand {
        min-width: 0;
    }

    .dashboard-redesign .dash-brand-link {
        max-width: 180px;
    }

    .dashboard-redesign .dash-brand h2 {
        font-size: 1.1rem;
    }

    .dashboard-redesign .dash-kicker {
        margin: 0 0 4px;
    }

    .dashboard-redesign .dash-nav {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .dashboard-redesign .dash-role-card {
        justify-self: end;
    }
}

@media (max-width: 760px) {
    .dashboard-redesign .dash-sidebar {
        grid-template-columns: minmax(0, 1fr) auto;
        justify-items: stretch;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 12px;
    }

    .dashboard-redesign .dash-main {
        padding: 10px;
    }

    .dashboard-redesign .dash-brand {
        min-width: 0;
    }

    .dashboard-redesign .dash-brand-link {
        max-width: 160px;
    }

    .dashboard-redesign .dash-mobile-nav-input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .dashboard-redesign .dash-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 12px;
        border: 1px solid rgba(16, 42, 67, 0.12);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.9);
        color: #29485f;
        font-family: 'Sora', sans-serif;
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
        justify-self: end;
    }

    .dashboard-redesign .dash-mobile-nav-input:checked + .dash-mobile-toggle {
        background: #dff6fa;
        border-color: rgba(0, 125, 138, 0.28);
        color: #0d7c8a;
    }

    .dashboard-redesign .dash-nav,
    .dashboard-redesign .dash-role-card {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 2px;
    }

    .dashboard-redesign .dash-mobile-nav-input:checked ~ .dash-nav {
        display: grid;
        gap: 8px;
    }

    .dashboard-redesign .dash-mobile-nav-input:checked ~ .dash-role-card {
        display: block;
    }

    .dashboard-redesign .dash-header {
        padding: 12px;
    }

    .dashboard-redesign .dash-header h1 {
        font-size: 1.1rem;
    }

    .dashboard-redesign .card-tools {
        width: 100%;
        margin-left: 0;
    }

    .dashboard-redesign .dash-role-card {
        padding: 10px 12px;
    }

    .dashboard-redesign .search-input {
        min-width: 0;
        width: 100%;
    }

    .dashboard-redesign .dash-admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard variant V2 */
.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #f2f6fb 0%, #f7fafc 48%, #f0f5fa 100%);
}

.dashboard-redesign.dashboard-theme-v2 .dash-shell {
    grid-template-columns: 240px 1fr;
    gap: 0;
}

.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #ffffff;
    color: var(--ink);
    border-right: 1px solid rgba(16, 42, 67, 0.1);
    box-shadow: inset -1px 0 0 rgba(16, 42, 67, 0.06);
}

.dashboard-redesign.dashboard-theme-v2 .dash-kicker {
    color: #5b7a91;
}

.dashboard-redesign.dashboard-theme-v2 .dash-brand h2 {
    color: #0f2c44;
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link {
    color: #29485f;
    border-color: rgba(16, 42, 67, 0.13);
    background: #f9fcff;
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link:hover,
.dashboard-redesign.dashboard-theme-v2 .dash-nav-link.is-active {
    background: #e8f4ff;
    border-color: rgba(33, 128, 191, 0.45);
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link-danger {
    color: #b42318;
}

.dashboard-redesign.dashboard-theme-v2 .dash-role-card {
    background: #f5f9fd;
    border-color: rgba(16, 42, 67, 0.12);
}

.dashboard-redesign.dashboard-theme-v2 .dash-theme-toggle {
    border-color: rgba(16, 42, 67, 0.18);
    background: #ffffff;
    color: #16374f;
}

.dashboard-redesign.dashboard-theme-v2 .dash-theme-toggle:hover {
    background: #eef6ff;
}

.dashboard-redesign.dashboard-theme-v2 .dash-main {
    padding: 16px 20px 24px;
    gap: 14px;
}

.dashboard-redesign.dashboard-theme-v2 .dash-header {
    border-radius: 16px;
    border: 1px solid rgba(16, 42, 67, 0.1);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .dash-header h1 {
    font-size: 1.2rem;
}

.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    border-radius: 16px;
    border: 1px solid rgba(16, 42, 67, 0.11);
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .entry {
    border-radius: 12px;
    box-shadow: none;
    border-color: rgba(16, 42, 67, 0.12);
}

.dashboard-redesign.dashboard-theme-v2 .entry:hover {
    box-shadow: 0 8px 16px rgba(16, 42, 67, 0.1);
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder {
    color: #0f4a66;
}

.dashboard-redesign.dashboard-theme-v2 .entry-icon {
    width: 42px;
    height: 42px;
}

.dashboard-redesign.dashboard-theme-v2 .entry-icon-logo {
    width: 96px;
    height: 54px;
    background: #ffffff;
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon {
    background: #e7f2ff;
    color: #1769aa;
}

.dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon {
    background: #fff2e5;
    color: #a64b00;
}

.dashboard-redesign.dashboard-theme-v2 .entry-preview {
    border-color: rgba(16, 42, 67, 0.1);
    background: linear-gradient(180deg, #f7fbff 0%, #edf4fb 100%);
}

.dashboard-redesign.dashboard-theme-v2 .search-input {
    border-radius: 10px;
}

.dashboard-redesign.dashboard-theme-v2 .view-switch {
    border-radius: 10px;
}

.dashboard-redesign.dashboard-theme-v2 .view-btn {
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .dashboard-redesign.dashboard-theme-v2 .dash-shell {
        grid-template-columns: 1fr;
    }

.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
        box-shadow: none;
    }
}

.theme-dark body {
    background: var(--bg);
}

.theme-dark .alert {
    background: rgba(17, 31, 47, 0.92);
    border-color: rgba(148, 175, 201, 0.16);
}

.theme-dark .btn-light {
    background: rgba(17, 31, 47, 0.92);
    border-color: rgba(148, 175, 201, 0.2);
    color: var(--ink);
}

.theme-dark input[type='text'],
.theme-dark input[type='password'],
.theme-dark input[type='search'],
.theme-dark input[type='file'] {
    background: rgba(12, 24, 38, 0.96);
    border-color: rgba(148, 175, 201, 0.18);
    color: var(--ink);
}

.theme-dark input::placeholder {
    color: #7f97ac;
}

.theme-dark .login-page {
    background: radial-gradient(circle at 18% 18%, #162635 0%, #0b1420 42%), linear-gradient(180deg, #08121c, #101b29);
}

.theme-dark .bg-orb-a {
    background: #18455a;
    opacity: 0.28;
}

.theme-dark .bg-orb-b {
    background: #16324a;
    opacity: 0.26;
}

.theme-dark .login-card {
    background: rgba(13, 24, 37, 0.86);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark .badge {
    background: rgba(0, 125, 138, 0.18);
    color: #7ee7f2;
}

.theme-dark .app-page {
    background: linear-gradient(150deg, #0a1622, #0d1928 46%, #111f2d);
}

.theme-dark .app-bg {
    background-image: radial-gradient(rgba(148, 175, 201, 0.08) 1px, transparent 1px);
}

.theme-dark .sidebar {
    background: rgba(10, 20, 31, 0.84);
}

.theme-dark .side-link {
    background: rgba(18, 32, 48, 0.9);
}

.theme-dark .role-admin {
    background: rgba(245, 143, 41, 0.14);
    color: #ffc98f;
}

.theme-dark .role-techniker {
    background: rgba(2, 122, 72, 0.18);
    color: #8ef0c0;
}

.theme-dark .crumbs a,
.theme-dark .upload-file-name {
    color: #7ee7f2;
}

.theme-dark .card {
    background: rgba(17, 31, 47, 0.86);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark .view-switch {
    background: rgba(10, 20, 31, 0.9);
}

.theme-dark .view-btn {
    color: var(--muted);
}

.theme-dark .view-btn.is-active {
    background: rgba(0, 125, 138, 0.22);
    color: #89edf7;
}

.theme-dark .entry {
    background: rgba(12, 24, 38, 0.95);
}

.theme-dark .entry-folder {
    color: #89edf7;
}

.theme-dark .entry-icon {
    background: rgba(0, 125, 138, 0.16);
    color: #8eeff8;
}

.theme-dark .entry-file .entry-icon {
    background: rgba(245, 143, 41, 0.14);
    color: #ffc88d;
}

.theme-dark .entry-icon-logo {
    background: rgba(255, 255, 255, 0.96);
}

.theme-dark .entry-preview {
    border-color: rgba(148, 175, 201, 0.16);
    background: linear-gradient(180deg, #101c29 0%, #152435 100%);
}

.theme-dark .upload-dropzone {
    background: linear-gradient(180deg, #0e1a28 0%, #132231 100%);
    border-color: rgba(0, 125, 138, 0.3);
}

.theme-dark .upload-dropzone:hover,
.theme-dark .upload-dropzone.is-dragover {
    background: linear-gradient(180deg, #122131 0%, #173045 100%);
}

.theme-dark .viewer-page {
    background: #08121c;
}

.theme-dark .viewer-toolbar {
    background: rgba(9, 18, 28, 0.92);
}

.theme-dark .pdf-page {
    border-color: rgba(148, 175, 201, 0.12);
    background: #dfe8f2;
}

.theme-dark .page-badge {
    color: #d4faff;
    background: rgba(0, 125, 138, 0.18);
    border-color: rgba(126, 231, 242, 0.16);
}

.theme-dark.dashboard-redesign {
    background: radial-gradient(circle at 8% 4%, #102232 0%, #0b1623 22%, #0a1320 62%);
}

.theme-dark.dashboard-redesign .dash-sidebar {
    background: linear-gradient(180deg, #09111b 0%, #0d1824 38%, #122234 100%);
    color: #dfeaf2;
    border-right-color: rgba(148, 175, 201, 0.12);
}

.theme-dark.dashboard-redesign .dash-nav-link {
    color: #d8e8f2;
    border-color: rgba(148, 175, 201, 0.14);
    background: rgba(148, 175, 201, 0.04);
}

.theme-dark.dashboard-redesign .dash-nav-link:hover,
.theme-dark.dashboard-redesign .dash-nav-link.is-active {
    background: rgba(0, 125, 138, 0.18);
    border-color: rgba(0, 195, 214, 0.26);
}

.theme-dark.dashboard-redesign .dash-role-card {
    background: rgba(10, 20, 31, 0.56);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark.dashboard-redesign .dash-theme-toggle {
    background: rgba(17, 31, 47, 0.9);
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark.dashboard-redesign .dash-header,
.theme-dark.dashboard-redesign .dash-file-card,
.theme-dark.dashboard-redesign .dash-admin-card {
    background: rgba(16, 28, 42, 0.94);
    border-color: rgba(148, 175, 201, 0.12);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.theme-dark.dashboard-redesign .search-input {
    background: rgba(12, 24, 38, 0.96);
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark.dashboard-redesign .view-switch {
    background: rgba(10, 20, 31, 0.92);
}

.theme-dark.dashboard-redesign .view-btn {
    color: var(--muted);
}

.theme-dark.dashboard-redesign .view-btn.is-active {
    background: rgba(0, 125, 138, 0.22);
    color: #8eeff8;
}

.theme-dark.dashboard-redesign .entry {
    background: rgba(12, 24, 38, 0.96);
    border-color: rgba(148, 175, 201, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.theme-dark.dashboard-redesign .entry:hover {
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22);
}

.theme-dark.dashboard-redesign .entry-folder {
    color: #8eeff8;
}

.theme-dark.dashboard-redesign .entry-folder .entry-icon {
    background: rgba(0, 125, 138, 0.16);
    color: #8eeff8;
}

.theme-dark.dashboard-redesign .entry-file .entry-icon {
    background: rgba(245, 143, 41, 0.14);
    color: #ffc88d;
}

.theme-dark.dashboard-redesign .entry-preview {
    background: linear-gradient(180deg, #0f1c2a 0%, #142333 100%);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #08121c 0%, #0b1623 48%, #0f1d2a 100%);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #0c1622;
    color: #dfeaf2;
    border-right-color: rgba(148, 175, 201, 0.12);
    box-shadow: inset -1px 0 0 rgba(148, 175, 201, 0.08);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link {
    color: #d8e8f2;
    border-color: rgba(148, 175, 201, 0.14);
    background: rgba(148, 175, 201, 0.04);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link-danger {
    color: #ffb9ae;
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-role-card {
    background: rgba(17, 31, 47, 0.9);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-theme-toggle {
    background: rgba(12, 24, 38, 0.96);
    border-color: rgba(148, 175, 201, 0.18);
    color: #dfeaf2;
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-header,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(16, 28, 42, 0.94);
    border-color: rgba(148, 175, 201, 0.12);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry {
    box-shadow: none;
}

.theme-dark.dashboard-redesign .dash-mobile-toggle,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-mobile-toggle {
    background: rgba(17, 31, 47, 0.94);
    color: #dfeaf2;
    border-color: rgba(148, 175, 201, 0.16);
}

.theme-dark.dashboard-redesign .dash-mobile-nav-input:checked + .dash-mobile-toggle,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-mobile-nav-input:checked + .dash-mobile-toggle {
    background: rgba(0, 125, 138, 0.18);
    color: #8eeff8;
    border-color: rgba(126, 231, 242, 0.16);
}

/* Calm UI refinements */
.btn-light {
    color: #21313f;
}

.entry-actions {
    align-items: center;
}

.entry-admin-menu {
    position: relative;
}

.entry-admin-menu > summary {
    list-style: none;
}

.entry-admin-menu > summary::-webkit-details-marker {
    display: none;
}

.entry-admin-menu[open] > summary {
    background: #eef2f6;
    border-color: rgba(16, 42, 67, 0.14);
}

.entry-admin-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    display: none;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(16, 42, 67, 0.1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 24px rgba(16, 42, 67, 0.08);
    z-index: 6;
}

.entry-admin-menu[open] .entry-admin-menu-panel {
    display: grid;
}

.entry-admin-menu-panel .btn {
    width: 100%;
}

.dash-admin-intro {
    margin: -2px 0 14px;
}

.pro-tools-panel {
    border: 1px solid rgba(16, 42, 67, 0.1);
    border-radius: 16px;
    background: #fafbfc;
}

.pro-tools-panel > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-family: 'Sora', sans-serif;
    font-size: 0.94rem;
    color: #243746;
}

.pro-tools-panel > summary::-webkit-details-marker {
    display: none;
}

.pro-tools-panel > summary::after {
    content: '+';
    float: right;
    color: #6b7b88;
    font-size: 1.05rem;
}

.pro-tools-panel[open] > summary::after {
    content: '-';
}

.pro-tools-body {
    padding: 0 16px 16px;
    display: grid;
    gap: 16px;
}

.pro-tools-divider {
    height: 1px;
    background: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #f3f4f6 0%, #f6f7f8 48%, #f1f3f5 100%);
}

.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #f4f5f6;
    border-right-color: rgba(16, 42, 67, 0.08);
    box-shadow: inset -1px 0 0 rgba(16, 42, 67, 0.04);
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link {
    color: #364a5a;
    border-color: rgba(16, 42, 67, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link:hover,
.dashboard-redesign.dashboard-theme-v2 .dash-nav-link.is-active {
    background: #ffffff;
    border-color: rgba(16, 42, 67, 0.16);
}

.dashboard-redesign.dashboard-theme-v2 .dash-role-card,
.dashboard-redesign.dashboard-theme-v2 .dash-header,
.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(16, 42, 67, 0.08);
    box-shadow: 0 8px 20px rgba(16, 42, 67, 0.05);
}

.dashboard-redesign.dashboard-theme-v2 .dash-theme-toggle {
    background: #f7f8fa;
    border-color: rgba(16, 42, 67, 0.12);
}

.dashboard-redesign.dashboard-theme-v2 .search-input {
    background: #ffffff;
    border-color: rgba(16, 42, 67, 0.12);
}

.dashboard-redesign.dashboard-theme-v2 .view-switch {
    background: #f3f4f6;
    border-color: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .view-btn {
    color: #5e7282;
}

.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active {
    background: #ffffff;
    color: #2e4251;
    box-shadow: inset 0 0 0 1px rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .entry {
    background: #fcfcfd;
    border-color: rgba(16, 42, 67, 0.08);
    box-shadow: none;
}

.dashboard-redesign.dashboard-theme-v2 .entry:hover {
    border-color: rgba(16, 42, 67, 0.16);
    box-shadow: none;
    transform: translateY(-1px);
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder {
    color: #334654;
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon {
    background: #f1f3f5;
    color: #506371;
}

.dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon {
    background: #f5f6f8;
    color: #667787;
}

.dashboard-redesign.dashboard-theme-v2 .entry-preview {
    background: linear-gradient(180deg, #fafafa 0%, #f1f3f6 100%);
    border-color: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign .dash-admin-grid {
    grid-template-columns: minmax(0, 1fr);
}

.theme-dark .btn-light {
    color: #dbe5ee;
}

.theme-dark .entry-admin-menu[open] > summary {
    background: rgba(24, 40, 56, 0.96);
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark .entry-admin-menu-panel {
    border-color: rgba(148, 175, 201, 0.14);
    background: rgba(15, 25, 38, 0.98);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
}

.theme-dark .pro-tools-panel {
    background: rgba(12, 24, 38, 0.92);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark .pro-tools-panel > summary {
    color: #dbe5ee;
}

.theme-dark .pro-tools-panel > summary::after {
    color: #9fb0bf;
}

.theme-dark .pro-tools-divider {
    background: rgba(148, 175, 201, 0.12);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #0f141a 0%, #121820 48%, #141b24 100%);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #111821;
    border-right-color: rgba(148, 175, 201, 0.1);
    box-shadow: inset -1px 0 0 rgba(148, 175, 201, 0.04);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(148, 175, 201, 0.12);
    color: #dbe5ee;
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link:hover,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link.is-active {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 175, 201, 0.2);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-role-card,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-header,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(20, 27, 36, 0.96);
    border-color: rgba(148, 175, 201, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry {
    background: rgba(17, 24, 33, 0.98);
    border-color: rgba(148, 175, 201, 0.1);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry:hover {
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active,
.theme-dark .page-badge,
.theme-dark .crumbs a,
.theme-dark .upload-file-name {
    color: #dbe5ee;
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-preview {
    background: linear-gradient(180deg, #181f27 0%, #202933 100%);
    border-color: rgba(148, 175, 201, 0.1);
}

@media (max-width: 980px) {
    .entry-admin-menu-panel {
        right: auto;
        left: 0;
    }
}

body.has-overlay {
    overflow: hidden;
}

.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #f3f4f6 0%, #f6f7f8 46%, #f2f3f5 100%);
}

.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #f5f5f6;
    border-right-color: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .dash-nav-link,
.dashboard-redesign.dashboard-theme-v2 .dash-theme-toggle,
.dashboard-redesign.dashboard-theme-v2 .dash-role-card {
    background: rgba(255, 255, 255, 0.88);
}

.dashboard-redesign.dashboard-theme-v2 .dash-header,
.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(16, 42, 67, 0.08);
    box-shadow: 0 8px 22px rgba(16, 42, 67, 0.05);
}

.dashboard-redesign.dashboard-theme-v2 .entry {
    background: #fcfcfd;
    border-color: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .entry:hover {
    border-color: rgba(16, 42, 67, 0.14);
    box-shadow: none;
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder,
.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active,
.dashboard-redesign.dashboard-theme-v2 .upload-file-name {
    color: #344855;
}

.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon,
.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active {
    background: #f1f3f5;
}

.dashboard-redesign.dashboard-theme-v2 .view-switch {
    background: #f3f4f6;
    border-color: rgba(16, 42, 67, 0.08);
}

.dashboard-redesign.dashboard-theme-v2 .dash-admin-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    align-items: start;
}

.pro-tools-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(520px, 100vw);
}

.pro-tools-overlay.hidden {
    display: none;
}

.pro-tools-overlay-backdrop {
    background: rgba(20, 29, 37, 0.28);
    backdrop-filter: blur(2px);
}

.pro-tools-overlay-panel {
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid rgba(16, 42, 67, 0.08);
    background: #ffffff;
    box-shadow: -22px 0 44px rgba(16, 42, 67, 0.08);
    padding: 22px;
    display: grid;
    align-content: start;
    gap: 18px;
    animation: overlaySlideIn 0.18s ease;
}

.pro-tools-overlay-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pro-tools-overlay-header h3 {
    margin: 0 0 4px;
}

.pro-tools-overlay-header p {
    margin: 0;
}

.pro-tools-overlay-body {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(16, 42, 67, 0.08);
    border-radius: 18px;
    background: #fafbfc;
}

.pro-tools-overlay-body .upload-dropzone {
    background: linear-gradient(180deg, #fafbfc 0%, #f2f4f6 100%);
    border-color: rgba(16, 42, 67, 0.14);
}

.pro-tools-overlay-body .upload-dropzone:hover,
.pro-tools-overlay-body .upload-dropzone.is-dragover {
    background: linear-gradient(180deg, #f5f7f8 0%, #eceff2 100%);
    border-color: rgba(16, 42, 67, 0.22);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #11161d 0%, #151b23 46%, #181f28 100%);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #141a22;
    border-right-color: rgba(148, 175, 201, 0.1);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-nav-link,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-role-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(148, 175, 201, 0.12);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-header,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(24, 31, 40, 0.96);
    border-color: rgba(148, 175, 201, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry {
    background: rgba(18, 25, 33, 0.98);
    border-color: rgba(148, 175, 201, 0.1);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry:hover {
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .upload-file-name {
    color: #dbe5ee;
}

.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon,
.theme-dark.dashboard-redesign.dashboard-theme-v2 .view-btn.is-active {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .pro-tools-overlay-backdrop {
    background: rgba(6, 10, 15, 0.5);
}

.theme-dark .pro-tools-overlay-panel {
    background: #161d26;
    border-left-color: rgba(148, 175, 201, 0.1);
    box-shadow: -22px 0 44px rgba(0, 0, 0, 0.34);
}

.theme-dark .pro-tools-overlay-body {
    background: rgba(18, 25, 33, 0.98);
    border-color: rgba(148, 175, 201, 0.1);
}

.theme-dark .pro-tools-overlay-body .upload-dropzone {
    background: linear-gradient(180deg, #1a222c 0%, #202932 100%);
    border-color: rgba(148, 175, 201, 0.14);
}

.theme-dark .pro-tools-overlay-body .upload-dropzone:hover,
.theme-dark .pro-tools-overlay-body .upload-dropzone.is-dragover {
    background: linear-gradient(180deg, #202932 0%, #27323d 100%);
    border-color: rgba(148, 175, 201, 0.22);
}

@keyframes overlaySlideIn {
    from {
        transform: translateX(16px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 980px) {
    .dashboard-redesign.dashboard-theme-v2 .dash-admin-grid {
        grid-template-columns: 1fr;
    }

    .pro-tools-overlay {
        grid-template-columns: 1fr;
    }

    .pro-tools-overlay-backdrop {
        display: none;
    }

    .pro-tools-overlay-panel {
        width: 100%;
        border-left: none;
        box-shadow: none;
        padding: 16px;
    }

    .pro-tools-overlay-body {
        padding: 14px;
    }
}

/* Dark mode fixes: theme class is on <html>, dashboard classes are on <body>. */
.theme-dark .dashboard-redesign.dashboard-theme-v2 {
    background: linear-gradient(180deg, #11161d 0%, #151b23 46%, #181f28 100%);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-sidebar {
    background: #141a22;
    border-right-color: rgba(148, 175, 201, 0.1);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-nav-link,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-role-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(148, 175, 201, 0.12);
    color: #dbe5ee;
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-header,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-file-card,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .dash-admin-card {
    background: rgba(24, 31, 40, 0.96);
    border-color: rgba(148, 175, 201, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .search-input,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .view-switch {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(148, 175, 201, 0.12);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .view-btn {
    color: #aab8c5;
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .view-btn.is-active,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry-folder .entry-icon,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry-file .entry-icon {
    background: rgba(255, 255, 255, 0.05);
    color: #dbe5ee;
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry {
    background: rgba(18, 25, 33, 0.98);
    border-color: rgba(148, 175, 201, 0.1);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry:hover {
    border-color: rgba(148, 175, 201, 0.18);
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry-folder,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .upload-file-name,
.theme-dark .dashboard-redesign.dashboard-theme-v2 .crumbs a {
    color: #dbe5ee;
}

.theme-dark .dashboard-redesign.dashboard-theme-v2 .entry-preview {
    background: linear-gradient(180deg, #181f27 0%, #202933 100%);
    border-color: rgba(148, 175, 201, 0.1);
}

/* Dedicated mobile PDF viewer */
.mobile-viewer-page {
    background: #eef3f7;
    grid-template-rows: auto 1fr;
}

.mobile-viewer-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.mobile-viewer-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.mobile-viewer-theme {
    grid-column: 1 / -1;
    width: 100%;
}

.mobile-viewer-title-wrap {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.mobile-viewer-title {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.94rem;
}

.mobile-viewer-pageinfo {
    font-size: 0.82rem;
}

.mobile-viewer-searchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.mobile-viewer-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mobile-viewer-actions .btn,
.mobile-viewer-searchbar .btn {
    min-width: 0;
}

.mobile-viewer-status {
    display: block;
    min-height: 1.2em;
    margin-top: -2px;
}

.mobile-viewer-zoominfo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Sora', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
}

.mobile-viewer-main {
    padding: 10px;
    overflow: auto;
    scroll-snap-type: none;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

.mobile-viewer-main .pdf-page {
    scroll-snap-align: none;
}

.mobile-pdf-document {
    margin: 0;
    width: fit-content;
    min-width: 100%;
    max-width: none;
    justify-content: start;
    justify-items: start;
}

.mobile-pdf-document .pdf-page {
    margin-bottom: 4px;
}

.theme-dark .mobile-viewer-page {
    background: #0f1822;
}

.theme-dark .mobile-viewer-header {
    background: rgba(17, 27, 39, 0.96);
    border-bottom-color: rgba(148, 175, 201, 0.12);
}

.theme-dark .mobile-viewer-main {
    background: #0f1822;
}

.theme-dark .mobile-viewer-zoominfo {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 175, 201, 0.12);
}

@media (max-width: 420px) {
    .mobile-viewer-searchbar {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-viewer-searchbar input {
        grid-column: 1 / -1;
    }

    .mobile-viewer-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile fixes */
@media (max-width: 760px) {
    .theme-toggle {
        min-width: 0;
    }

    .dashboard-redesign .card-tools {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }

    .dashboard-redesign .card-tools .dash-back-btn,
    .dashboard-redesign .card-tools .search-input,
    .dashboard-redesign .card-tools #fileSearchStats {
        grid-column: 1 / -1;
    }

    .dashboard-redesign .card-tools .dash-back-btn {
        width: 100%;
    }

    .dashboard-redesign .card-tools .view-switch {
        width: 100%;
    }

    .dashboard-redesign .card-tools .view-btn {
        flex: 1 1 0;
    }

    .dashboard-redesign .card-tools #fileSearchStats {
        margin-top: -2px;
    }

    .dashboard-redesign .entry {
        gap: 10px;
        align-items: start;
    }

    .dashboard-redesign .entry-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .dashboard-redesign .entry-actions .btn-download,
    .dashboard-redesign .entry-admin-menu,
    .dashboard-redesign .entry-admin-menu > summary {
        width: 100%;
    }

    .entry-admin-menu-panel {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        min-width: 0;
        width: 100%;
        margin-top: 8px;
        box-shadow: none;
    }

    .entry-admin-menu-panel .btn {
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .viewer-toolbar-top {
        gap: 8px;
    }

    .viewer-back-btn {
        width: 100%;
    }

    .toolbar-pages {
        justify-content: flex-start;
        gap: 6px;
    }

    .toolbar-pages .theme-toggle {
        min-width: 0;
    }

    .toolbar-search-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        width: 100%;
    }

    .toolbar-search-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .toolbar-search-actions .muted {
        grid-column: 1 / -1;
        white-space: normal;
    }

    .pro-tools-overlay-panel {
        height: 100dvh;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .pro-tools-overlay-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pro-tools-overlay-header .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .login-card {
        width: min(100%, 95vw);
        padding: 20px;
        border-radius: 20px;
    }

    .theme-toggle-row,
    .login-card .btn-primary {
        width: 100%;
    }

    .theme-toggle-row .theme-toggle,
    .login-card .btn-primary {
        width: 100%;
    }
}
