:root {
  color-scheme: light;
  --ink: #242a3a;
  --muted: #8d94a5;
  --muted-dark: #667085;
  --line: #eceef4;
  --canvas: #f7f8fc;
  --white: #fff;
  --purple: #7264e8;
  --purple-dark: #5d50d3;
  --purple-pale: #f0eeff;
  --green: #34a77b;
  --red: #d95e69;
  --shadow: 0 8px 28px rgba(39, 45, 75, .045);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select { font: inherit; }
button { color: inherit; }
.icon { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 252px; display: flex; flex-direction: column; padding: 30px 20px 18px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 20px/1 "Manrope", sans-serif; letter-spacing: -.8px; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #978afb, #6858e6); box-shadow: 0 6px 14px #7465e84d; }
.brand-mark .icon { width: 22px; height: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 600; transition: background .15s, transform .15s, border-color .15s; }
.button:disabled { cursor: wait; opacity: .65; }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--purple); box-shadow: 0 5px 12px #7264e829; }
.button-primary:hover:not(:disabled) { background: var(--purple-dark); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line); }
.button-secondary:hover { border-color: #d3d5e3; background: #fafaff; }
.button-subtle { min-height: 34px; padding: 0 10px; color: var(--muted-dark); background: transparent; }
.button-subtle:hover { background: #f1f0ff; color: var(--purple-dark); }
.sidebar-upload { justify-content: center; min-height: 47px; margin: 43px 0 27px; }
.side-nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 13px; border: 0; border-radius: 10px; color: #787f90; background: transparent; cursor: pointer; text-align: left; font-weight: 600; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { background: #f8f7ff; color: var(--purple); }
.nav-item.active { color: var(--purple-dark); background: var(--purple-pale); }
.sidebar-bottom { margin-top: auto; }
.storage-card { padding: 17px; border: 1px solid #efeff8; border-radius: 14px; background: linear-gradient(145deg, #fbfaff, #fff); }
.storage-icon { display: grid; width: 33px; height: 33px; place-items: center; color: var(--purple); background: var(--purple-pale); border-radius: 10px; }
.storage-icon .icon { width: 18px; height: 18px; }
.storage-title { margin: 12px 0 3px; font-weight: 700; }
.storage-caption, .storage-foot { margin: 0; color: var(--muted); font-size: 12px; }
.progress-track { width: 100%; height: 6px; margin: 13px 0 8px; overflow: hidden; border-radius: 8px; background: #ebe9fb; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--purple); transition: width .3s ease; }
.account-button { margin-top: 16px; padding: 12px 4px; border-top: 1px solid var(--line); border-radius: 0; }
.account-button span { margin-left: auto; max-width: 104px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 400; }
.main-content { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; height: 82px; align-items: center; justify-content: space-between; padding: 0 46px; border-bottom: 1px solid #eff0f5; background: rgba(247,248,252,.92); backdrop-filter: blur(14px); }
.search-box { display: flex; width: min(460px, 60vw); height: 43px; align-items: center; gap: 11px; padding: 0 13px; border: 1px solid #eeeff5; border-radius: 12px; color: #a0a5b3; background: white; }
.search-box .icon { width: 18px; height: 18px; }
.search-box input { width: 100%; outline: none; border: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: #adb2bf; }
.search-box kbd { padding: 3px 5px; border: 1px solid #edeef4; border-radius: 5px; color: #9ca1ae; white-space: nowrap; font: 11px "DM Sans", sans-serif; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #f2a38d, #d86d83); box-shadow: 0 0 0 1px #e9dce0; font-weight: 700; }
.dashboard { max-width: 1440px; margin: 0 auto; padding: 34px 46px 55px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { margin: 0 0 9px; color: #a0a5b3; font-size: 10px; font-weight: 700; letter-spacing: 1.55px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: "Manrope", sans-serif; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 33px); line-height: 1.25; letter-spacing: -1.15px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.breadcrumb { padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; }
.breadcrumb.current { color: var(--purple-dark); font-weight: 600; }
.breadcrumb-separator { color: #c1c4ce; font-size: 12px; }
.desktop-upload { min-height: 43px; }
.welcome-actions { display: flex; align-items: center; gap: 9px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin-bottom: 31px; }
.stat-card { min-height: 144px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.stat-card.stat-primary { border-color: #eae7ff; background: linear-gradient(120deg, #fbfaff, #fff); }
.stat-icon { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 11px; border-radius: 10px; color: var(--purple); background: var(--purple-pale); }
.stat-card:nth-child(2) .stat-icon { color: #37a584; background: #eaf8f3; }
.stat-card:nth-child(3) .stat-icon { color: #e69a55; background: #fff4e7; }
.stat-icon .icon { width: 18px; height: 18px; }
.stat-label { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.stat-value { margin: 0; font: 700 24px/1.25 "Manrope", sans-serif; letter-spacing: -.6px; }
.stat-hint { margin: 3px 0 0; color: #a3a8b6; font-size: 11px; }
.content-panel, .recent-section { padding: 22px 23px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.35px; }
.section-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; align-items: center; gap: 14px; }
.sort-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sort-control select { max-width: 130px; padding: 7px 8px; border: 0; outline: none; color: var(--ink); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; }
.view-toggle { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.view-button { display: grid; width: 30px; height: 28px; place-items: center; border: 0; border-radius: 6px; color: #9ba1af; background: transparent; cursor: pointer; }
.view-button .icon { width: 16px; height: 16px; }
.view-button.active { color: var(--purple-dark); background: var(--purple-pale); }
.folder-grid, .file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.folder-grid:empty, .file-grid:empty { display: none; }
.folder-card { display: flex; align-items: center; min-width: 0; padding: 11px 10px 11px 12px; border: 1px solid #eff0f5; border-radius: 11px; background: #fff; transition: border-color .15s, background .15s; }
.folder-card:hover { border-color: #d9d5ff; background: #fcfbff; }
.folder-open { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.folder-card-icon { flex: 0 0 auto; color: #e2a94d; fill: #fff5dc; }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.folder-actions { display: flex; align-items: center; gap: 1px; }
.icon-button { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #959baa; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--purple-dark); background: var(--purple-pale); }
.icon-button .icon { width: 17px; height: 17px; }
.folder-action { width: 25px; height: 27px; opacity: .68; }
.folder-action .icon { width: 15px; height: 15px; }
.folder-action:hover { opacity: 1; }
.file-grid { margin-top: 10px; }
.file-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #eff0f5; border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.file-card:hover { border-color: #dedaff; box-shadow: 0 5px 17px #4338a50c; }
.file-preview { display: grid; width: 100%; height: 95px; place-items: center; border: 0; color: #9a8df0; background: linear-gradient(145deg, #f6f4ff, #fbfaff); cursor: pointer; }
.preview-file-icon { width: 34px; height: 34px; }
.file-card-main { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 10px 4px; }
.file-select { display: flex; flex: 0 0 auto; align-items: center; }
.file-select input { width: 15px; height: 15px; margin: 0; accent-color: var(--purple); cursor: pointer; }
.file-main { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.file-type-icon { flex: 0 0 auto; width: 18px; height: 18px; color: #9c91eb; }
.file-text { display: grid; min-width: 0; gap: 2px; }
.file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.file-meta { overflow: hidden; color: #a2a7b3; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.file-date { display: block; padding: 3px 12px 9px 38px; color: #a2a7b3; font-size: 10px; }
.file-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.file-card:hover .file-actions, .file-card:focus-within .file-actions { opacity: 1; }
.file-action { width: 28px; height: 28px; color: #787f90; background: #ffffffde; box-shadow: 0 1px 6px #2222; }
.selection-toolbar { display: flex; align-items: center; gap: 7px; margin: -5px 0 17px; padding: 8px 10px; border-radius: 9px; background: #f7f5ff; color: var(--purple-dark); font-size: 12px; font-weight: 600; }
.selection-toolbar > span { margin-right: auto; }
.danger-text { color: var(--red); }
.empty-state { padding: 42px 12px 35px; text-align: center; }
.empty-icon { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 15px; border-radius: 17px; color: var(--purple); background: var(--purple-pale); }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0 auto; max-width: 360px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-actions { display: flex; justify-content: center; gap: 8px; margin-top: 17px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 50px 10px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid #e6e2ff; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.recent-section { margin-top: 20px; padding-bottom: 10px; }
.recent-heading { margin-bottom: 13px; }
.recent-list { display: grid; }
.recent-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 2px; border-top: 1px solid #f2f2f6; }
.recent-row .file-main { gap: 10px; }
.recent-row .file-text { gap: 3px; }
.recent-row .file-text strong { font-size: 12px; }
.recent-row .file-meta { font-size: 10px; }
.recent-date { width: 100px; flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.recent-row > .icon-button { margin-left: auto; }
.recent-empty { margin: 0; padding: 12px 0; color: var(--muted); font-size: 12px; }
.notice { position: fixed; right: 24px; bottom: 22px; z-index: 30; max-width: min(520px, calc(100vw - 40px)); margin: 0; padding: 13px 17px; border: 1px solid #f1cbd0; border-radius: 11px; color: #9d333e; background: #fff8f8; box-shadow: 0 10px 34px #252a3a1a; font-size: 13px; line-height: 1.5; }
.notice.success { border-color: #c9eadc; color: #287d5d; background: #f5fcf8; }
.app-dialog, .preview-dialog { width: min(440px, calc(100% - 32px)); padding: 23px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; box-shadow: 0 20px 70px #18203e2b; }
.app-dialog::backdrop, .preview-dialog::backdrop { background: #252b3d6e; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.dialog-heading h2 { margin: 0; font-size: 19px; }
.dialog-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.field-label { display: block; margin: 15px 0 7px; color: #535a6c; font-size: 12px; font-weight: 600; }
.text-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #e3e5ed; border-radius: 9px; outline: none; color: var(--ink); background: #fff; }
.text-input:focus { border-color: #a69cf3; box-shadow: 0 0 0 3px #7264e81a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.form-error { margin: 9px 0 0; color: #b6414c; font-size: 12px; }
.preview-dialog { width: min(900px, calc(100% - 32px)); max-width: 900px; height: min(720px, calc(100% - 32px)); padding: 0; overflow: hidden; }
.preview-heading { display: flex; height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.preview-heading span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-body { display: flex; height: calc(100% - 58px); align-items: center; justify-content: center; padding: 20px; overflow: auto; background: #f8f9fc; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: white; }
.preview-body pre { width: 100%; height: 100%; margin: 0; padding: 18px; overflow: auto; border-radius: 9px; background: white; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-body > p { color: var(--muted-dark); }
.preview-body > .button { margin-left: 12px; }
.upload-status { position: fixed; right: 24px; bottom: 22px; z-index: 25; display: flex; align-items: center; gap: 12px; width: min(325px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 10px 34px #252a3a1a; }
.upload-status > div { display: grid; min-width: 0; gap: 3px; }
.upload-status strong { font-size: 12px; }
.upload-status > div span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.mobile-menu { display: none; }
.list-view { grid-template-columns: 1fr; }
.folder-grid.list-view .folder-card { min-height: 45px; }
.file-grid.list-view .file-card { display: flex; align-items: center; min-height: 53px; padding-right: 85px; }
.file-grid.list-view .file-preview { display: none; }
.file-grid.list-view .file-card-main { flex: 1; padding: 10px 12px; }
.file-grid.list-view .file-date { width: 115px; padding: 0; }
.file-grid.list-view .file-actions { top: 10px; opacity: 1; }
@media (min-width: 1440px) { .folder-grid, .file-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .sidebar { width: 220px; padding-inline: 16px; }
  .main-content { margin-left: 220px; }
  .dashboard, .topbar { padding-right: 28px; padding-left: 28px; }
  .folder-grid, .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 260px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 35px #1b224018; }
  .sidebar.sidebar-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { height: 68px; gap: 11px; padding: 0 18px; }
  .mobile-menu { display: grid; }
  .search-box { width: auto; flex: 1; }
  .search-box kbd { display: none; }
  .topbar-actions { gap: 8px; }
  .dashboard { padding: 25px 18px 38px; }
  .stats-grid { gap: 10px; margin-bottom: 20px; }
  .stat-card { min-height: 129px; padding: 13px; }
  .stat-value { font-size: 21px; }
  .stat-hint { font-size: 10px; }
  .content-panel, .recent-section { padding: 17px 14px; }
  .folder-grid, .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-heading { align-items: flex-start; }
  .panel-actions { gap: 4px; }
  .sort-control { gap: 0; font-size: 0; }
  .sort-control select { max-width: 105px; font-size: 11px; }
  .desktop-upload { min-height: 39px; padding: 0 10px; font-size: 12px; }
}
@media (max-width: 470px) {
  .topbar { padding: 0 12px; }
  .dashboard { padding: 21px 12px 30px; }
  .welcome-row { margin-bottom: 18px; }
  .desktop-upload { width: 40px; height: 40px; min-height: 40px; padding: 0; overflow: hidden; gap: 0; color: transparent; font-size: 0; }
  .desktop-upload .icon { width: 19px; height: 19px; color: #fff; }
  #create-folder-main { width: 40px; height: 40px; min-height: 40px; padding: 0; overflow: hidden; gap: 0; color: transparent; font-size: 0; }
  #create-folder-main .icon { width: 19px; height: 19px; color: var(--ink); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card:nth-child(3) { display: none; }
  .stat-card { min-height: 122px; }
  .folder-grid, .file-grid { grid-template-columns: 1fr; }
  .file-preview { height: 80px; }
  .panel-heading { gap: 8px; }
  .panel-heading h2 { font-size: 15px; }
  .section-subtitle { font-size: 10px; }
  .sort-control select { max-width: 90px; padding-inline: 3px; }
  .view-button { width: 27px; }
  .recent-date { display: none; }
  .recent-row { gap: 7px; }
  .selection-toolbar { flex-wrap: wrap; }
}
