@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* Reset & base */
:root {
    /* Core Theme Colors */
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.08);
    --accent-selected: rgba(59, 130, 246, 0.22);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Design Tokens - Light Mode (Default) */
    --bg-app: #f8fafc;
    --bg-panel: #ffffff;
    --bg-panel-soft: #f8fafc;
    --bg-panel-rgb: 255, 255, 255;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #64748b;
    --border-subtle: rgba(0, 0, 0, 0.05);
    --divider: #e2e8f0;
    --radius: 12px;
}

.theme-dark {
    /* Design Tokens - Dark Mode */
    --bg-app: #0f1219;
    --bg-panel: #131822;
    --bg-panel-soft: #0c1118;
    --bg-panel-rgb: 19, 24, 34;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-subtle: #1f2430;
    --divider: #1c2230;
}

/* Legacy & Utility Aliases */
:root {
    --bg: var(--bg-app);
    --panel: var(--bg-panel);
    --card: var(--bg-panel);
    --line: var(--border-subtle);
    --border: var(--border-subtle);
    --text: var(--text-primary);
    --muted: var(--text-muted);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Preload Flicker Fix */
.preload * {
    transition: none !important;
}

.theme-logo-light {
    display: block !important;
}

.theme-logo-dark {
    display: none !important;
}

.theme-dark .theme-logo-light {
    display: none !important;
}

.theme-dark .theme-logo-dark {
    display: block !important;
}

/* Theme Icon Visibility */
.theme-show-light {
    display: inline-block;
}

.theme-show-dark {
    display: none;
}

.theme-dark .theme-show-light {
    display: none;
}

.theme-dark .theme-show-dark {
    display: inline-block;
}

body::before {
    content: '';
    position: fixed;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-primary), transparent 70%);
    opacity: 0.08;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

body {
    margin: 0;
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px 48px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Main container */
.container {
    width: min(1250px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-dark .container {
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.page-header {
    width: 100%;
    text-align: center;
    color: var(--highlight);
    margin: 26px 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.page-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-logo:hover {
    transform: scale(1.05) rotate(2deg);
}

.page-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.95;
}

.layout {
    width: min(1100px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
}

/* Navigation */
.nav-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    position: relative;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.nav-btn img {
    display: none;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.nav-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-soft);
}

.nav-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.nav-btn-home {
    background: var(--accent-soft);
    border: 1px solid var(--accent-primary);
}

.nav-icon-home {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.nav-icon-home::before,
.nav-icon-home::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-secondary);
}

.nav-icon-home::before {
    width: 14px;
    height: 10px;
    bottom: 0;
    border: 2px solid var(--text-secondary);
    border-top: 0;
    border-radius: 2px 2px 3px 3px;
    background: transparent;
}

.nav-icon-home::after {
    width: 12px;
    height: 12px;
    bottom: 8px;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-bottom: 2px solid var(--text-secondary);
    transform: translate(-50%, 0) rotate(45deg);
    background: transparent;
}

.menu-wrapper {
    position: relative;
    align-self: center;
    margin-top: -15px;
    z-index: 20;
}

.file-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 300;
}

.file-menu-dropdown {
    top: 42px;
    right: 0;
    left: auto;
    z-index: 400;
    min-width: 200px;
}

.folder-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.folder-menu .file-menu-dropdown {
    top: 36px;
    right: 0;
}

.menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

.menu-dropdown {
    position: absolute;
    top: 36px;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 200px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    padding: 6px;
    gap: 4px;
}

.menu-dropdown a {
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-dropdown a:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-hover);
}

.menu-link {
    padding: 10px 12px;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.menu-link:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-hover);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 12px;
}


.modal {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    width: min(600px, 100%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-dark .modal {
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.modal p {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 14px;
}

.user-modal {
    width: min(860px, 95%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-create-card {
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.user-create-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: center;
}

.user-create-form input,
.user-create-form select {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    height: 52px;
    box-sizing: border-box;
    font-weight: 600;
    margin: 0;
}

.user-create-form input[type="text"] {
    margin-bottom: 0 !important;
}

.user-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-panel);
    gap: 16px;
    transition: all 0.2s ease;
}

.user-row:hover {
    border-color: var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-row strong {
    color: var(--text);
}

.user-row small {
    color: var(--muted);
}

.user-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.user-row-actions select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    height: 42px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-row-actions select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.user-row .btn {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    min-width: 32px;
}

.user-row-actions input[type="number"] {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    height: 42px;
    width: 120px;
    transition: all 0.2s ease;
}

.user-row-actions input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.token-section {
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.token-create-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
    position: relative;
}

.token-create-row select {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    height: 48px;
    min-width: 200px;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-create-row select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.token-create-form .modal-actions {
    justify-content: flex-start;
}

.user-create-form .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    grid-column: 1 / -1;
    margin-top: 6px;
}

.user-create-form .modal-actions .btn-primary,
.token-create-row .btn-primary {
    height: 32px;
    min-width: 32px;
    width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.token-create-row .btn-primary {
    padding: 0;
    min-width: 32px;
    width: 32px;
    flex: 0 0 auto;
    border-radius: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.token-section .user-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.token-section .user-row:last-child {
    border-bottom: none;
}

.token-section .user-row:hover {
    box-shadow: none;
    border-color: var(--border-subtle);
    background: transparent;
}

.token-section .user-row .btn {
    height: 32px;
    min-width: 32px;
}

.settings-info-box {
    padding: 24px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-panel);
    margin-top: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-block span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 2px;
}

.input-block input,
.input-block textarea,
.input-block select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.input-block input:focus,
.input-block textarea:focus,
.input-block select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--bg-panel);
}

.password-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
    padding: 20px;
    background: var(--bg-panel-soft);
    border-radius: 16px;
    border: 1px solid var(--divider);
}

.password-row .input-block {
    margin-bottom: 0;
}

.modal h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--divider);
}

.settings-modal {
    width: 100%;
    height: 100%;
}

.settings-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: stretch;
}

.settings-layout input[type="text"],
.settings-layout input[type="email"],
.settings-layout input[type="password"] {
    max-width: 800px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
}

.settings-info-box {
    padding: 24px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-panel);
    margin-top: 24px;
}

.badge-success-large {
    background: var(--accent-soft);
    color: var(--accent-primary);
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.settings-tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.settings-tab i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.settings-tab.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.settings-tab.active i {
    opacity: 1;
    transform: scale(1.1);
}

.settings-tab::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    transition: height 0.25s ease;
}

.settings-tab.active::after {
    height: 20px;
}

.settings-tab:hover:not(.active) {
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    padding-left: 20px;
}

.settings-tab:hover i {
    opacity: 1;
}

