:root {
  color-scheme: light;
  --bg: #f6f7f8; --surface: #fff; --surface-2: #f0f2f4; --text: #25292d; --muted: #6b7278;
  --line: #dfe3e6; --accent: #315d7a; --accent-strong: #244a64; --accent-soft: #e8eff3;
  --green: #28714e; --green-soft: #e9f2ec; --red: #a33b37; --red-soft: #f8eceb; --shadow: 0 8px 24px #17212b12;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #17191b; --surface: #202326; --surface-2: #292d30; --text: #e9ebed;
  --muted: #a1a7ab; --line: #383d40; --accent: #91b6cc; --accent-strong: #b5d0df; --accent-soft: #293840;
  --green: #82c39d; --green-soft: #293a30; --red: #e39b96; --red-soft: #402d2c; --shadow: 0 8px 24px #0005;
}
* { box-sizing: border-box; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 14px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
.hidden { display: none !important; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 252px; padding: 24px 18px 20px; background: var(--surface); border-right: 1px solid var(--line); z-index: 4; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 0 26px 7px; color: var(--text); text-decoration: none; font: 650 16px system-ui, sans-serif; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 7px; color: #fff; background: #315d7a; font: 650 20px system-ui, sans-serif; }
.brand-mark.small { width: 28px; height: 28px; border-radius: 5px; font-size: 15px; }
.button { border: 0; border-radius: 6px; min-height: 38px; padding: 0 13px; font-weight: 550; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-strong); }
.button.secondary { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.button.secondary:hover { background: var(--surface-2); }
.button.full { width: 100%; margin-top: 21px; min-height: 42px; }
.upload-trigger { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; margin: 0 0 24px; }
.upload-trigger .icon { width: 17px; height: 17px; }
.navigation { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 0; padding: 10px 12px; border-radius: 5px; color: var(--muted); text-align: left; background: transparent; font-weight: 450; }
.nav-item .icon { width: 18px; height: 18px; color: var(--muted); }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }
.storage-summary { margin-top: auto; padding: 17px 11px 14px; }
.storage-label { display: flex; justify-content: space-between; font-weight: 600; font-size: 12px; }
.storage-label span:last-child, .storage-summary p { color: var(--muted); }
.storage-track { height: 6px; overflow: hidden; margin-top: 11px; border-radius: 99px; background: var(--surface-2); }
.storage-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s; }
.storage-track .fill-level-1 { width: 5%; }
.storage-track .fill-level-2 { width: 10%; }
.storage-track .fill-level-3 { width: 15%; }
.storage-track .fill-level-4 { width: 20%; }
.storage-track .fill-level-5 { width: 25%; }
.storage-track .fill-level-6 { width: 30%; }
.storage-track .fill-level-7 { width: 35%; }
.storage-track .fill-level-8 { width: 40%; }
.storage-track .fill-level-9 { width: 45%; }
.storage-track .fill-level-10 { width: 50%; }
.storage-track .fill-level-11 { width: 55%; }
.storage-track .fill-level-12 { width: 60%; }
.storage-track .fill-level-13 { width: 65%; }
.storage-track .fill-level-14 { width: 70%; }
.storage-track .fill-level-15 { width: 75%; }
.storage-track .fill-level-16 { width: 80%; }
.storage-track .fill-level-17 { width: 85%; }
.storage-track .fill-level-18 { width: 90%; }
.storage-track .fill-level-19 { width: 95%; }
.storage-track .fill-level-20 { width: 100%; }
.storage-summary p { margin: 9px 0 0; font-size: 11px; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 15px 11px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #54bd8c; }
.main-panel { width: calc(100% - 252px); min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 5vw; border-bottom: 1px solid var(--line); background: var(--bg); z-index: 3; }
.search-wrap { display: flex; align-items: center; gap: 10px; width: min(460px, 55%); height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.search-wrap:focus-within { border-color: var(--accent); background: var(--surface); }
.search-wrap > .search-icon { width: 18px; height: 18px; }
.search-wrap input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-wrap input::placeholder { color: var(--muted); }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 17px; }
.icon-button { display: grid; place-items: center; width: 37px; height: 37px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 19px; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; font-size: 12px; font-weight: 600; }
.profile-button .profile-chevron { width: 15px; height: 15px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.profile-menu { position: absolute; top: 48px; right: 0; min-width: 140px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.profile-menu button { width: 100%; border: 0; border-radius: 6px; padding: 9px; text-align: left; background: transparent; }
.profile-menu button:hover { background: var(--surface-2); }
.content { max-width: 1360px; margin: 0 auto; padding: 34px 5vw 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 550; letter-spacing: 0; }
#section-eyebrow:empty { display: none; }
h1, h2 { margin: 0; font-family: inherit; letter-spacing: -.3px; }
.page-heading h1 { font-size: clamp(23px, 3vw, 28px); font-weight: 620; }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.view-toggle { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.view-option { display: grid; place-items: center; width: 31px; height: 29px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.view-option .icon { width: 17px; height: 17px; }
.view-option.selected { color: var(--accent); background: var(--accent-soft); }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.breadcrumbs button { border: 0; padding: 0; color: inherit; background: none; }
.breadcrumbs button:hover { color: var(--accent); }
.file-area { position: relative; min-height: 330px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.file-table { width: 100%; border-collapse: collapse; min-width: 690px; }
.file-table th { height: 46px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; }
.file-table th.selection-column { width: 40px; padding-right: 0; }
.file-table td.selection-column { width: 40px; padding-right: 0; }
.file-table th:first-child { padding-left: 20px; }
.file-table th button { border: 0; padding: 5px 0; color: inherit; background: transparent; font-size: inherit; font-weight: inherit; }
.file-table td { height: 61px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.file-table td:first-child { padding-left: 20px; color: var(--text); }
.file-name { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.select-file { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.grid-select { position: absolute; top: 24px; left: 18px; z-index: 1; }
.bulk-actions { display: flex; align-items: center; gap: 12px; margin: -14px 0 20px; color: var(--muted); font-size: 12px; }
.scan-disclaimer { margin: -16px 0 25px; color: var(--muted); font-size: 11px; }
.cancel-upload { min-height: 30px; margin-top: 7px; padding: 0 11px; font-size: 11px; }
.folder-title-button { border: 0; padding: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.file-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 6px; color: var(--accent); background: var(--accent-soft); }
.file-icon .icon { width: 21px; height: 21px; }
.file-title { overflow: hidden; max-width: 330px; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.file-subtitle { margin-top: 3px; color: var(--muted); font-size: 10px; }
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 20px; padding: 5px 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 600; }
.badge.passed { background: var(--green-soft); color: var(--green); }
.badge.blocked { background: var(--red-soft); color: var(--red); }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.row-actions button { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; }
.row-actions button .icon { width: 17px; height: 17px; }
.row-actions button.is-starred { color: #a77a1d; }
.row-actions button.is-starred .icon { fill: currentColor; }
.row-actions button[data-action="purge"] { color: var(--red); }
.row-actions button:hover { color: var(--accent); background: var(--accent-soft); }
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 13px; }
.grid-card { position: relative; min-height: 144px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.grid-card:hover { border-color: var(--accent); }
.grid-card .file-icon { width: 42px; height: 42px; margin-bottom: 16px; }
.grid-card .file-icon .icon { width: 25px; height: 25px; }
.grid-card .row-actions { position: absolute; top: 14px; right: 10px; opacity: 1; }
.grid-card .file-title { display: block; max-width: calc(100% - 35px); }
.grid-card .badge { margin-top: 10px; }
.empty-state { display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 36px; margin-bottom: 12px; border-radius: 4px; color: var(--muted); background: var(--surface-2); }
.empty-state h2 { font-size: 19px; }
.empty-state p { margin: 9px 0 20px; color: var(--muted); }
.loading { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 250px; color: var(--muted); }
.spinner { width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop-overlay { position: absolute; inset: 0; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: 6px; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); z-index: 2; font: 650 18px system-ui, sans-serif; pointer-events: none; }
.file-area.dragging .drop-overlay { display: grid; }
.upload-status { margin: -12px 0 16px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: var(--muted); background: var(--surface); }
.upload-status progress { width: 100%; height: 6px; accent-color: var(--accent); }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: #101222a8; z-index: 10; }
.editor-modal { display: flex; width: min(850px, 100%); height: min(680px, 90vh); flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.editor-modal header, .editor-modal footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-modal h2 { font-size: 20px; }
.editor-modal textarea { flex: 1; min-height: 0; resize: none; margin: 18px 0; border: 1px solid var(--line); border-radius: 9px; padding: 15px; outline: 0; color: var(--text); background: var(--bg); font: 13px/1.6 ui-monospace, monospace; }
.editor-modal textarea:focus { border-color: var(--accent); }
.editor-modal footer { justify-content: flex-end; }
.editor-modal footer .muted { margin-right: auto; font-size: 11px; }
.move-modal { width: min(460px, 100%); padding: 23px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.move-modal header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.move-modal h2 { font-size: 20px; }
.move-modal label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.move-modal select { width: 100%; height: 44px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--text); background: var(--bg); }
.move-modal footer { display: flex; justify-content: flex-end; gap: 9px; }
.share-modal { width: min(540px, 100%); max-height: min(780px, 92vh); overflow-y: auto; padding: 23px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.share-modal header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.share-modal h2 { font-size: 20px; }
.share-modal > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.share-modal > input[type="search"] { width: 100%; height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; outline: 0; color: var(--text); background: var(--bg); }
.share-modal > input[type="search"]:focus { border-color: var(--accent); }
.share-search-results { display: grid; gap: 3px; margin-top: 5px; }
.share-search-option { width: 100%; border: 0; border-radius: 7px; padding: 9px 10px; text-align: left; color: var(--text); background: transparent; }
.share-search-option:hover { background: var(--surface-2); }
.share-empty { margin: 8px 0; font-size: 12px; }
.share-selected-user { margin-top: 13px; border-radius: 5px; padding: 10px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 600; }
.share-permissions { display: grid; gap: 10px; margin: 15px 0; border: 1px solid var(--line); border-radius: 6px; padding: 13px; }
.share-permissions legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.share-permissions label { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.share-permissions input { accent-color: var(--accent); }
.existing-shares { margin: 20px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.existing-shares h3 { margin: 0 0 9px; font: 600 12px system-ui, sans-serif; }
.share-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.share-list-row > div { display: grid; gap: 3px; }
.share-list-row strong { font-size: 12px; }
.share-list-row .muted { font-size: 10px; }
.revoke-share { min-height: 31px; padding: 0 9px; font-size: 10px; }
.share-modal footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 15px; }
.share-modal footer .muted { margin-right: auto; font-size: 10px; line-height: 1.4; }
.upload-choice-modal { width: min(420px, 100%); padding: 23px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.upload-choice-modal h2 { margin-top: 0; font-size: 20px; }
.upload-choice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.nav-item { font-size: 12px; }
.toast-region { position: fixed; right: 22px; bottom: 20px; display: grid; gap: 8px; z-index: 20; }
.toast { max-width: 360px; border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast.error { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.muted { color: var(--muted); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.auth-card > .brand-mark { margin-bottom: 25px; }
.auth-card h1 { font-size: 27px; }
.auth-card > .muted { margin: 9px 0 25px; font-size: 13px; }
.auth-card form { display: grid; }
.auth-card label { margin: 14px 0 7px; font-size: 12px; font-weight: 600; }
.auth-card input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 5px; padding: 0 10px; outline: 0; color: var(--text); background: var(--bg); }
.auth-card input:focus { border-color: var(--accent); }
.auth-switch { margin: 19px 0 0 !important; font-size: 12px !important; text-align: center; }
.text-button { border: 0; padding: 0; color: var(--accent); background: transparent; font-weight: 600; }
.scanner-note { margin: 25px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.storage-card { max-width: 640px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.storage-card .storage-track { height: 10px; margin: 20px 0; }
.storage-card strong { font: 700 26px system-ui, sans-serif; }
@media (max-width: 900px) {
  .sidebar { width: 210px; padding-inline: 13px; }
  .main-panel { width: calc(100% - 210px); margin-left: 210px; }
  .topbar { padding: 0 25px; }
  .content { padding: 32px 25px 55px; }
  .profile-button > span:nth-child(2) { display: none; }
}
@media (max-width: 620px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 64px; flex-direction: row; padding: 5px 7px; border: 0; border-top: 1px solid var(--line); }
  .brand, .upload-trigger, .storage-summary, .sidebar-footer { display: none; }
  .navigation { display: flex; width: 100%; justify-content: space-around; gap: 0; }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 2px; font-size: 9px; }
  .nav-item .icon { width: 19px; height: 19px; }
  .main-panel { width: 100%; margin-left: 0; padding-bottom: 64px; }
  .topbar { height: 67px; padding: 0 15px; }
  .search-wrap { width: min(70%, 400px); }
  .topbar-actions { gap: 7px; }
  .profile-button { padding: 0; }
  .content { padding: 28px 15px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { margin-right: auto; }
  .file-table th:nth-child(3), .file-table td:nth-child(3), .file-table th:nth-child(4), .file-table td:nth-child(4) { display: none; }
  .file-table { min-width: 0; }
  .row-actions { opacity: 1; }
  .auth-card { padding: 28px 23px; }
}
