@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #18181b;
    --bg-secondary: #27272a;
    --bg-card: linear-gradient(160deg, #2c2c30 0%, #27272a 55%, #232326 100%);
    --bg-card-solid: #27272a;
    --bg-hover: #323232;
    --accent: #cc1c39;
    --accent-hover: #a51935;
    --accent-soft: rgba(204, 28, 57, 0.18);
    --accent-glow: rgba(204, 28, 57, 0.35);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --success: #2ecc71;
    --error: #e74c3c;
    --folder-color: #eab308;
    --icon-color: #a1a1aa;
    --sidebar-width: 280px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(420px circle at -80px -120px, rgba(204, 28, 57, 0.12), transparent 65%),
        radial-gradient(360px circle at calc(100% - 10%) calc(100% + 40px), rgba(95, 6, 37, 0.14), transparent 65%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at center, black 45%, transparent 92%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 45%, transparent 92%);
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(204, 28, 57, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #ff8a80;
}

.alert-success {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #69f0ae;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(160deg, #2a2a2e 0%, #18181b 45%, #141416 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: var(--shadow);
}

.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: var(--accent);
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
    flex-shrink: 0;
}

.brand-mark-md {
    font-size: 42px;
    margin: 0 auto;
    color: var(--accent);
}

.brand h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label span {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-form input,
.settings-form input,
.modal-box input {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
}

.login-form input:focus,
.settings-form input:focus,
.modal-box input:focus {
    border-color: rgba(204, 28, 57, 0.45);
    box-shadow: 0 0 0 3px rgba(204, 28, 57, 0.12);
}

.login-form .btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    padding: 14px;
    font-size: 15px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(24, 24, 27, 0.72);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 12px 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.sidebar-brand .brand-mark {
    font-size: 28px;
}

.sidebar-brand span {
    line-height: 1.2;
}

.sidebar-brand i {
    color: var(--accent);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: #fff;
    border-color: rgba(204, 28, 57, 0.28);
}

.sidebar-tree {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 8px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.sidebar-tree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-tree-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sidebar-tree-title i {
    font-size: 12px;
}

.sidebar-tree-toggle {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.sidebar-tree-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.sidebar-tree.is-collapsed {
    flex: 0 0 auto;
}

.sidebar-tree.is-collapsed .sidebar-tree-body {
    display: none;
}

.sidebar-tree-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 0;
}

.file-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-node {
    user-select: none;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 30px;
    padding-right: 8px;
}

.tree-toggle {
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    font-size: 10px;
    transition: color var(--transition), background var(--transition);
}

.tree-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.tree-toggle.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    padding: 5px 8px 5px 0;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
    transition: background var(--transition), color var(--transition);
}

.tree-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.tree-link.is-active {
    background: var(--accent-soft);
    color: #fff;
}

.tree-link.is-file-previewable {
    cursor: pointer;
}

.tree-link i {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    font-size: 12px;
}

.tree-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-children {
    margin-left: 11px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.tree-children[hidden] {
    display: none;
}

.tree-loading {
    padding: 4px 0 4px 34px;
    font-size: 11px;
    color: var(--text-muted);
}

.disk-widget {
    margin-top: auto;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.disk-section-drive {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.disk-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.disk-header i {
    color: var(--text-secondary);
    margin-right: 4px;
}

.disk-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.disk-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.disk-bar-fill-drive {
    background: #71717a;
}

.disk-info {
    font-size: 13px;
    font-weight: 600;
}

.disk-free {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.logout-form {
    margin-top: 0;
}

.logout-btn {
    color: var(--text-muted);
}

.logout-btn:hover {
    color: var(--error);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.toolbar h2 {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar h2 i {
    color: var(--text-secondary);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs .sep {
    color: var(--text-muted);
    font-size: 10px;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.upload-label {
    cursor: pointer;
}

.drop-zone {
    position: relative;
    min-height: 400px;
    border: 2px dashed transparent;
    border-radius: var(--radius);
    transition: border-color var(--transition), background var(--transition);
}

.drop-zone.dragover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone-inner {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(24, 24, 27, 0.88);
    border-radius: var(--radius);
    z-index: 10;
    font-size: 18px;
    gap: 12px;
    color: var(--text-primary);
}

.drop-zone-inner.is-visible {
    display: flex;
}

.drop-zone-inner i {
    font-size: 48px;
    color: var(--text-secondary);
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.drive-item {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.drive-item-folder,
.drive-item-image,
.drive-item[data-preview-kind] {
    cursor: pointer;
}

.drive-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.drive-item-preview {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.drive-item-preview .folder-icon,
.drive-item-preview .file-type-icon {
    font-size: 56px;
}

.drive-item-preview .file-type-icon {
    color: var(--icon-color);
}

.drive-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.drive-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.drive-item:hover .drive-item-actions {
    opacity: 1;
    transform: translateY(0);
}

.item-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(24, 24, 27, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 13px;
}

.item-action:hover {
    background: rgba(255, 255, 255, 0.12);
}

.item-action.delete-btn:hover {
    color: #ff8a80;
}

.drive-item-name {
    padding: 10px 12px 4px;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    min-width: 280px;
    box-shadow: var(--shadow);
    z-index: 200;
}

.upload-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.modal-box {
    position: relative;
    background: linear-gradient(160deg, #2a2a2e 0%, #18181b 45%, #141416 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.modal-box h3 {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-box h3 i {
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-error {
    margin-top: 12px;
    font-size: 13px;
    color: #ff8a80;
    min-height: 18px;
}

.modal-box-sm {
    max-width: 380px;
}

.modal-box-wide {
    max-width: 520px;
}

.confirm-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.modal-styled {
    text-align: center;
}

.modal-styled h3 {
    justify-content: center;
    margin-bottom: 10px;
}

.modal-brand {
    margin-bottom: 16px;
}

.modal-actions-center {
    justify-content: center;
}

.modal-box-share {
    max-width: 460px;
    padding: 26px 28px 24px;
}

.share-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.share-modal-head h3 {
    margin-bottom: 2px;
    font-size: 20px;
}

.share-modal-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.share-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 20px;
    flex-shrink: 0;
}

.share-item-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 22px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.share-item-chip i {
    font-size: 22px;
    color: var(--icon-color);
    flex-shrink: 0;
}

.share-item-chip i.fa-folder {
    color: var(--folder-color);
}

.share-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
}

.share-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.share-option {
    display: block;
    cursor: pointer;
}

.share-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.share-option-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.share-option:hover .share-option-body {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.share-option:has(input:checked) .share-option-body {
    border-color: rgba(204, 28, 57, 0.45);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(204, 28, 57, 0.12);
}

.share-option-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 15px;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.share-option:has(input:checked) .share-option-icon {
    background: rgba(204, 28, 57, 0.22);
    color: var(--accent);
}

.share-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.share-option-text strong {
    font-size: 14px;
    font-weight: 600;
}

.share-option-text small {
    font-size: 12px;
    color: var(--text-muted);
}

.share-option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.share-option:has(input:checked) .share-option-check {
    opacity: 1;
    transform: scale(1);
}

.share-link-panel {
    margin-bottom: 16px;
    padding-top: 2px;
}

.share-link-wrap {
    display: flex;
    gap: 8px;
}

.share-link-wrap input {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.28);
}

.share-link-wrap input:focus {
    color: var(--text-primary);
}

.share-link-wrap .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.share-link-wrap .btn.is-copied {
    background: var(--success);
}

.share-link-wrap .btn.is-copied:hover {
    background: #27ae60;
}

.share-info-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    margin-bottom: 4px;
}

.share-info-box > i {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

.share-info-text p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}

.share-info-text p + p {
    margin-top: 4px;
}

.btn-danger {
    background: var(--accent);
    color: #fff;
}

.btn-danger:hover {
    background: var(--accent-hover);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.icon-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
    color: var(--text-secondary);
    font-size: 11px;
}

.icon-option i {
    font-size: 28px;
}

.icon-option:hover,
.icon-option.is-active {
    border-color: rgba(204, 28, 57, 0.4);
    background: rgba(204, 28, 57, 0.12);
    color: var(--text-primary);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox.is-open {
    display: flex;
}

.lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 20px;
    min-height: 0;
}

.lightbox-stage img,
.lightbox-stage video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-stage iframe {
    width: min(960px, 100%);
    height: min(720px, calc(100vh - 160px));
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-stage pre {
    width: min(960px, 100%);
    max-height: calc(100vh - 160px);
    overflow: auto;
    margin: 0;
    padding: 18px 20px;
    border-radius: 8px;
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-size: 18px;
    z-index: 2;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.16);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(24, 24, 27, 0.85);
}

.lightbox-bar span {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-page .settings-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 28px;
    max-width: 520px;
    margin-bottom: 20px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.settings-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.settings-header i {
    font-size: 32px;
    color: var(--text-secondary);
}

.settings-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.settings-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-form label span {
    font-size: 13px;
    color: var(--text-secondary);
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 16px;
}

.info-card h3 i {
    color: var(--text-secondary);
}

.info-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.admin-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-card-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.admin-card-head h3 i {
    color: var(--text-secondary);
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
}

.admin-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition), background var(--transition);
}

.admin-user-row.is-active {
    border-color: rgba(204, 28, 57, 0.35);
    background: var(--accent-soft);
}

.admin-user-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-user-main strong {
    font-size: 14px;
}

.admin-user-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(204, 28, 57, 0.18);
    color: #ffb3c0;
    vertical-align: middle;
}

.admin-user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-user-actions button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.admin-user-actions button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.admin-user-delete:hover {
    color: #ff8a80;
    border-color: rgba(255, 138, 128, 0.35);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-form > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-form > label span {
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-form input[type="text"],
.admin-form input[type="password"] {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.admin-form input:focus {
    border-color: rgba(204, 28, 57, 0.45);
    box-shadow: 0 0 0 3px rgba(204, 28, 57, 0.12);
}

.admin-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -8px;
}

.admin-folders-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.14);
}

.admin-folders-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.admin-folders-head-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-folders-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-folders-title i {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-folders-count {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-folders-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-folders-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.admin-folders-search-wrap i {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.admin-folders-search-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.admin-folders-search-wrap input::placeholder {
    color: var(--text-muted);
}

.admin-folders-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.admin-folder-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.admin-folder-item:last-child {
    margin-bottom: 0;
}

.admin-folder-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
}

.admin-folder-item:has(input:checked) {
    background: var(--accent-soft);
    border-color: rgba(204, 28, 57, 0.28);
}

.admin-folder-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.admin-folder-check {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-hover);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}

.admin-folder-check::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--transition), transform var(--transition);
}

.admin-folder-item:has(input:checked) .admin-folder-check {
    background: var(--accent);
    border-color: var(--accent);
}

.admin-folder-item:has(input:checked) .admin-folder-check::after {
    opacity: 1;
    transform: scale(1);
}

.admin-folder-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(234, 179, 8, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-folder-icon i {
    color: var(--folder-color);
    font-size: 14px;
}

.admin-folder-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.admin-folder-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-folder-path {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-folder-item.is-root .admin-folder-path {
    display: none;
}

.admin-folder-item.is-hidden {
    display: none;
}

.admin-folder-depth-0 { margin-left: 0; }
.admin-folder-depth-1 { margin-left: 12px; }
.admin-folder-depth-2 { margin-left: 24px; }
.admin-folder-depth-3 { margin-left: 36px; }
.admin-folder-depth-4 { margin-left: 48px; }
.admin-folder-depth-5 { margin-left: 60px; }

.admin-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-form-error {
    min-height: 18px;
    font-size: 13px;
    color: #ff8a80;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.flash-wrap {
    margin-bottom: 16px;
}

.share-public-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.share-public-card {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(160deg, #2a2a2e 0%, #18181b 45%, #141416 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
    text-align: center;
}

.share-public-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.share-public-brand .brand-mark {
    font-size: 42px;
}

.share-public-brand span {
    line-height: 1.2;
}

.share-public-preview {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
}

.share-public-preview img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.share-public-icon {
    font-size: 72px;
    color: var(--icon-color);
}

.share-public-preview .folder-icon {
    color: #eab308;
}

.share-public-name {
    font-size: 20px;
    margin-bottom: 10px;
    word-break: break-word;
}

.share-public-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.share-public-download {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
    margin-bottom: 16px;
}

.share-public-note {
    font-size: 12px;
    color: var(--text-muted);
}

.share-public-error {
    padding: 20px 0;
}

.share-public-error i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.share-public-error h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

.share-public-error p {
    color: var(--text-secondary);
    font-size: 14px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .app-layout {
        flex-direction: column;
    }

    .disk-widget {
        margin-top: 16px;
    }

    .drive-item-actions {
        opacity: 1;
        transform: translateY(0);
    }

    .lightbox-stage {
        padding: 60px 20px 20px;
    }

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }
}