.settings-content {
    background: transparent;
    border: none;
    padding: 0;
    display: block;
    min-height: 320px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.system-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.system-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-panel);
    transition: all 0.2s ease;
}

.status-row:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

.status-detail {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    text-align: right;
    margin-left: 12px;
}

.file-badge.status-ok {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
}

.file-badge.status-bad {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
}

.log-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-box {
    max-height: 280px;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.log-line {
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.input-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-block span {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
}

.input-block input[type="text"],
.input-block input[type="email"],
.input-block input[type="password"],
.input-block input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    min-height: 48px;
    box-sizing: border-box;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.input-block input[type="text"]:focus,
.input-block input[type="email"]:focus,
.input-block input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.password-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .password-row {
        grid-template-columns: 1fr;
    }

    .settings-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .settings-tab {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .settings-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent-primary);
    }
}



.theme-dark #confirm-modal .modal {
    background: var(--bg-panel-dark);
    border-color: var(--border-subtle-dark);
    color: var(--text-primary-dark);
}

.theme-dark #confirm-modal .confirm-title,
.theme-dark #confirm-modal .confirm-message {
    color: var(--text-primary-dark);
}



.preview-modal {
    width: min(1000px, 95%);
    max-height: 95vh;
}

.preview-frame-wrap {
    width: 100%;
    min-height: 300px;
    max-height: 70vh;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-panel-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: none;
    background: #fff;
}

.theme-dark .preview-frame {
    background: #1e293b;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.preview-image:hover {
    transform: scale(1.01);
}

.modal input[type="text"] {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.settings-form input[type="file"] {
    display: none;
}

.settings-form .file-input {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 1px dashed var(--accent-primary);
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-form .file-input:hover {
    background: var(--accent-selected);
    border-style: solid;
}

.settings-form .file-input-btn {
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.settings-form .file-input-name {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes panelEntry {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-panel.active {
    display: block;
    animation: panelEntry 0.3s ease-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-soft);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-soft);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: var(--bg-panel-soft);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-soft:hover,
.btn.icon-btn:hover,
.icon-pill:hover,
.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: none;
    border-color: var(--accent-primary);
}

.upload-status {
    min-height: 18px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.upload-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-panel-soft);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0;
}

.upload-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.upload-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-modal .modal-header {
    margin-bottom: 10px;
}

.upload-modal input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
}

.upload-modal .upload-meta {
    color: var(--text-secondary);
}

.upload-modal .upload-progress {
    background: var(--bg-panel-soft);
}

.upload-modal .upload-stats {
    color: var(--text-secondary);
    align-items: center;
}

.upload-spinner {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    display: inline-block;
    animation: upload-spin 0.8s linear infinite;
    opacity: 0;
    visibility: hidden;
}

.upload-spinner.is-active {
    opacity: 1;
    visibility: visible;
}

@keyframes upload-spin {
    to {
        transform: rotate(360deg);
    }
}

.current-folder {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: left;
    margin: 0;
    letter-spacing: -0.02em;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider);
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 0;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-soft {
    background: var(--bg-panel-soft);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-soft:hover {
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-right: 6px;
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    align-self: center;
    text-align: right;
}

.user-info span {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.nav-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: center;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyebrow {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding: 8px 16px;
    background: var(--bg-panel-soft);
    border-radius: 10px;
    margin-top: 10px;
}

.crumbs a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding-right: 6px;
}

.crumb-current {
    color: var(--text) !important;
    font-weight: 800;
}

.crumb-sep {
    color: var(--muted);
    padding: 0 6px 0 2px;
}

.upload-box {
    margin-top: 24px;
    background: var(--bg-panel-soft);
    border: 2px dashed var(--border-subtle);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

.upload-box:hover {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
}

.upload-box i {
    font-size: 40px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.quota-card {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.quota-bar {
    width: 100%;
    height: 10px;
    background: var(--divider);
    border-radius: 999px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    width: 0%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.folder-form {
    display: none;
}

.btn-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: var(--accent-primary);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-circle:hover {
    transform: translateY(-1px);
    opacity: 0.95;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.35);
}

.btn-circle.large,
.btn-circle.small {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin-bottom: 0;
    margin-right: 8px;
    vertical-align: middle;
}

.placeholder-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
}

.permissions-card {
    margin-top: 14px;
    background: var(--card);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 5;
    min-height: 150px;
    justify-content: flex-start;
}

.perm-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.perm-title {
    font-size: 15px;
    font-weight: 700;
}

.share-subtitle {
    margin: 0 28px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.perm-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 28px 28px;
}

.share-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-field>span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.perm-input {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.perm-input input[type="text"] {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    height: 44px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.perm-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--bg-panel);
}

.perm-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.perm-input input:focus+.perm-icon {
    color: var(--accent-primary);
}

.btn-soft {
    padding: 0 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    height: 44px;
    transition: all 0.2s ease;
}

.btn-soft:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-soft);
}

/* New Share Modal Overhaul */
.share-modal-new {
    width: min(640px, 95%);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.theme-dark .share-modal-new {
    background: rgba(19, 24, 34, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

.share-modal-new .modal-header {
    background: transparent;
    border-bottom: 1px solid var(--divider);
    padding: 24px 28px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 20px;
    border: 1px solid var(--accent-soft);
}

.share-modal-new h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-primary);
}

.modal-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.share-form-new {
    padding: 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.share-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 8px;
}

.share-section-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.share-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.share-section:hover .share-section-icon {
    color: var(--accent-primary);
    border-color: var(--accent-soft);
    background: var(--accent-soft);
}

.share-section-title h4 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.share-section-title p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.share-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.share-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    height: 44px;
    transition: all 0.2s ease;
}

.share-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-soft);
    background: var(--bg-panel);
}

.btn-add {
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 44px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-soft);
}

.share-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.access-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s ease;
}

.access-chip:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
}

.access-chip i {
    font-size: 10px;
    opacity: 0.6;
}

