/* Private file cabinet */
.file-page-shell { padding: 24px 0 80px; }
.file-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 0 auto 18px; max-width: 980px; }
.file-hero h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: 0; color: #222; }
.file-hero p { margin: 6px 0 0; color: #8f8f95; font-size: 14px; }
.file-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.file-btn { border: 0; border-radius: 10px; background: #1f2026; color: #fff; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; text-decoration: none; }
.file-btn.secondary { background: rgba(0,0,0,.06); color: #333; }
.file-btn.danger { background: #ff5b66; color: #fff; }
.file-panel { max-width: 980px; margin: 0 auto; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.65); border-radius: 12px; overflow: hidden; backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: 0 18px 45px rgba(30,30,35,.08); }
.file-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid rgba(0,0,0,.05); }
.file-breadcrumb { display: flex; align-items: center; gap: 8px; color: #7f7f86; font-size: 13px; min-width: 0; }
.file-breadcrumb button { border: 0; background: transparent; color: #222; cursor: pointer; padding: 4px 2px; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th { text-align: left; font-size: 12px; color: #9b9ba1; font-weight: 500; padding: 12px 16px; background: rgba(250,250,252,.62); }
.file-table td { padding: 12px 16px; border-top: 1px solid rgba(0,0,0,.045); font-size: 14px; color: #2e2e32; vertical-align: middle; }
.file-row { transition: background .18s ease; }
.file-row:hover { background: rgba(0,0,0,.025); }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { width: 42px; height: 42px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,.055); color: #555; flex: 0 0 auto; }
.file-icon.dir { background: rgba(255, 193, 77, .22); color: #b87600; }
.file-icon svg { width: 19px; height: 19px; }
.file-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.file-icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(0,0,0,.045); color: #444; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.file-icon-btn:hover { background: rgba(0,0,0,.08); }
.file-empty { padding: 58px 20px; text-align: center; color: #aaa; }
.file-upload-input { display: none; }
.file-editor-modal { position: fixed; inset: 0; z-index: 100004; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.18); backdrop-filter: blur(4px); }
.file-editor-modal.active { display: flex; }
.file-editor-card { width: min(920px, calc(100vw - 28px)); height: min(720px, calc(100vh - 34px)); background: rgba(248,248,250,.94); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.file-editor-head { height: 54px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,.06); }
.file-editor-title { font-weight: 600; color: #222; }
.file-editor { flex: 1; width: 100%; border: 0; outline: none; resize: none; padding: 16px; font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255,255,255,.78); color: #25252a; }
@media (max-width: 768px) { .file-page-shell { padding: 14px 12px 92px; } .file-hero { align-items: flex-start; flex-direction: column; } .file-actions { justify-content: flex-start; } .file-panel { border-radius: 10px; } .file-table th:nth-child(2), .file-table th:nth-child(3), .file-table td:nth-child(2), .file-table td:nth-child(3) { display: none; } .file-table td, .file-table th { padding: 12px 10px; } }


.file-drop-hint { display: inline-flex; align-items: center; gap: 6px; color: #a0a0a6; font-size: 13px; white-space: nowrap; }
.file-drop-hint i, .file-drop-hint svg { width: 15px; height: 15px; }
.file-panel.is-dragging { border-color: rgba(31,32,38,.28); box-shadow: 0 24px 70px rgba(31,32,38,.16); }
.file-panel.is-dragging::after { content: "Drop files to upload"; position: absolute; inset: 12px; border: 2px dashed rgba(31,32,38,.22); border-radius: 10px; background: rgba(255,255,255,.72); display: flex; align-items: center; justify-content: center; color: #2f3036; font-size: 18px; font-weight: 600; pointer-events: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.file-panel { position: relative; }
@media (max-width: 768px) { .file-drop-hint { display: none; } }


.file-login-panel { min-height: 360px; display: flex; align-items: center; justify-content: center; }
.file-auth-box { width: min(420px, calc(100% - 32px)); text-align: center; padding: 44px 18px; }
.file-auth-icon { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.06); color: #2f3036; }
.file-auth-icon svg { width: 24px; height: 24px; }
.file-auth-box h2 { margin: 0; font-size: 22px; color: #25252a; }
.file-auth-box p { margin: 8px 0 20px; color: #92929a; font-size: 14px; line-height: 1.7; }
.file-auth-form { display: flex; gap: 10px; justify-content: center; }
.file-auth-form input { height: 40px; min-width: 0; flex: 1; border: 0; outline: none; border-radius: 10px; padding: 0 13px; background: rgba(0,0,0,.055); color: #242429; }
@media (max-width: 520px) { .file-auth-form { flex-direction: column; } .file-auth-form .file-btn { justify-content: center; } }




/* Fixed-height file cabinet with internal scrolling */
.file-panel { height: 507px; min-height: 0; display: flex; flex-direction: column; }
.file-toolbar { flex: 0 0 auto; }
.file-table-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.file-table-scroll::-webkit-scrollbar { width: 8px; }
.file-table-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 999px; }
.file-table-scroll::-webkit-scrollbar-track { background: transparent; }
.file-table td { height: 52px; }
.file-table .file-empty { min-height: 220px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 768px) { .file-panel { height: 613px; } .file-table td { height: 54px; } }


.file-thumb { width: 42px; height: 42px; border-radius: 9px; overflow: hidden; background: rgba(0,0,0,.055); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }


.file-thumb { border: 0; padding: 0; cursor: pointer; }
.file-preview-modal { position: fixed; inset: 0; z-index: 100006; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.36); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.file-preview-modal.active { display: flex; }



/* Direct image lightbox preview */
.file-preview-modal { position: fixed; inset: 0; z-index: 100006; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.file-preview-modal.active { display: flex; }
.file-preview-modal > img { max-width: min(96vw, 1600px); max-height: 94vh; object-fit: contain; display: block; border-radius: 0; box-shadow: none; background: transparent; }
.file-preview-close { position: fixed; top: 18px; right: 18px; z-index: 1; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: #222; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,.18); }
.file-preview-close:hover { background: #fff; }
.file-preview-close svg { width: 22px; height: 22px; }
.file-preview-lock { overflow: hidden; }
@media (max-width: 768px) { .file-preview-modal { padding: 12px; } .file-preview-close { top: 12px; right: 12px; } .file-preview-modal > img { max-width: 96vw; max-height: 92vh; } }


.file-zip-modal { position: fixed; inset: 0; z-index: 100005; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.28); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.file-zip-modal.active { display: flex; }
.file-zip-card { width: min(860px, calc(100vw - 32px)); height: min(720px, calc(100vh - 36px)); background: rgba(248,248,250,.96); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.file-zip-head { height: 58px; padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,.06); }
.file-zip-title { font-weight: 700; color: #25252a; max-width: 640px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-zip-subtitle { margin-top: 2px; font-size: 12px; color: #999aa1; }
.file-zip-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.file-zip-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 100px; align-items: center; gap: 8px; min-height: 38px; padding: 6px 9px; border-radius: 9px; color: #303038; }
.file-zip-item:hover { background: rgba(0,0,0,.045); }
.file-zip-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,.05); color: #555; }
.file-zip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-zip-size { text-align: right; color: #92929a; font-size: 12px; }
@media (max-width: 768px) { .file-zip-modal { padding: 10px; } .file-zip-card { width: calc(100vw - 20px); height: calc(100vh - 20px); } .file-zip-item { grid-template-columns: 30px minmax(0, 1fr) 72px; } }


.file-zip-breadcrumb { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-bottom: 1px solid rgba(0,0,0,.05); color: #8f8f96; font-size: 13px; overflow-x: auto; }
.file-zip-breadcrumb button { border: 0; background: transparent; color: #25252a; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.file-zip-item.is-dir { cursor: pointer; }
.file-zip-item.is-dir .file-zip-icon { background: rgba(255, 193, 77, .22); color: #b87600; }


.file-dialog-modal { position: fixed; inset: 0; z-index: 100007; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(0,0,0,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.file-dialog-modal.active { display: flex; }
.file-dialog-card { width: min(420px, calc(100vw - 32px)); background: rgba(248,248,250,.96); border: 1px solid rgba(255,255,255,.62); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.file-dialog-head { min-height: 58px; padding: 12px 14px 12px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,.06); }
.file-dialog-title { font-weight: 700; color: #25252a; }
.file-dialog-subtitle { margin-top: 3px; color: #999aa1; font-size: 12px; word-break: break-all; }
.file-dialog-body { padding: 18px; }
.file-dialog-input { width: 100%; height: 42px; border: 0; outline: none; border-radius: 10px; padding: 0 13px; background: rgba(0,0,0,.055); color: #242429; font-size: 14px; }
.file-dialog-text { margin: 0; color: #73737b; font-size: 14px; line-height: 1.7; }
.file-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }
.file-dialog-actions .file-btn { min-width: 82px; justify-content: center; }
@media (max-width: 520px) { .file-dialog-actions { padding: 0 14px 14px; } .file-dialog-body { padding: 14px; } }

.file-dialog-share { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.file-dialog-share label { min-height: 36px; border-radius: 10px; background: rgba(0,0,0,.045); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #52525a; font-size: 13px; }
.file-dialog-share input { position: absolute; opacity: 0; pointer-events: none; }
.file-dialog-share label:has(input:checked) { background: #1f2026; color: #fff; }
@supports not selector(:has(*)) { .file-dialog-share label { border: 1px solid rgba(0,0,0,.06); } }
@media (max-width: 520px) { .file-dialog-share { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.file-auth-cell { display: flex; align-items: center; gap: 8px; min-width: 126px; }
.file-auth-badge { min-width: 42px; height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(31,32,38,.08); color: #303038; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; white-space: nowrap; }
.file-auth-badge.muted { color: #9a9aa2; background: rgba(0,0,0,.045); }
.file-auth-time { color: #9a9aa2; font-size: 12px; white-space: nowrap; }
@media (max-width: 768px) { .file-auth-cell { min-width: auto; justify-content: flex-start; } .file-auth-time { display: none; } .file-auth-badge { min-width: 38px; padding: 0 7px; } }

.file-auth-date { color: #4c4c54; font-size: 13px; white-space: nowrap; }
.file-auth-date.muted { color: #aaaab2; }

.file-row[data-row-type="dir"], .file-row[data-row-type="zip"], .file-row[data-row-type="image"], .file-row[data-row-type="zip-dir"] { cursor: pointer; }

.file-row[data-row-editable="1"] { cursor: pointer; }

.file-guest-link { margin-top: 12px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; background: rgba(0,0,0,.055); color: #333; text-decoration: none; font-size: 14px; }
.file-guest-link svg { width: 17px; height: 17px; }

.file-guest-mode .file-actions, .file-guest-mode .file-drop-hint { display: none !important; }

.file-parent-row .file-name button { font-weight: 600; color: #3a3a42; }
.file-parent-row .file-icon { background: rgba(31,32,38,.08); color: #383840; }

.file-toolbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.file-toolbar-btn { height: 32px; border: 0; border-radius: 9px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.055); color: #333; cursor: pointer; font-size: 13px; }
.file-toolbar-btn:hover { background: rgba(0,0,0,.09); }
.file-toolbar-btn svg { width: 16px; height: 16px; }
@media (max-width: 520px) { .file-toolbar { padding: 0 10px; } .file-toolbar-actions { gap: 6px; } .file-toolbar-btn { padding: 0 8px; } }

.file-auth-links { margin-top: 12px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.file-auth-links .file-guest-link, .file-register-link { height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; background: rgba(0,0,0,.055); color: #333; text-decoration: none; font-size: 14px; border: 0; cursor: pointer; }
.file-auth-links .file-guest-link { margin-top: 0; }
.file-auth-links svg { width: 17px; height: 17px; }
.file-register-link:hover, .file-auth-links .file-guest-link:hover { background: rgba(0,0,0,.09); }

.file-context-menu { position: fixed; z-index: 100020; min-width: 164px; display: none; padding: 6px; border-radius: 12px; background: rgba(250,250,252,.96); border: 1px solid rgba(0,0,0,.06); box-shadow: 0 18px 50px rgba(0,0,0,.18); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.file-context-menu.active { display: block; }
.file-context-menu button { width: 100%; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #303038; display: flex; align-items: center; gap: 9px; padding: 0 10px; font-size: 13px; cursor: pointer; text-align: left; }
.file-context-menu button:hover { background: rgba(0,0,0,.055); }
.file-context-menu button.danger { color: #e24a55; }
.file-context-menu svg { width: 16px; height: 16px; }

.file-table-scroll,
.file-table-scroll .file-row,
.file-table-scroll .file-name,
.file-table-scroll .file-name button,
.file-table-scroll .file-name span,
.file-table-scroll .file-row-actions {
    -webkit-user-select: none;
    user-select: none;
}
