:root {
    --navy-950: #071a2c;
    --navy-900: #0c243a;
    --navy-800: #133550;
    --navy-700: #1e4b68;
    --ink: #152b3c;
    --muted: #6d7f8d;
    --line: #dfe7eb;
    --line-soft: #edf2f4;
    --surface: #ffffff;
    --canvas: #f4f7f8;
    --mint: #18a581;
    --mint-dark: #108267;
    --mint-soft: #e7f7f2;
    --amber: #e6a84a;
    --danger: #c84a52;
    --danger-soft: #fff0f1;
    --shadow-sm: 0 1px 3px rgb(9 31 48 / 8%), 0 6px 18px rgb(9 31 48 / 5%);
    --shadow-lg: 0 25px 70px rgb(7 26 44 / 20%);
    --radius: 14px;
    --sidebar: 252px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); font-size: 14px; line-height: 1.5; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--mint-dark); font-size: 11px; font-weight: 800; letter-spacing: .15em; }

.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; color: #fff; border-radius: 11px; background: linear-gradient(145deg, #26bc94, #0c8b70); box-shadow: 0 8px 20px rgb(24 165 129 / 24%); }
.brand-mark svg { width: 23px; height: 23px; stroke-width: 2; }
.brand-mark.large { width: 58px; height: 58px; border-radius: 17px; }
.brand-mark.large svg { width: 33px; height: 33px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; background: none; font-weight: 700; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: #fff; background: var(--mint); box-shadow: 0 5px 14px rgb(24 165 129 / 19%); }
.button.primary:hover { background: var(--mint-dark); }
.button.subtle { border-color: var(--line); background: var(--surface); }
.button.subtle:hover { border-color: #c7d4da; background: #f9fbfb; }
.button.danger-button { color: #fff; background: var(--danger); }
.button.wide { width: 100%; min-height: 48px; }
.button.icon-only { width: 36px; padding: 0; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--ink); background: var(--line-soft); }
.link-button { padding: 4px; border: 0; color: var(--mint-dark); background: transparent; font-weight: 700; }
.locale-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.locale-control select { min-height: 34px; padding: 0 27px 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff; font-weight: 800; }
.locale-control select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgb(24 165 129 / 12%); }
.login-locale { position: absolute; top: 24px; right: 28px; }
.locale-control.compact > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.locale-control.compact select { min-height: 35px; padding-left: 8px; }
.locale-control.dark { color: #9db2bf; }
.locale-control.dark select { color: #e5eef3; border-color: rgb(255 255 255 / 18%); background: #102a43; }
.public-header-actions { display: flex; align-items: center; gap: 18px; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #315b75, #17374d); font-weight: 800; }
.avatar.compact { width: 35px; height: 35px; border-radius: 10px; }

/* Login */
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); background: #fff; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: clamp(56px, 9vw, 140px); overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--navy-950) 0%, #0e344e 63%, #0d4a58 100%); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgb(255 255 255 / 8%); border-radius: 50%; }
.login-brand::before { width: 540px; height: 540px; right: -270px; top: -120px; }
.login-brand::after { width: 360px; height: 360px; left: -220px; bottom: -100px; }
.login-brand .eyebrow { margin-top: 38px; color: #71dbbd; }
.login-brand h1 { position: relative; z-index: 1; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 5.6vw, 78px); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.login-brand h1 span { color: #5bd3b2; }
.login-lead { max-width: 520px; margin: 25px 0 0; color: #c5d3dd; font-size: 17px; }
.login-art { position: absolute; right: 8%; bottom: 9%; width: 210px; height: 150px; opacity: .18; }
.login-art span { position: absolute; display: block; border: 1px solid #8ce3ca; border-radius: 18px; transform: rotate(-8deg); }
.login-art span:nth-child(1) { inset: 0 32px 28px 0; }
.login-art span:nth-child(2) { inset: 24px 10px 10px 25px; }
.login-art span:nth-child(3) { inset: 50px 0 0 55px; }
.login-panel { position: relative; display: grid; place-items: center; padding: 50px; background: radial-gradient(circle at 70% 15%, #effaf7, transparent 34%), #fff; }
.login-card { width: min(390px, 100%); }
.login-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 39px; font-weight: 500; letter-spacing: -.025em; }
.login-card > .muted { margin: 8px 0 30px; }
.login-card label { display: grid; gap: 7px; margin: 18px 0; color: #405666; font-weight: 700; }
.login-card input, .modal input, .modal select, .modal textarea { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #ccd8dd; border-radius: 10px; outline: 0; background: #fff; transition: border .15s, box-shadow .15s; }
.login-card input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgb(24 165 129 / 12%); }
.login-card .button { margin-top: 11px; }
.login-card .link-button { display: block; margin: 18px auto 0; }
.login-note { margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; text-align: center; }
.form-error { margin: 13px 0; padding: 10px 12px; border: 1px solid #f1c7ca; border-radius: 9px; color: #9c3037; background: var(--danger-soft); }
.mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 48px; font-size: 17px; }

/* App frame */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar); padding: 22px 15px 17px; color: #c9d7df; background: var(--navy-950); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 8px; color: #fff; font-size: 18px; letter-spacing: .015em; }
.sidebar-brand b { color: #62d0b0; }
.close-sidebar { display: none; margin-left: auto; color: #b8cad5; }
.main-nav { display: grid; gap: 5px; margin-top: 35px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 45px; padding: 0 13px; border: 0; border-radius: 10px; color: #adc0cc; background: transparent; text-align: left; transition: color .15s, background .15s; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: #fff; background: rgb(255 255 255 / 6%); }
.nav-item.active { color: #fff; background: rgb(40 188 148 / 15%); }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 2px; background: #42c9a3; }
.nav-separator { height: 1px; margin: 10px 11px; background: rgb(255 255 255 / 8%); }
.storage-card { margin: auto 6px 13px; padding: 15px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 12px; background: rgb(255 255 255 / 4%); }
.storage-heading { display: flex; justify-content: space-between; font-size: 12px; }
.storage-heading strong { color: #61d5b3; }
.storage-bar { height: 5px; margin: 10px 0 8px; overflow: hidden; border-radius: 4px; background: rgb(255 255 255 / 10%); }
.storage-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1caa85, #62d5b3); transition: width .4s; }
.storage-card p { margin: 0; color: #8fa6b5; font-size: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border: 0; border-radius: 10px; color: #fff; background: transparent; text-align: left; }
.user-card:hover { background: rgb(255 255 255 / 5%); }
.user-copy { display: grid; min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #8fa6b5; font-size: 10px; }
.user-card > svg { width: 17px; color: #8299a9; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 25; top: 0; display: flex; align-items: center; gap: 20px; min-height: 70px; padding: 0 clamp(20px, 3vw, 44px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 93%); backdrop-filter: blur(12px); }
.search-box { display: flex; align-items: center; gap: 9px; width: min(580px, 65vw); min-height: 42px; padding: 0 12px; border: 1px solid #d8e1e5; border-radius: 11px; background: #f8fafb; }
.search-box svg { width: 18px; color: #7b8e9b; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.search-box kbd { padding: 2px 6px; border: 1px solid #d8e1e5; border-radius: 5px; color: #7d8e98; background: #fff; font: 10px inherit; }
.top-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.mobile-menu { display: none; }
.content { padding: 30px clamp(20px, 3vw, 45px) 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; letter-spacing: -.025em; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.upload-menu-button { margin-left: -14px; border-left: 1px solid rgb(255 255 255 / 24%) !important; border-radius: 0 10px 10px 0; box-shadow: none !important; }
.upload-menu-button svg { width: 16px; transform: rotate(90deg); }
.breadcrumbs { display: flex; align-items: center; gap: 2px; min-height: 32px; margin: 18px 0 9px; overflow: auto; scrollbar-width: none; }
.breadcrumbs button { display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 4px 6px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; }
.breadcrumbs button:hover { color: var(--mint-dark); background: var(--mint-soft); }
.breadcrumbs svg { width: 13px; }
.file-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 54px; border-bottom: 1px solid var(--line); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.compact-select { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.compact-select select { padding: 5px 23px 5px 7px; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.view-switch button { display: grid; place-items: center; width: 31px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: #8a9aa5; background: transparent; }
.view-switch button.active { color: var(--navy-800); background: #eaf0f3; }
.view-switch svg { width: 16px; }
.file-surface { position: relative; min-height: 360px; }
.file-list { padding: 8px 0; }
.file-row { display: grid; grid-template-columns: 40px minmax(220px, 1.8fr) minmax(110px, .7fr) minmax(145px, .75fr) 90px 48px; align-items: center; min-height: 59px; padding: 0 7px; border-bottom: 1px solid var(--line-soft); border-radius: 8px; transition: background .12s; }
.file-row:hover, .file-row.selected { background: #f0f7f5; }
.file-row.header-row { min-height: 40px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.file-row.header-row:hover { background: transparent; }
.file-check { display: grid; place-items: center; }
.file-check input { width: 15px; height: 15px; accent-color: var(--mint); }
.file-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-name button { min-width: 0; padding: 5px 0; overflow: hidden; border: 0; background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-name button:hover { color: var(--mint-dark); }
.file-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; color: #2b6f91; background: #e7f2f8; }
.file-icon.folder { color: #bd8126; background: #fff3d9; }
.file-icon.image { color: #5b699f; background: #eceeff; }
.file-icon svg { width: 19px; }
.file-meta { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.favorite-mark { color: var(--amber); }
.favorite-mark svg { width: 15px; fill: currentColor; }
.row-menu { justify-self: end; }
.list-layout.grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; padding-top: 18px; }
.grid-layout .header-row { display: none; }
.grid-layout .file-row { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 165px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.grid-layout .file-row:hover, .grid-layout .file-row.selected { border-color: #b8d8cd; background: #fbfefd; transform: translateY(-1px); }
.grid-layout .file-check { position: absolute; top: 12px; right: 12px; }
.grid-layout .file-name { flex-direction: column; align-items: flex-start; width: 100%; gap: 12px; }
.grid-layout .file-icon { width: 46px; height: 46px; border-radius: 12px; }
.grid-layout .file-icon svg { width: 25px; height: 25px; }
.grid-layout .file-name button { width: 100%; }
.grid-layout .file-meta.type-meta { display: none; }
.grid-layout .file-meta.modified-meta { margin-top: auto; }
.grid-layout .file-meta.size-meta { margin-top: 3px; }
.grid-layout .favorite-mark { position: absolute; top: 72px; right: 16px; }
.grid-layout .row-menu { position: absolute; right: 7px; bottom: 7px; }
.selection-bar { display: flex; align-items: center; gap: 8px; min-height: 46px; margin: 16px 0 5px; padding: 6px 10px 6px 15px; border: 1px solid #b9dfd3; border-radius: 11px; color: #17684f; background: var(--mint-soft); }
.selection-bar strong { margin-right: auto; }
.selection-bar button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 0; border-radius: 7px; color: inherit; background: transparent; font-weight: 700; }
.selection-bar button:hover { background: rgb(24 165 129 / 10%); }
.selection-bar button.danger { color: var(--danger); }
.selection-bar svg { width: 16px; }
.empty-state, .loading-state { display: grid; place-items: center; align-content: center; min-height: 430px; padding: 40px; text-align: center; }
.empty-state h2 { margin: 17px 0 5px; font-family: Georgia, serif; font-weight: 500; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 21px; color: #bd8126; background: #fff3d9; transform: rotate(-3deg); }
.empty-icon svg { width: 36px; height: 36px; }
.loading-state { color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #dbe7e5; border-top-color: var(--mint); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: center; gap: 6px; padding: 22px; }
.pagination button { min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pagination button.active { border-color: var(--mint); color: #fff; background: var(--mint); }

/* Overlays and dialogs */
.popover { position: fixed; z-index: 90; width: 230px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); }
.popover button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.popover button:hover { background: var(--line-soft); }
.popover button > svg { color: var(--mint-dark); }
.popover button span { display: grid; }
.popover button small { color: var(--muted); }
.context-menu { position: fixed; z-index: 110; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-lg); }
.context-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.context-menu button:hover { background: var(--line-soft); }
.context-menu button.danger { color: var(--danger); }
.context-menu hr { margin: 5px; border: 0; border-top: 1px solid var(--line-soft); }
.context-menu svg { width: 17px; }
.upload-panel { position: fixed; z-index: 105; right: 22px; bottom: 22px; width: min(390px, calc(100vw - 30px)); max-height: 460px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); }
.upload-panel > header { display: flex; align-items: center; justify-content: space-between; min-height: 57px; padding: 0 13px 0 18px; color: #fff; background: var(--navy-900); }
.upload-panel > header > div { display: grid; }
.upload-panel > header span { color: #a9beca; font-size: 11px; }
.upload-panel > header .icon-button { color: #d2dfe5; }
#upload-items { max-height: 400px; overflow: auto; }
.upload-item { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.upload-item-row { display: flex; align-items: center; gap: 10px; }
.upload-item-row .file-icon { width: 29px; height: 29px; }
.upload-item-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.upload-status { color: var(--muted); font-size: 11px; }
.progress { height: 4px; margin-top: 9px; overflow: hidden; border-radius: 3px; background: #e7edef; }
.progress span { display: block; width: 0; height: 100%; background: var(--mint); transition: width .2s; }
.drop-zone { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; background: rgb(7 26 44 / 78%); backdrop-filter: blur(4px); }
.drop-zone > div { width: min(460px, calc(100vw - 40px)); padding: 60px 30px; border: 2px dashed #66d4b6; border-radius: 22px; color: #fff; text-align: center; }
.drop-zone svg { width: 50px; height: 50px; color: #66d4b6; }
.drop-zone h2 { margin: 15px 0 5px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.drop-zone p { margin: 0; color: #c3d2da; }
.toast-stack { position: fixed; z-index: 200; top: 20px; right: 20px; display: grid; gap: 9px; width: min(360px, calc(100vw - 30px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; }
.toast::before { content: ""; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--mint); }
.toast.error::before { background: var(--danger); }
.toast strong { display: block; }
.toast p { margin: 1px 0 0; color: var(--muted); font-size: 12px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.modal { width: min(520px, calc(100vw - 30px)); max-height: min(760px, calc(100vh - 40px)); padding: 0; overflow: auto; border: 0; border-radius: 17px; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgb(7 26 44 / 62%); backdrop-filter: blur(3px); }
.modal > form > header, .modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 24px 16px; border-bottom: 1px solid var(--line-soft); }
.modal header h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.modal-body { display: grid; gap: 16px; padding: 22px 24px; }
.modal-body label { display: grid; gap: 6px; font-weight: 700; }
.modal-body label small { color: var(--muted); font-weight: 400; }
.modal-body textarea { min-height: 84px; padding-top: 11px; resize: vertical; }
.modal-body .dialog-form-error { margin: 0; }
.modal footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px 22px; }
.modal .check-label { display: flex; align-items: center; gap: 9px; }
.modal .check-label input { width: 17px; min-height: auto; height: 17px; accent-color: var(--mint); }
.confirm-modal { width: min(430px, calc(100vw - 30px)); padding: 28px; text-align: center; }
.confirm-modal h2 { margin: 13px 0 5px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.confirm-modal p { margin: 0; }
.confirm-modal footer { justify-content: center; padding: 22px 0 0; }
.confirm-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; color: var(--danger); background: var(--danger-soft); }
.confirm-icon svg { width: 27px; height: 27px; }
.preview-modal { width: min(1000px, calc(100vw - 30px)); }
.preview-body { display: grid; place-items: center; min-height: 300px; max-height: calc(100vh - 130px); padding: 22px; overflow: auto; background: #edf1f3; }
.preview-body img { display: block; max-width: 100%; max-height: calc(100vh - 180px); object-fit: contain; box-shadow: var(--shadow-sm); }
.folder-picker { min-height: 230px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.folder-picker-head { display: flex; align-items: center; gap: 8px; padding: 9px; border-bottom: 1px solid var(--line); background: #f7f9fa; }
.folder-picker-list button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left; }
.folder-picker-list button:hover { background: var(--mint-soft); }
.folder-picker-list svg { color: #b67e29; }

/* Admin */
.admin-surface { padding-top: 20px; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.admin-tabs button { flex: none; padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; }
.admin-tabs button.active { color: #fff; background: var(--navy-800); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.metric-card strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.admin-card-head h2 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.data-table th { color: var(--muted); background: #f8fafb; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.status-pill { display: inline-flex; padding: 3px 8px; border-radius: 20px; color: #167055; background: var(--mint-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-pill.blocked, .status-pill.disabled, .status-pill.failed { color: #a5353c; background: var(--danger-soft); }
.status-pill.pending { color: #946619; background: #fff4df; }

/* Public */
.public-layout { min-height: 100vh; background: var(--canvas); }
.public-header { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 0 clamp(20px, 5vw, 70px); background: var(--navy-950); }
.public-header .sidebar-brand { padding: 0; }
.secure-label { color: #9db2bf; font-size: 11px; }
.public-content { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 45px 0 70px; }

.sidebar-scrim { display: none; }

@media (max-width: 1050px) {
    .file-row { grid-template-columns: 40px minmax(200px, 1.6fr) minmax(120px, .8fr) 90px 48px; }
    .file-meta.type-meta { display: none; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    :root { --sidebar: 276px; }
    .login-layout { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-panel { min-height: 100vh; padding: 35px 25px; }
    .mobile-brand { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .workspace + .drop-zone + .sidebar-scrim, .sidebar.open ~ .sidebar-scrim { display: block; }
    .sidebar-scrim { position: fixed; z-index: 35; inset: 0; background: rgb(7 26 44 / 55%); }
    .close-sidebar, .mobile-menu { display: inline-grid; }
    .workspace { margin-left: 0; }
    .topbar { min-height: 62px; padding: 0 13px; gap: 9px; }
    .search-box { flex: 1; width: auto; }
    .search-box kbd, .top-actions .icon-button { display: none; }
    .locale-control.compact select { width: 48px; padding: 0 5px; }
    .content { padding: 23px 15px 45px; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 29px; }
    .heading-actions .button.subtle { width: 39px; padding: 0; font-size: 0; }
    .heading-actions .button.primary:not(.icon-only) { padding: 0 12px; }
    .file-toolbar { align-items: flex-start; gap: 8px; padding: 8px 0; }
    .toolbar-right { gap: 4px; }
    .compact-select { font-size: 0; }
    .compact-select select { max-width: 105px; font-size: 11px; }
    .compact-select:first-child { display: none; }
    .file-row { grid-template-columns: 35px minmax(140px, 1fr) 70px 38px; min-height: 62px; padding: 0 2px; }
    .file-meta.type-meta, .file-meta.modified-meta { display: none; }
    .file-meta.size-meta { font-size: 10px; }
    .file-row.header-row { min-height: 34px; }
    .selection-bar { overflow-x: auto; }
    .selection-bar button { flex: none; font-size: 0; }
    .selection-bar button svg { width: 18px; height: 18px; }
    .upload-panel { right: 15px; bottom: 15px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .admin-card { overflow-x: auto; }
    .data-table { min-width: 680px; }
}

@media (max-width: 460px) {
    .login-locale { top: 16px; right: 16px; }
    .public-header .secure-label { display: none; }
    .heading-actions .button.primary:not(.icon-only) { width: 41px; padding: 0; font-size: 0; }
    .heading-actions .button svg { margin: 0; }
    .upload-menu-button { display: none; }
    .metric-grid { grid-template-columns: 1fr; }
    .grid-layout.list-layout { grid-template-columns: 1fr 1fr; }
    .grid-layout .file-row { min-height: 150px; padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