.share-info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.share-info-box i {
    color: var(--accent-primary);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.share-info-box strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Public Link Cards */
.public-share-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.public-share-card {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s ease;
}

.public-share-card:hover {
    border-color: var(--accent-soft);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.public-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.public-share-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.public-share-row {
    display: flex;
    gap: 8px;
}

.public-share-input {
    flex: 1;
    font-size: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
}

.public-share-copy,
.public-share-delete {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.public-share-copy {
    background: var(--accent-soft);
    color: var(--accent-primary);
    border: 1px solid var(--accent-soft);
}

.public-share-copy:hover {
    background: var(--accent-primary);
    color: #fff;
}

.public-share-delete {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.public-share-delete:hover {
    background: var(--danger);
    color: #fff;
}

.modal-actions-new {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px 20px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 12px;
}

.btn-secondary-new,
.btn-primary-new {
    padding: 0 20px;
    height: 44px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.btn-secondary-new {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary-new:hover {
    border-color: var(--text-muted);
    background: var(--bg-panel-soft);
}

.btn-primary-new {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary-new:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-soft);
}

/* Legacy styles for backward compatibility */


.access-control {
    display: flex;
    gap: 10px;
    align-items: center;
}

.access-add {
    height: 48px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.access-add:hover {
    background: var(--bg-panel);
}

.access-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

@media (max-width: 720px) {
    .share-modal .perm-form {
        grid-template-columns: 1fr;
    }

    .share-modal-new {
        width: 100%;
    }

    .modal-actions-new {
        flex-direction: column;
    }

    .btn-secondary-new,
    .btn-primary-new {
        width: 100%;
        justify-content: center;
    }
}

.note-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.note-modal .modal-header {
    border-bottom-color: var(--divider);
}

.note-modal input[type="text"] {
    border-color: var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
}

.note-modal input[type="text"]::placeholder {
    color: var(--text-muted);
}

.note-modal input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.perm-note {
    color: var(--muted);
    margin: 0;
    font-size: 13px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.perm-form.readonly .perm-input input[type="text"] {
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    border-style: dashed;
}

.perm-form.readonly {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.content-split {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 14px;
}

.sidebar {
    position: sticky;
    top: 18px;
}

.sidebar-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--highlight);
}

.table-card thead th:first-child {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.table-card {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 0;
}

/* actions-header removed */
@media (max-width: 980px) {
    .content-split {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

/* Consistent rounded corners across the app */
.container,
.permissions-card,
.quota-card,
.sidebar-card,
.table-card,
.folder,
.folder img,
.nav-bar,
.menu-dropdown,
.menu-btn,
.file-menu,
.btn,
.btn-circle,
.perm-input input[type="text"],
.perm-form button,
input,
select,
textarea,
table,
th,
td,
.modal,
.modal input,
.modal select,
.modal textarea {
    border-radius: var(--radius);
}

/* Folder grid */
.folder-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    margin: 0;
    position: relative;
    z-index: 1;
    width: 100%;
}

.folder {
    position: relative;
    text-align: left;
    background: var(--card);
    border: 0;
    border-radius: 0;
    padding: 8px 10px 8px 6px;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    justify-content: flex-start;
}

.folder+.folder {
    border-top: 1px solid var(--border);
}

.delete-folder-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.14);
    color: #fecdd3;
    border: 1px solid rgba(239, 68, 68, 0.35);
    cursor: pointer;
    border-radius: 0;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.2);
}

.delete-folder-btn:hover {
    transform: translateY(-50%) scale(1.05);
    opacity: 0.95;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.25);
}

.shared-indicator {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: rgba(119, 36, 191, 0.2);
    border: 1px solid rgba(119, 36, 191, 0.35);
    color: #d9c9f4;
    border-radius: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.2);
}

.folder a {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}

.folder-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}

.folder-link i {
    font-size: 18px;
    color: #b78bf2;
}

/* Table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

th,
td {
    padding: 8px 10px;
    border-bottom: none;
    text-align: left;
    color: var(--text);
    word-break: break-word;
}

td.file-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

td.file-name i {
    font-size: 16px;
    color: var(--accent-2);
}

tbody td {
    display: block;
}

thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

thead tr {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px;
}

th {
    background: transparent;
    font-weight: 700;
    border-bottom: none;
    padding: 0;
}

tbody {
    display: block;
    padding: 12px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 52px;
    padding: 8px 10px;
}

tbody tr:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 1px;
    background: var(--table-divider);
}

.actions {
    text-align: right;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    padding-right: 10px;
    position: relative;
    z-index: 1;
}

.table-card thead .file-menu {
    justify-self: end;
}

.actions .btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 6px;
    position: relative;
    z-index: 1;
}

.row-menu .more-btn {
    z-index: 1001;
}

.icon-only-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.icon-only-btn:hover {
    color: var(--accent-2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-height: 36px;
    height: 36px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    user-select: none;
}

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

.icon-btn {
    padding: 0;
    min-width: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn i {
    pointer-events: none;
    font-size: 14px;
    color: var(--text-secondary);
}

.delete-folder-btn i,
.shared-indicator i {
    pointer-events: none;
    font-size: 14px;
    color: inherit;
}

.favorite-toggle {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-2);
    border-color: rgba(59, 130, 246, 0.25);
}

.favorite-toggle.active {
    background: rgba(59, 130, 246, 0.22);
    color: var(--accent-2);
    border-color: rgba(59, 130, 246, 0.35);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: grayscale(12%);
}

.view {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-2);
    border-color: rgba(59, 130, 246, 0.3);
}

.download {
    background: rgba(96, 165, 250, 0.16);
    color: var(--text);
    border-color: rgba(96, 165, 250, 0.35);
}

.delete {
    background: rgba(248, 113, 113, 0.15);
    color: #fecdd3;
    border-color: rgba(248, 113, 113, 0.35);
}

/* Login / Register card */
.login-container {
    width: 380px;
    max-width: 90%;
    margin: 8% auto;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.login-container h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.login-container input[type="email"],
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-container input:focus {
    border: 1px solid rgba(59, 130, 246, 0.6);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.login-container button {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: none;
}

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

.error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 12px;
    font-weight: 700;
}

.success {
    color: var(--accent-2);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 12px;
    font-weight: 700;
}

.form-footer {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.form-footer a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 700;
}

.form-footer a:hover {
    text-decoration: underline;
}

.auth-footer-links {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

.auth-footer-links {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.auth-footer-outside {
    margin-top: 16px;
}

.auth-page .auth-footer-outside {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    text-align: center;
}

.auth-footer-copy {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    width: min(460px, 100%);
}

.auth-page.legal-wide .auth-footer-copy {
    width: 100%;
}

.auth-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-links a:hover {
    color: var(--accent-primary);
}

/* Utility */
.hidden-file-input {
    color: var(--text);
}

.table-editor-body {
    background: var(--bg);
}

.table-editor {
    margin-top: 16px;
    padding: 20px;
}

.table-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.table-editor-head h2 {
    margin: 4px 0;
}

.table-editor .muted {
    color: var(--muted);
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-grid {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
}

.table-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.table-row.header {
    background: rgba(255, 255, 255, 0.03);
}

.cell {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 0;
}

.cell:last-child {
    border-right: none;
}

.table-row:last-child .cell {
    border-bottom: none;
}

.cell input {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text);
    border: none;
    font-weight: 600;
}

.cell.header input {
    font-weight: 800;
}

.table-footer {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.primary-save {
    background: rgba(16, 185, 129, 0.16);
    color: #d1fae5;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.text-editor-area {
    width: 100%;
    min-height: 560px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    padding: 14px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    resize: vertical;
}

.theme-dark .text-editor-area {
    color: var(--text-primary);
}

.page-footer {
    width: 100%;
    text-align: left;
    margin: 32px 0 0;
    padding: 16px 0 8px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

body:not(.theme-dark) .toast {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.35);
    color: #d1fae5;
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fee2e2;
}

body:not(.theme-dark) .toast.success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #0f172a;
}

body:not(.theme-dark) .toast.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #0f172a;
}

.toast-text {
    display: inline-flex;
}

.toast-action {
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
}

.toast-action:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
    body {
        padding: 18px 10px;
    }

    .nav-bar {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        row-gap: 6px;
    }

    .user-info {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        align-items: center;
    }

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

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

/* --- Dashboard layout refresh (Filory.de-style) --- */

:root {
    --radius: 10px;
}

body {
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: var(--bg-app);
    color: var(--text-primary);
    padding: 0;
    display: block;
    overflow-y: scroll;
}

/* Scrollbar (light + dark) */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
}

.theme-dark {
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.theme-dark ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.page-footer {
    color: var(--text-muted);
    border-top: none;
}

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

/* Side Navigation */
.side-nav {
    width: 280px;
    height: 100vh;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: block;
    padding: 0 12px 32px;
}

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.side-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.7;
}

.side-link:hover {
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    transform: translateX(4px);
}

.side-link.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.side-link.active i {
    opacity: 1;
}

/* Storage Card in Sidebar */
.storage-card {
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px;
    margin-top: auto;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.storage-head {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.storage-bar {
    height: 8px;
    background: var(--divider);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 999px;
}

.storage-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.storage-upgrade {
    display: block;
    margin-top: 14px;
    padding: 10px;
    background: var(--accent-primary);
    color: #fff;
    text-align: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.storage-upgrade:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.side-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.footer-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.legal-card {
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    border-radius: 14px;
    padding: 18px;
    color: var(--text-secondary);
    max-width: 720px;
}

.legal-card.legal-wide-card {
    max-width: none;
    width: 100%;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-weight: 600;
    box-sizing: border-box;
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-required-star {
    color: var(--danger);
    margin-left: 4px;
    font-weight: 700;
}

.contact-note-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-note-required {
    color: var(--text-secondary);
    font-weight: 600;
}

.contact-note-sep {
    color: var(--text-muted);
}

.contact-submit-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.contact-captcha-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 420px;
}

.contact-captcha-inline span {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.contact-captcha-inline input[type="text"] {
    width: 110px;
    min-width: 110px;
}

.contact-submit-row .modal-actions {
    margin: 0;
}

.contact-submit-row .btn-primary {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .contact-submit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-captcha-inline {
        max-width: none;
    }

    .contact-submit-row .modal-actions .btn-primary {
        width: 100%;
    }
}

.contact-reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    font-weight: 600;
    resize: vertical;
    box-sizing: border-box;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.consent-row input[type="checkbox"] {
    margin-top: 2px;
}

.consent-row span {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.hp-field {
    display: none !important;
}

.feedback-success {
    color: var(--accent-2);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 12px;
    font-weight: 700;
}

.contact-requests-list {
    max-height: none;
}

.contact-request-row {
    grid-template-columns: 1fr;
    padding: 0;
    border: none;
    background: transparent;
    margin-bottom: 24px;
    gap: 0;
}

.contact-request-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-request-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.contact-request-header {
    background: var(--bg-panel-soft);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--divider);
}

.contact-request-body {
    padding: 20px;
}

.contact-request-subject {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.contact-request-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-open {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.status-replied {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-closed {
    background: var(--bg-panel-soft);
    color: var(--text-muted);
}

.contact-request-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-app);
    padding: 16px;
    border-radius: 12px;
    margin: 0 0 16px;
    position: relative;
    border-left: 3px solid var(--border-subtle);
}

.contact-existing-reply {
    margin-top: 0;
    padding: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    position: relative;
}

.contact-existing-reply::before {
    content: '\f3e5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 16px;
    opacity: 0.2;
    font-size: 20px;
}

.contact-existing-reply strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    color: var(--accent-primary);
}

.contact-existing-reply p {
    margin: 0;
}

.contact-reply-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

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

.legal-wide .legal-card {
    max-width: none;
    width: 100%;
}

.legal-card h3 {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 18px;
}

.legal-card p {
    margin: 0;
    line-height: 1.6;
}

.storage-head {
    font-weight: 600;
    margin-bottom: 12px;
}

.storage-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    transform: none;
    animation: none;
}

.storage-meta {
    font-size: 12px;
    margin-bottom: 12px;
}

.storage-upgrade {
    width: 100%;
    border: none;
    background: var(--accent-primary);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 10px 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.app-body {
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: var(--bg-panel);
    background: rgba(var(--bg-panel-rgb, 255, 255, 255), 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-leading {
    width: 400px;
    min-width: 400px;
    max-width: 400px;
    height: 46px;
    display: flex;
    align-items: center;
}

.search {
    position: relative;
    width: 100%;
}

.topbar-spacer {
    width: 100%;
    height: 46px;
    pointer-events: none;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.search input {
    width: 100%;
    height: 46px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0 16px 0 48px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search input:focus {
    outline: none;
    background: var(--bg-panel);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.search .kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.7;
}

.app-content {
    flex: 1;
    padding: 0 40px 40px 40px;
}

.search input::placeholder {
    color: var(--text-muted);
}

.kbd {
    font-size: 12px;
    color: var(--muted);
    background: var(--panel-2);
    padding: 4px 8px;
    border-radius: var(--radius);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

@media (max-width: 980px) {
    .topbar {
        padding: 0 20px;
    }

    .topbar-leading {
        width: min(52vw, 400px);
        min-width: 220px;
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 0 14px;
    }

    .topbar-leading {
        width: min(46vw, 400px);
        min-width: 150px;
    }

    .search .kbd {
        display: none;
    }
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 6px;
}

.lang-flag {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    color: var(--ink);
    background: transparent;
}

.lang-flag.active {
    background: var(--accent-soft);
}

.lang-flag.single {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    width: auto;
    height: auto;
}

.lang-dropdown {
    position: relative;
    display: inline-flex;
}

.lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}

.lang-trigger i {
    font-size: 11px;
    opacity: 0.7;
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    display: none;
    z-index: 50;
}

.lang-dropdown.open .lang-menu {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
}

.lang-option:hover {
    background: var(--accent-soft);
}

.lang-option.active {
    background: var(--accent-selected);
}

/* Compact language dropdown (app + auth) */
.lang-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    gap: 4px;
    justify-content: center;
}

.lang-trigger .lang-label,
.lang-option .lang-label {
    display: none;
}

.lang-menu {
    min-width: 64px;
    padding: 2px;
    border-radius: 10px;
}

.lang-option {
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
}

.theme-dark .lang-trigger,
.theme-dark .lang-menu {
    background: var(--bg-panel-dark);
    border-color: var(--border-subtle-dark);
    color: var(--text-primary-dark);
}

.theme-dark .lang-option {
    color: var(--text-primary-dark);
}

.theme-dark .lang-option:hover {
    background: rgba(59, 130, 246, 0.12);
}

.icon-pill {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 6px 10px;
    box-shadow: var(--shadow);
    height: 36px;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.modal-close {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: rotate(90deg);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-panel-soft);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
    transition: none;
}

.avatar-initial {
    display: flex;
}

.avatar.has-avatar .avatar-initial {
    display: none;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    transition: none;
    display: inline-block;
    line-height: 1.1;
    min-height: 16px;
}

.menu-wrapper {
    position: relative;
    margin-top: 0;
}

.menu-dropdown {
    position: absolute;
    top: 46px;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}

.menu-link {
    border: none;
    background: transparent;
    padding: 8px 10px;
    text-align: left;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--ink);
    width: 100%;
    display: block;
}

.menu-link:hover {
    background: var(--panel-2);
}

.menu-link.danger:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #dc2626;
}

.file-menu-dropdown {
    min-width: 180px;
}

.notify-btn {
    position: relative;
}

.notify-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

.notif-dropdown {
    width: 280px;
    border-radius: var(--radius);
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px 10px;
    border-bottom: 1px solid var(--line);
}

.notif-mark {
    font-size: 12px;
    color: var(--muted);
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-item {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--panel-2);
}

.notif-item.unread {
    border: 1px solid rgba(59, 130, 246, 0.45);
}

.notif-message {
    font-size: 13px;
    color: var(--ink);
}

.notif-time {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.notif-empty {
    padding: 8px 10px;
    color: var(--muted);
    font-size: 13px;
}

.app-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 40px;
    position: relative;
    z-index: 1;
}

.app-content.has-settings {
    grid-template-columns: minmax(0, 1fr);
}

.settings-dock {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    align-self: stretch;
    position: static;
    box-shadow: none;
}

.settings-dock .modal {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

.app-content.has-settings .content-main {
    display: none;
}

.content-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.content-upgrade {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.app-content.has-upgrade .content-main {
    display: none;
}

.app-content.has-upgrade .content-upgrade {
    display: flex;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.section-head.centered {
    justify-content: center;
    text-align: center;
}

.section-head.centered>div {
    width: 100%;
}

.eyebrow {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.section-title {
    margin: 6px 0 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.section-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 24px;
    padding: 12px 16px;
    background: var(--bg-panel-soft);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.filter-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    height: 38px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--accent-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.modern-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.modern-crumbs a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.modern-crumbs .crumb-current {
    color: var(--ink);
}

.btn-soft {
    border: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 8px 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    min-height: 36px;
    height: 36px;
}

.btn-soft i {
    color: var(--text-secondary);
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    gap: 12px;
    justify-content: start;
}

.photo-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    cursor: pointer;
}

.photo-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
}

.photo-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 16px;
    position: relative;
    overflow: hidden;
    --cloud-tint: rgba(59, 130, 246, 0.10);
    --cloud-opacity: 0.5;
    --cloud-filter: brightness(1.05) contrast(1.05) saturate(0.9);
}

body.auth-page.legal-wide {
    align-items: center;
    overflow-y: auto;
    padding-top: 56px;
    padding-bottom: 64px;
}

.theme-dark .auth-page {
    background:
        radial-gradient(120% 80% at 50% 20%, rgba(59, 130, 246, 0.08), transparent 60%),
        radial-gradient(70% 40% at 20% 30%, rgba(148, 163, 184, 0.08), transparent 65%),
        radial-gradient(80% 45% at 80% 28%, rgba(148, 163, 184, 0.06), transparent 65%),
        radial-gradient(60% 35% at 30% 65%, rgba(148, 163, 184, 0.05), transparent 70%),
        radial-gradient(70% 40% at 75% 70%, rgba(148, 163, 184, 0.05), transparent 70%),
        linear-gradient(180deg, #0b1220 0%, #070b14 100%);
}

.auth-shell {
    position: relative;
    z-index: 1;
}

@keyframes cloud-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

.auth-clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-cloud {
    position: absolute;
    background: url("/img/wolkelight.png") center/contain no-repeat;
    filter: var(--cloud-filter);
    opacity: var(--cloud-opacity);
    animation: cloud-float 10s ease-in-out infinite;
    transform: translateZ(0);
}

.auth-cloud::before,
.auth-cloud::after {
    content: none;
}

.auth-cloud.c1 {
    top: 4%;
    left: 6%;
    width: 210px;
    height: 70px;
    opacity: 0.42;
    animation-duration: 11s;
}

.auth-cloud.c2 {
    top: 12%;
    right: 22%;
    width: 320px;
    height: 104px;
    opacity: 0.62;
    animation-duration: 16s;
    animation-delay: -2s;
}

.auth-cloud.c3 {
    top: 30%;
    left: 14%;
    width: 180px;
    height: 60px;
    opacity: 0.38;
    animation-duration: 12s;
    animation-delay: -4s;
}

.auth-cloud.c4 {
    top: 46%;
    right: 8%;
    width: 260px;
    height: 84px;
    opacity: 0.5;
    animation-duration: 18s;
    animation-delay: -3s;
}

.auth-cloud.c5 {
    bottom: 26%;
    left: 20%;
    width: 240px;
    height: 78px;
    opacity: 0.55;
    animation-duration: 15s;
    animation-delay: -5s;
}

.auth-cloud.c6 {
    bottom: 10%;
    right: 12%;
    width: 280px;
    height: 90px;
    opacity: 0.58;
    animation-duration: 19s;
    animation-delay: -6s;
}

.auth-cloud.c7 {
    top: 58%;
    left: 6%;
    width: 200px;
    height: 66px;
    opacity: 0.4;
    animation-duration: 14s;
    animation-delay: -1s;
}

.auth-cloud.c8 {
    bottom: 6%;
    right: 30%;
    width: 150px;
    height: 50px;
    opacity: 0.35;
    animation-duration: 13s;
    animation-delay: -7s;
}

.auth-shell {
    width: min(460px, 100%);
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-page.legal-wide .auth-shell {
    width: min(960px, 100%);
}

.auth-page.legal-wide .auth-card {
    padding: 24px 40px 32px;
}

.auth-side {
    display: none;
}

.auth-side-copy h2 {
    margin: 0 0 8px;
}

.auth-side-copy p {
    margin: 0;
    color: var(--muted);
}

.auth-card {
    padding: 24px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.auth-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.auth-head p {
    margin: 0;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auth-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 1200;
}

@media (max-width: 640px) {
    .auth-actions {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(10px + env(safe-area-inset-right, 0px));
    }
}

.auth-head.centered {
    flex-direction: column;
    text-align: center;
}

.auth-card > .auth-head.centered:first-child {
    margin-top: -6px;
    margin-bottom: -6px;
}

.auth-logo {
    width: 160px;
    height: 160px;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.auth-logo img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

body.auth-logo-large .auth-logo {
    width: 200px;
    height: 200px;
}

body.auth-logo-large .auth-logo img {
    width: 300px;
    height: 300px;
}

.auth-brand {
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.auth-form.narrow {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.cookie-banner__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--ink);
}

.cookie-banner__content p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.theme-dark .cookie-banner {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
}

.theme-dark .cookie-banner__content {
    color: var(--text-primary);
}

.theme-dark .cookie-banner__content p {
    color: var(--text-secondary);
}

.theme-dark .cookie-banner .btn-secondary {
    background: var(--bg-panel-soft);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

@media (max-width: 720px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.social-btn {
    border: 1px solid var(--line);
    background: var(--panel-2);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}

.auth-form .input-block input {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel-2);
    padding: 12px 14px;
    font-size: 14px;
}

.auth-form .input-block span {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: inline-block;
}

@media (max-width: 860px) {
    .auth-shell {
        width: min(92vw, 520px);
    }
}

.theme-dark .auth-page {
    background: var(--bg-app);
    --cloud-tint: rgba(148, 163, 184, 0.16);
    --cloud-opacity: 0.6;
    --cloud-filter: none;
}

.theme-dark .auth-cloud {
    background-image: url("/img/wolke.png");
}

.theme-dark .auth-shell {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
}

.theme-dark .social-btn,
.theme-dark .theme-toggle {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.theme-dark .auth-card,
.theme-dark .auth-head,
.theme-dark .auth-brand,
.theme-dark .auth-side-copy h2 {
    color: var(--text-primary);
}

.theme-dark .auth-head p,
.theme-dark .auth-side-copy p,
.theme-dark .auth-divider,
.theme-dark .auth-form .input-block span,
.theme-dark .form-footer {
    color: var(--text-secondary);
}

.theme-dark .auth-divider::before,
.theme-dark .auth-divider::after {
    background: var(--divider);
}

.theme-dark .auth-form .input-block input {
    background: var(--bg-panel-soft);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.theme-dark .auth-form .input-block input::placeholder {
    color: var(--text-muted);
}

.recent-card {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 130px;
}

.recent-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--panel-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    gap: 6px;
    color: var(--text);
}

.recent-icon i {
    font-size: 20px;
    color: inherit;
}

.recent-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.recent-card.is-pdf .recent-icon {
    background: #fee2e2;
    color: #ef4444;
}

.recent-card.is-xls .recent-icon {
    background: #dcfce7;
    color: #16a34a;
}

.recent-card.is-doc .recent-icon {
    background: #dbeafe;
    color: #2563eb;
}

.recent-card.is-svg .recent-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.folder {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.folder-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.table-card {
    background: var(--bg-panel-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: transparent;
}

thead th {
    text-align: left;
    padding: 12px 18px;
    height: 44px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.table-card thead th {
    color: var(--accent) !important;
}

.table-card thead th:first-child {
    border-top-left-radius: var(--radius);
}

.table-card thead th:last-child {
    border-top-right-radius: var(--radius);
}

.table-card tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius);
}

.table-card tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius);
}

tbody td {
    padding: 12px 18px;
    border-top: 1px solid var(--divider);
    background: transparent;
}

.table-card tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
    height: 52px;
}

.table-card tbody tr:hover {
    background: var(--accent-soft);
}

.table-card tbody td {
    color: var(--text-primary);
}

.file-name i {
    margin-right: 10px;
    color: var(--accent-primary);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr) auto;
    align-items: center;
    gap: 0;
    padding: 10px 10px;
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    background: var(--bg-panel-soft);
    position: relative;
}

.file-row:hover {
    border-color: var(--border-subtle);
    background: var(--bg-panel);
}

.file-row.is-active {
    background: var(--accent-soft);
    border-color: var(--accent-primary);
}

.file-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: transparent;
    border-radius: 999px;
}

.file-row:hover::before,
.file-row.is-active::before {
    background: var(--accent-primary);
}

.file-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-main .file-link,
.file-main .file-link-btn {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-main i {
    color: var(--accent-primary);
    font-size: 28px;
}

.file-main i.fa-folder,
.file-name i.fa-folder {
    color: #60a5fa;
}

.file-main i.fa-image,
.file-name i.fa-image {
    color: #f59e0b;
}

.file-main i.fa-file-lines,
.file-name i.fa-file-lines {
    color: #34d399;
}

.file-main i.fa-table,
.file-name i.fa-table {
    color: #a78bfa;
}

.file-main i.fa-file,
.file-name i.fa-file {
    color: #93c5fd;
}

.file-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.file-meta .file-badge {
    flex: 0 0 auto;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    min-width: 84px;
    justify-content: center;
}

.file-badge.type {
    color: var(--accent-primary);
    border-color: rgba(59, 130, 246, 0.35);
    background: var(--accent-soft);
}

.file-badge.path,
.file-badge.owner {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-end {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    white-space: nowrap;
    justify-self: end;
    margin-left: 0;
}

.file-access.inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 200px;
    min-width: 200px;
    margin-left: auto;
    flex: 0 0 200px;
}

.file-row .actions {
    padding-right: 0;
}

@media (max-width: 980px) {
    .file-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .file-meta {
        justify-content: flex-start;
    }

    .file-end {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.file-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.file-link-btn {
    background: transparent;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}

.row-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 2;
}

.row-menu-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    min-width: 200px;
    width: max-content;
    max-width: calc(100vw - 32px);
    z-index: 9999;
}

.row-menu {
    z-index: 1000;
}


.menu-link.danger {
    color: #dc2626;
    padding-left: 10px;
}

.file-type {
    color: var(--text-secondary);
    font-weight: 600;
}

.file-size,
.file-modified {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.file-access {
    min-width: 120px;
    width: auto;
}

.access-avatars {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 0;
}

.avatar-chip {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--bg);
    background: hsl(var(--avatar-h) 55% 80%);
    border: 2px solid var(--card);
    margin-left: -8px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.avatar-chip:first-child {
    margin-left: 0;
}

.avatar-chip.extra {
    background: var(--pill);
    color: var(--text);
}


.shared-row {
    display: table-row;
}

.file-list .shared-row {
    display: grid;
}

.shared-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
}

.actions {
    display: flex;
    gap: 8px;
}

.btn.icon-btn {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.table-card .btn.icon-btn {
    border-radius: 10px;
    background: var(--panel-2);
}

.table-card thead th:first-child {
    color: #2f8f3a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

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

    .side-nav {
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .storage-card {
        display: none;
    }

    .app-content {
        grid-template-columns: 1fr;
    }
}

.theme-dark,
html.theme-dark {
    /* Dark Mode */
    --bg-app-dark: #0f1219;
    --bg-panel-dark: #131822;
    --bg-panel-soft-dark: #0c1118;
    --border-subtle-dark: #1f2430;
    --divider-dark: #1c2230;
    --text-primary-dark: #e5e7eb;
    --text-secondary-dark: #9ca3af;
    --text-muted-dark: #6b7280;

    --bg-app: var(--bg-app-dark);
    --bg-panel: var(--bg-panel-dark);
    --bg-panel-soft: var(--bg-panel-soft-dark);
    --border-subtle: var(--border-subtle-dark);
    --divider: var(--divider-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-muted: var(--text-muted-dark);

    /* Legacy aliases update */
    --text: var(--text-primary);
    --muted: var(--text-muted);
    --border: var(--border-subtle);
    --ink: var(--text-primary);

    --shadow: none;
    color: var(--text-primary);
    --table-divider: rgba(8, 12, 20, 0.95);
    --table-border: var(--border-subtle);

    /* Dark table (premium, weniger blau) */
    --table-bg: rgba(17, 24, 39, 0.55);
    --table-bg-solid: #0f172a;
    --table-header-bg: rgba(17, 24, 39, 0.85);
    --table-row-bg: rgba(15, 23, 42, 0.15);
    --table-row-hover: rgba(59, 130, 246, 0.08);
    --table-row-selected: rgba(59, 130, 246, 0.14);
    --table-border: rgba(148, 163, 184, 0.1);
    --table-divider: rgba(148, 163, 184, 0.03);
    --table-text: rgba(229, 231, 235, 0.92);
    --table-text-muted: rgba(156, 163, 175, 0.75);
    --table-header-text: rgba(229, 231, 235, 0.85);
    --table-action-bg: rgba(255, 255, 255, 0.04);
    --table-action-hover: rgba(255, 255, 255, 0.07);
}

.theme-dark .topbar {
    background: var(--bg-app);
    border-color: var(--border-subtle);
}

.theme-dark .side-nav {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.theme-dark .side-link.active {
    background: var(--accent-selected);
    color: var(--text-primary);
}

.theme-dark .recent-icon {
    background: var(--bg-panel-soft);
    color: var(--text-primary);
}

.theme-dark .menu-dropdown {
    background: var(--bg-panel-dark);
    border-color: var(--border-subtle-dark);
    color: var(--text-primary-dark);
}

.theme-dark .menu-item {
    color: var(--text-primary-dark);
}

.theme-dark .menu-item:hover {
    background: var(--bg-panel-soft-dark);
}

.theme-dark .search,
.theme-dark .icon-pill,
.theme-dark .profile-btn,
.theme-dark .btn-soft,
.theme-dark .btn.icon-btn,
.theme-dark .shared-indicator {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.theme-dark .search input {
    background: transparent;
    color: var(--text-primary) !important;
}

.theme-dark .search input::placeholder {
    color: var(--muted);
}

.theme-dark .table-card {
    background: var(--table-bg);
    border-color: var(--table-border);
}

.theme-dark thead th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
}

.theme-dark tbody td {
    border-top-color: var(--table-divider);
    color: var(--table-text);
}

.theme-dark .table-card tbody tr {
    background: var(--table-row-bg);
}

.theme-dark .table-card tbody tr:hover {
    background: var(--table-row-hover);
}

.theme-dark .table-card tbody tr.selected {
    background: var(--table-row-selected);
}

.theme-dark .file-link,
.theme-dark .file-type,
.theme-dark .file-size,
.theme-dark .file-modified {
    color: var(--table-text);
}

.theme-dark .table-card td.actions .btn.icon-btn {
    background: var(--table-action-bg);
    border-color: var(--table-border);
}

.theme-dark .table-card td.actions .btn.icon-btn:hover {
    background: var(--table-action-hover);
    border-color: var(--table-border);
}

.theme-dark .upgrade-card {
    background: var(--bg-panel);
    border-color: var(--border-subtle);
    box-shadow: none;
}

.theme-dark .upgrade-card h3,
.theme-dark .upgrade-card h4,
.theme-dark .upgrade-title,
.theme-dark .upgrade-title-small {
    color: var(--text-primary);
}

.theme-dark .upgrade-card p,
.theme-dark .upgrade-lead {
    color: var(--text-secondary);
}

.theme-dark .price-tag,
.theme-dark .price-sub,
.theme-dark .upgrade-eyebrow,
.theme-dark .upgrade-note,
.theme-dark .upgrade-list,
.theme-dark .upgrade-list li {
    color: var(--text-secondary);
}

.theme-dark .upgrade-list i {
    color: var(--accent-primary);
}

.theme-dark .upgrade-media {
    background: var(--bg-panel-soft);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

.theme-dark .upgrade-cta.secondary {
    background: var(--bg-panel);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.theme-dark .upgrade-shell {
    background: var(--panel);
    border-color: var(--line);
}

.theme-dark thead th {
    background: #111a14;
    color: var(--accent);
}

.theme-dark tbody td {
    color: var(--ink);
}

.theme-dark .recent-card {
    background: var(--panel);
    border-color: var(--line);
}

.theme-dark .btn-soft,
.theme-dark .btn-soft i {
    color: var(--text-primary);
}

/* Table layout reset for file listing */
.table-card table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    overflow: visible;
}

.table-card thead {
    display: table-header-group;
}

.table-card tbody {
    display: table-row-group;
}

.table-card tr {
    display: table-row;
}

.table-card th,
.table-card td {
    display: table-cell;
    vertical-align: middle;
}

.table-card tbody td {
    display: table-cell;
    background: transparent;
    border-top: none;
}

.table-card td.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.table-card td.actions {
    white-space: nowrap;
    padding-right: 10px;
}

.table-card td.actions .btn.icon-btn {
    background: var(--bg-panel-soft);
    border-color: var(--border-subtle);
}

.table-card td.actions .btn.icon-btn:hover {
    background: var(--accent-soft);
    border-color: var(--border-subtle);
}


.table-card tbody tr {
    height: 52px;
    position: relative;
    z-index: 1;
}

.table-card tbody tr::before {
    content: none;
}

.table-card tbody td {
    position: relative;
    z-index: 1;
}

/* Keep file table cells square; only the outer card is rounded */
.table-card thead th,
.table-card tbody td {
    border-radius: 0 !important;
}

.table-card thead th:first-child {
    border-top-left-radius: var(--radius) !important;
}

.table-card thead th:last-child {
    border-top-right-radius: var(--radius) !important;
}

/* Upgrade page */
body.upgrade-body {
    padding: 32px 16px 64px;
}

.upgrade-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.upgrade-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.upgrade-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--ink);
}

.upgrade-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.upgrade-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

.upgrade-back i {
    font-size: 14px;
}

.upgrade-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 32px;
}

.upgrade-eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--muted);
}

.upgrade-title {
    margin: 10px 0 12px;
    font-size: 32px;
    color: var(--ink);
}

.upgrade-lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
}

.upgrade-cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upgrade-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    border: none;
}

.upgrade-cta.secondary {
    background: var(--panel-2);
    color: var(--ink);
    border: 1px solid var(--line);
}

.upgrade-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: none;
}

.upgrade-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--ink);
}

.upgrade-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.upgrade-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
}

.upgrade-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upgrade-list i {
    color: var(--accent);
}

.upgrade-media {
    border-radius: var(--radius);
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    padding: 18px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
}

.upgrade-media img {
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}

.upgrade-img.dark {
    display: none;
}

.theme-dark .upgrade-img.dark {
    display: block;
}

.theme-dark .upgrade-img.light {
    display: none;
}

.upgrade-pricing {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.price-tag {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
}

.price-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.upgrade-faq {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.upgrade-faq h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--ink);
}

.upgrade-faq p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

    .upgrade-grid,
    .upgrade-pricing,
    .upgrade-faq {
        grid-template-columns: 1fr;
    }

    .upgrade-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

thead th:first-child {
    border-top-left-radius: var(--radius);
}

thead th:last-child {
    border-top-right-radius: var(--radius);
}

tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius);
}

tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius);
}

/* Dark table overrides (ensure these win after table layout reset) */
.theme-dark .table-card {
    background: var(--table-bg) !important;
    border-color: var(--table-border) !important;
}

.theme-dark .table-card thead th {
    background: var(--table-header-bg) !important;
    color: var(--table-header-text) !important;
}

.theme-dark .table-card tbody td {
    color: var(--table-text) !important;
    background: transparent !important;
}

.theme-dark .table-card tbody tr {
    background: var(--table-row-bg) !important;
}

.theme-dark .table-card tbody tr:hover {
    background: var(--table-row-hover) !important;
}

.theme-dark .table-card tbody tr.selected {
    background: var(--table-row-selected) !important;
}

.theme-dark .table-card td.actions .btn.icon-btn {
    background: var(--table-action-bg) !important;
    border-color: var(--table-border) !important;
}

.theme-dark .table-card td.actions .btn.icon-btn:hover {
    background: var(--table-action-hover) !important;
    border-color: var(--table-border) !important;
}

.theme-dark .photo-card {
    background: var(--bg-panel-soft);
    border-color: rgba(15, 23, 42, 0.9);
}

.theme-dark .photo-name {
    color: var(--text-primary);
}

/* Upload Modal Redesign */
.upload-modal {
    width: min(640px, 95%);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.theme-dark .upload-modal {
    background: rgba(19, 24, 34, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

.upload-modal .modal-header {
    background: transparent;
    border-bottom: 1px solid var(--divider);
    padding: 24px 28px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upload-modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.upload-tabs {
    display: flex;
    background: var(--bg-panel-soft);
    padding: 6px;
    gap: 4px;
    margin: 16px 28px 0;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
}

.upload-tab {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upload-tab i {
    font-size: 14px;
    opacity: 0.7;
}

.upload-tab:hover {
    color: var(--text-primary);
    background: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.05);
}

.upload-tab.active {
    background: var(--bg-panel);
    color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-dark .upload-tab.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.upload-body {
    padding: 24px 28px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-drop-zone {
    border: 2px dashed var(--divider);
    border-radius: 20px;
    background: var(--bg-panel-soft);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.upload-drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-soft), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.upload-drop-zone:hover::before {
    opacity: 1;
}

.upload-icon-large {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-primary);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 4px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.upload-drop-zone:hover .upload-icon-large {
    transform: scale(1.1) rotate(-5deg);
}

.upload-instruction {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
}

.upload-sub-instruction {
    font-size: 13px;
    color: var(--text-secondary);
    z-index: 1;
}

.upload-file-list {
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    display: none;
}

.upload-file-list.has-files {
    display: flex;
}

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.upload-file-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-color: var(--divider);
}

.upload-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.upload-file-info {
    flex: 1;
    min-width: 0;
}

.upload-file-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.upload-file-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-file-remove {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.upload-file-remove:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.upload-status-area {
    margin-top: 4px;
    padding: 16px;
    background: var(--bg-panel-soft);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    display: none;
}

.upload-status-area.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-progress-bar {
    height: 8px;
    background: var(--divider);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #60a5fa);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.upload-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

#upload-status-text {
    color: var(--accent-primary);
}

.upload-scan-status {
    margin-top: 4px;
    padding: 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.upload-scan-status .scan-icon {
    font-size: 28px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.upload-scan-status .scan-message {
    flex: 1;
}

.upload-scan-status .scan-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-scan-status .scan-detail {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.upload-scan-status .scan-spinner {
    font-size: 20px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.upload-modal .modal-actions {
    margin-top: 8px;
}

.upload-modal .modal-actions .btn-primary {
    width: 100%;
    height: 52px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 4px 12px var(--accent-soft);
}

.upload-modal .modal-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--text-muted);
    border-color: transparent;
    box-shadow: none;
}

/* Custom scrollbar for file list */
.upload-file-list::-webkit-scrollbar {
    width: 6px;
}

.upload-file-list::-webkit-scrollbar-track {
    background: transparent;
}

.upload-file-list::-webkit-scrollbar-thumb {
    background: var(--divider);
    border-radius: 10px;
}

.upload-file-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    -webkit-transform: translateX(18px);
    -ms-transform: translateX(18px);
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}
