@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #f1f3f6;
    --bg-strong: #e8ecf2;
    --surface: rgba(255,255,255,0.72);
    --card: #ffffff;
    --surface-soft: #f6f8fb;
    --primary: #e35a1c;
    --primary-strong: #c44812;
    --text: #161b21;
    --muted: #6a7686;
    --border: rgba(22,27,33,0.08);
    --accent: #eef1f6;
    --success: #1d9a6c;
    --warning: #d9831f;
    --shadow-card: 0 18px 45px rgba(15,23,42,0.08);
    --shadow-soft: 0 10px 25px rgba(15,23,42,0.06);
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 84px;
    --btn-radius: 12px;
    --btn-height: 44px;
    --btn-padding: 10px 16px;
    --btn-padding-compact: 8px 12px;
    --btn-font-size: 14px;
}

:root[data-theme="dark"] {
    --bg: #171c24;
    --bg-strong: #121720;
    --surface: rgba(27,33,42,0.8);
    --card: #202734;
    --surface-soft: #293243;
    --primary: #d97846;
    --primary-strong: #e99a71;
    --text: #e2eaf3;
    --muted: #9facc0;
    --border: rgba(255,255,255,0.09);
    --accent: #313d4f;
    --success: #56c39a;
    --warning: #efb868;
    --shadow-card: 0 16px 36px rgba(5,10,18,0.34);
    --shadow-soft: 0 10px 22px rgba(5,10,18,0.26);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
    background: var(--bg);
    background-attachment: fixed;
}
body {
    margin: 0;
    font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
[data-theme="dark"] body {
    background: var(--bg);
}
body.login-page {
    background: #f3f3f3;
}
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: none; }
body::before {
    display: none;
}
[data-theme="dark"] body::before {
    display: none;
}
body.login-page::before {
    display: none;
}
.page { position: relative; z-index: 1; }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
body, .card, .hero, .folder-card, .file-card, .file-row, .login-box, .login-hero, input, select, .btn, .btn.ghost, .btn.secondary {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.app-shell {
    min-height: 100vh;
    position: relative;
}
.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
}
.sidebar {
    width: var(--sidebar-width);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 16px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: var(--shadow-soft);
    z-index: 9;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.28s ease, transform 0.3s ease, box-shadow 0.28s ease;
}
.sidebar-scrim {
    display: none;
}
.mobile-menu-trigger {
    display: none;
}
.sidebar-top { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    min-width: 0;
}
.sidebar-logo img { height: 56px; width: auto; max-width: 100%; }
.sidebar-nav {
    display: grid;
    gap: 8px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    font-weight: 600;
    border: 1px solid transparent;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    min-height: 48px;
}
.sidebar-label { font-size: 14px; }
.sidebar-link:hover { background: var(--accent); text-decoration: none; }
.sidebar-action {
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    font: inherit;
}
.sidebar-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: var(--primary-strong);
    flex-shrink: 0;
}
.sidebar-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}
.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
    align-items: stretch;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.sidebar-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: var(--primary-strong);
    font-weight: 700;
    border: 2px solid rgba(227,90,28,0.6);
    overflow: hidden;
    position: relative;
}
.sidebar-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    display: block;
}
.sidebar-user-name { font-weight: 700; }
.sidebar-user-role { color: var(--muted); font-size: 12px; }

.sidebar-title,
.sidebar-label,
.sidebar-user-name,
.sidebar-user-role {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--accent);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
    color: var(--primary-strong);
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding: 18px 10px;
}
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-user-name,
body.sidebar-collapsed .sidebar-user-role {
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-6px);
}
body.sidebar-collapsed .sidebar-link { justify-content: flex-start; padding-left: 12px; padding-right: 12px; }
body.sidebar-collapsed .sidebar-link .sidebar-icon { margin: 0; }
body.sidebar-collapsed .sidebar-logo img { display: none; }
body.sidebar-collapsed .sidebar-user {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding-left: 10px;
}
body.sidebar-collapsed .sidebar-avatar { width: 48px; height: 48px; margin-left: 0; }
body.sidebar-collapsed .sidebar-user > div:last-child {
    width: 0;
    overflow: hidden;
}
body.sidebar-collapsed .sidebar-toggle {
    margin-left: 10px;
}
body.sidebar-collapsed .app-content { margin-left: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .sidebar-logo { justify-content: flex-start; }
body.sidebar-collapsed .sidebar-nav { justify-items: start; }
body.sidebar-collapsed .sidebar-link { padding: 10px; }
body.sidebar-collapsed .sidebar-logout { justify-content: center; }
.page { padding: 28px; max-width: 1240px; margin: 0 auto; flex: 1; width: 100%; }
.page.login-page { padding: 0; max-width: none; margin: 0; }
.hero {
    background: linear-gradient(140deg, rgba(227,90,28,0.12), rgba(79,116,159,0.06));
    border: 1px solid rgba(227,90,28,0.2);
    padding: 20px 22px;
    border-radius: 18px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.hero, .card, .folder-card, .file-card, .file-row, .login-hero, .login-box { box-shadow: var(--shadow-card); }
.hero[data-theme="dark"], [data-theme="dark"] .hero {
    background: linear-gradient(140deg, rgba(222,109,53,0.12), rgba(79,116,159,0.08));
    border-color: rgba(222,109,53,0.2);
}
.breadcrumbs { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.search-panel {
    display: grid;
    gap: 4px;
    min-width: 200px;
}
.search-panel--hero {
    width: 100%;
}
.search-field {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
}
.search-field--full {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}
.search-icon {
    font-size: 14px;
    color: var(--muted);
}
.search-icon--svg {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
}
.search-icon--svg svg {
    width: 18px;
    height: 18px;
    display: block;
}
.search-field input {
    padding: 6px 6px;
    border-radius: 999px;
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
}
.search-field--full input { font-size: 14px; }
.search-field input:focus { box-shadow: none; }
.search-clear {
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 999px;
}
.search-clear:hover { background: var(--accent); color: var(--text); }
.pill {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    min-width: 130px;
}
.pill strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}
.card-compact { padding: 14px 16px; }
.create-card {
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.create-card .card-head {
    align-items: flex-end;
    gap: 12px;
}
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.grid.columns-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.form-inline { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; gap: 10px; }
.form-inline label { font-size: 12px; letter-spacing: 0.2px; }
.form-inline input,
.form-inline select { padding: 10px 12px; font-size: 14px; }
.form-inline .form-actions { display: flex; justify-content: flex-end; }
.form-inline .btn { min-width: 120px; }
.create-card .form-actions { justify-content: flex-start; }
.upload-card .form-inline { grid-template-columns: 1fr 1fr auto; }
.upload-card .form-inline .upload-drop { min-height: 88px; }
.cards-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.storage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.metric-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.metric-value {
    font-size: 22px;
    font-weight: 700;
}
.metric-label { font-weight: 600; color: var(--muted); }
.metric-meta { color: var(--muted); font-size: 12px; }
.metric-path { font-size: 12px; }
.storage-limit {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    display: grid;
    gap: 8px;
}
.storage-limit-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.storage-bar {
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    overflow: hidden;
}
.storage-bar__fill {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e 0%, #3b82f6 35%, #f59e0b 70%, #ef4444 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table th { color: var(--muted); font-weight: 600; }
.table tr:hover { background: var(--accent); }

form { display: grid; gap: 10px; }
label { color: var(--muted); font-size: 14px; }
input, select {
    padding: 14px 16px;
    border: 1px solid transparent;
    background: var(--surface-soft);
    color: var(--text);
    border-radius: 12px;
    font-size: 16px;
    width: 100%;
    box-shadow: inset 0 0 0 1px var(--border);
}
.input:focus, input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(227,90,28,0.18);
    border-color: rgba(227,90,28,0.4);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--btn-height);
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    border: 1px solid transparent;
    background: linear-gradient(120deg, var(--primary), var(--primary-strong));
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--btn-font-size);
    transition: transform 0.1s ease, box-shadow 0.2s, border-color 0.2s ease;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(227,90,28,0.32); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(227,90,28,0.24);
}
.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn.secondary { background: var(--accent); color: var(--text); }
.btn.secondary:hover { box-shadow: 0 12px 26px rgba(15,23,42,0.12); }

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, rgba(32,39,52,0.96), rgba(28,35,47,0.96));
}
[data-theme="dark"] .sidebar-link:hover {
    background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .sidebar-action {
    background: rgba(255,255,255,0.02);
}
[data-theme="dark"] .search-field,
[data-theme="dark"] .pill,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .storage-limit {
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] input,
[data-theme="dark"] select {
    background: #2b3545;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] select::placeholder,
[data-theme="dark"] .search-field input::placeholder {
    color: #95a2b3;
}
[data-theme="dark"] .table tr:hover {
    background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .search-clear:hover {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .folder-card:hover,
[data-theme="dark"] .folder-card--panel:hover,
[data-theme="dark"] .file-card:hover,
[data-theme="dark"] .file-row:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.26);
    border-color: rgba(240,143,95,0.26);
}
[data-theme="dark"] .tag.gray {
    border-color: rgba(255,255,255,0.12);
    color: #b4bfce;
}
[data-theme="dark"] .tag.green {
    color: #88d7b6;
    border-color: rgba(136,215,182,0.3);
}
[data-theme="dark"] .tag.red {
    color: #f2b1b1;
    border-color: rgba(242,177,177,0.3);
}
[data-theme="dark"] .btn.secondary {
    background: #38465a;
    border-color: rgba(255,255,255,0.09);
}
[data-theme="dark"] .btn.secondary:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.22);
}
[data-theme="dark"] .btn.ghost {
    border-color: rgba(255,255,255,0.13);
    background: rgba(255,255,255,0.015);
}
[data-theme="dark"] .btn.ghost:hover {
    background: rgba(255,255,255,0.035);
}
[data-theme="dark"] .flash.success {
    background: rgba(43,169,122,0.14);
    border-color: rgba(76,193,148,0.3);
    color: #97e1c1;
}
[data-theme="dark"] .flash.error {
    background: rgba(214,69,69,0.14);
    border-color: rgba(244,114,114,0.32);
    color: #f6b3b3;
}

.flash {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
    animation: flash-in 0.22s ease;
    overflow: hidden;
}
.flash::before {
    content: '';
    width: 4px;
    align-self: stretch;
    border-radius: 999px;
    background: currentColor;
}
.flash.success { background: rgba(43,169,122,0.14); border-color: rgba(43,169,122,0.35); color: #0f7a53; }
.flash.error { background: rgba(214,69,69,0.12); border-color: rgba(214,69,69,0.35); color: #9f1e1e; }

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-panel {
    margin: 10px 0 14px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.upload-panel.compact {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
}
.upload-panel.slim { gap: 8px; }
.upload-panel--inline {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
}
.upload-panel__copy { display: flex; flex-direction: column; gap: 10px; }
.upload-panel__title { margin: 0; font-weight: 700; font-size: 18px; }
.upload-steps {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}
.upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.2px;
}
.upload-hints { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-form { display: grid; gap: 10px; align-items: start; }
.upload-drop {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    min-height: 130px;
    overflow: hidden;
}
.upload-drop.modern {
    border-style: dashed;
    background: linear-gradient(145deg, rgba(227,90,28,0.08), var(--surface-soft));
}
.upload-drop.compact { min-height: 110px; }
.upload-drop.slim { min-height: 88px; }
.upload-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.upload-drop__body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 16px;
    justify-content: flex-start;
    text-align: left;
}
.upload-drop__title { font-weight: 700; margin-bottom: 4px; }
.upload-file-name { font-size: 13px; }
.upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
}
.upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.upload-actions.modern { justify-content: space-between; }
.upload-actions.compact { margin-top: 2px; }
.upload-form--inline { gap: 10px; }
.upload-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.upload-field { display: grid; gap: 8px; }
.upload-card--panel {
    border-radius: 22px;
    box-shadow: var(--shadow-card);
}
.upload-card--panel .card-head { align-items: flex-start; }
.upload-card--panel .upload-form { display: grid; gap: 12px; }
.upload-hint { font-size: 12px; }

.folder-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 36px;
    align-items: start;
    margin-top: 26px;
}
.folder-files { display: grid; gap: 30px; min-width: 0; }
.folder-upload { min-width: 0; }
.folder-upload .upload-card { position: sticky; top: 16px; }
.folder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}
.folder-title { margin: 0; font-size: 22px; }
.folder-header-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.path-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
}
.path-crumb {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}
.path-crumb.current {
    background: var(--accent);
    color: var(--text);
}

.empty-state {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    background: var(--surface-soft);
}
.empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--primary-strong);
    font-size: 20px;
}
.empty-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.empty-title { font-weight: 700; }
.empty-text { color: var(--muted); font-size: 13px; }
.search-empty {
    display: none;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    padding: 8px 10px;
    border-radius: 8px;
    margin: 4px 4px 0 0;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}
.filter-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-toggle {
    display: inline-flex;
    padding: 4px;
    gap: 6px;
    border-radius: 12px;
    background: var(--accent);
    border: 1px solid var(--border);
}
.view-toggle.modern { background: var(--surface-soft); }
.btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(var(--btn-height) - 6px);
    padding: var(--btn-padding-compact);
    border-radius: var(--btn-radius);
    color: var(--muted);
    font-weight: 600;
    font-size: var(--btn-font-size);
}
.btn-toggle.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.btn-toggle:hover { text-decoration: none; }
.btn-compact {
    padding: var(--btn-padding-compact);
    border-radius: var(--btn-radius);
    min-height: calc(var(--btn-height) - 6px);
    font-size: var(--btn-font-size);
}
.sort-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort-form.modern label { font-size: 12px; color: var(--muted); }
.sort-form.modern select { padding: 8px 10px; font-size: 13px; }
.file-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.file-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.file-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: var(--card);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.file-card,
.file-row {
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.file-card:hover,
.file-row:hover {
    transform: translateY(-2px);
    border-color: rgba(227,90,28,0.35);
    box-shadow: 0 16px 36px rgba(15,23,42,0.12);
}
.file-card--compact {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}
.file-card-head { display: flex; gap: 10px; align-items: flex-start; }
.file-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--primary-strong);
}
.file-card--compact .file-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}
.file-meta strong { margin-bottom: 6px; display: block; }
.file-meta small { color: var(--muted); }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-card--compact .file-actions { justify-content: flex-end; }
.file-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.file-original { font-size: 12px; }
.file-list { display: grid; gap: 14px; }
.file-row {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--card);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}
.file-row-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--primary-strong);
    font-size: 13px;
}
.file-row-info { display: flex; flex-direction: column; gap: 6px; }
.file-actions { justify-content: flex-end; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700;
}
.badge.neutral {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text);
}
.folder-section { margin-top: 16px; }
.section-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.section-head--compact { margin: 6px 0 12px; }
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0 10px;
}
.section-note {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.folder-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.folder-grid.modern { gap: 18px; }
.entity-grid {
    display: grid;
    gap: 14px;
}
.entity-grid.compact { gap: 10px; }
.entity-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.entity-card:hover {
    border-color: rgba(227,90,28,0.24);
    box-shadow: 0 14px 30px rgba(15,23,42,0.1);
}
.entity-card.compact {
    padding: 12px;
    gap: 12px;
    border-radius: 14px;
}
.folder-admin-card .entity-grid { gap: 16px; }
.folder-entity-card {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
    align-items: stretch;
    padding: 18px;
    border-radius: 18px;
}
.folder-entity-card .entity-main {
    padding-right: 14px;
    border-right: 1px dashed var(--border);
}
.folder-entity-card .entity-actions {
    justify-items: stretch;
    align-content: start;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 10px;
}
.folder-card-expandable {
    display: block;
    padding: 0;
    overflow: hidden;
}
.folder-card-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}
.folder-card-summary::-webkit-details-marker { display: none; }
.folder-card-summary-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.folder-card-title-wrap {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.folder-card-title-wrap .entity-title,
.folder-card-title-wrap .entity-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.folder-card-title-wrap .entity-title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.folder-card-summary-meta {
    justify-content: flex-end;
}
.folder-card-expand-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.folder-card-expand-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
.folder-card-expandable[open] .folder-card-expand-icon {
    transform: rotate(180deg);
    color: var(--primary-strong);
}
.folder-card-panel {
    padding: 0 12px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}
.folder-card-expandable .entity-actions {
    width: 100%;
    padding: 10px 0 0;
    justify-items: stretch;
    border: none;
    background: transparent;
}
.folder-delete-form {
    justify-content: flex-end;
}
.user-card {
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border-color: rgba(227,90,28,0.14);
    box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}
.user-card .entity-main { gap: 4px; }
.user-card .entity-meta { gap: 2px; }
.user-card .tag { font-size: 11px; padding: 2px 6px; }
.user-card .entity-title { font-size: 14px; }
.user-card .entity-subtitle { font-size: 11px; }
.user-card .entity-avatar { width: 32px; height: 32px; border-width: 1px; }
.user-card-expandable {
    display: block;
    padding: 0;
    overflow: hidden;
}
.user-card-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
}
.user-card-summary::-webkit-details-marker { display: none; }
.user-card-summary-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.user-card-summary .entity-identity {
    min-width: 0;
    gap: 8px;
}
.user-card-summary .entity-identity > div:last-child {
    min-width: 0;
}
.user-card-summary .entity-title,
.user-card-summary .entity-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-card-summary-meta {
    justify-content: flex-end;
}
.user-card-expand-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.user-card-expand-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
.user-card-expandable[open] .user-card-expand-icon {
    transform: rotate(180deg);
    color: var(--primary-strong);
}
.user-card-panel {
    padding: 0 12px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}
.meta-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 10px;
}
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: var(--primary-strong);
    flex-shrink: 0;
}
.meta-icon svg {
    width: 10px;
    height: 10px;
    display: block;
}
.user-card .entity-actions {
    width: 100%;
    padding: 10px 0 0;
    justify-items: stretch;
}
.user-form {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    justify-items: stretch;
}
.user-form-delete {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.user-form-delete .btn { min-height: 32px; padding: 6px 10px; }
.user-form .btn { justify-self: end; min-height: 32px; padding: 6px 10px; }
.user-form .input-compact {
    padding: 8px 10px;
    font-size: 12px;
}
.user-form input[type="file"] {
    padding: 6px 8px;
    font-size: 11px;
}
.user-form select.input-compact { min-width: 120px; }
.user-form input[type="file"] { min-width: 180px; }
.user-form .btn {
    white-space: nowrap;
    width: 100%;
}
.user-create-card h2 { margin-bottom: 6px; }
.user-create-form { gap: 10px; }
.user-create-form input,
.user-create-form select {
    padding: 10px 12px;
    font-size: 14px;
}
.user-create-form input[type="file"] {
    padding: 8px 10px;
    font-size: 12px;
}
.user-create-actions .btn { min-height: 40px; }
.entity-main { display: flex; flex-direction: column; gap: 6px; }
.entity-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}
.entity-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: var(--primary-strong);
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid rgba(227,90,28,0.45);
    overflow: hidden;
    position: relative;
}
.entity-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    display: block;
}
.entity-title { font-weight: 700; font-size: 16px; }
.entity-hint { margin-top: 6px; color: var(--muted); font-size: 12px; }
.entity-subtitle { color: var(--muted); font-size: 13px; }
.entity-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.entity-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}
.entity-actions.compact { gap: 6px; }
.entity-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.entity-form.compact { gap: 6px; }
.folder-edit-form { align-items: stretch; }
.folder-edit-form .input-compact[name="name"] { font-weight: 600; }
.folder-icon-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.folder-icon-preview {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.folder-icon-preview img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}
.folder-remove-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}
.folder-remove-icon input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
.folder-edit-form .btn { width: 100%; justify-content: center; }
.users-create-card,
.users-list-card { border-radius: 18px; }
.users-list-card .entity-grid.compact { gap: 12px; }
.input-compact {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
}
.entity-card.compact .input-compact {
    padding: 8px 10px;
    font-size: 13px;
}
.folder-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.folder-tree.is-root { margin-top: 12px; }
.folder-tree li {
    margin: 0;
    padding: 0;
}
.folder-tree ul {
    list-style: none;
    margin: 10px 0 0 28px;
    padding: 0 0 0 16px;
    border-left: 1px dashed var(--border);
    display: grid;
    gap: 10px;
}
.folder-tree-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.folder-tree-item.is-current {
    border-color: rgba(227,90,28,0.4);
    box-shadow: 0 14px 28px rgba(227,90,28,0.2);
}
.folder-tree-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent);
    display: grid;
    place-items: center;
    font-size: 20px;
    color: var(--primary-strong);
}
.folder-tree-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.folder-tree-icon--custom {
    padding: 6px;
}
.folder-tree-icon-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.folder-tree-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.folder-tree-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}
.folder-tree-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.folder-tree-actions { display: flex; gap: 8px; }
.folder-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-card);
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.folder-card--large {
    padding: 22px 24px;
    gap: 20px;
    border-radius: 24px;
    border-color: rgba(227,90,28,0.18);
}
.folder-card--panel {
    grid-template-columns: 84px 1fr;
    grid-template-rows: auto auto;
    padding: 22px;
    border-radius: 22px;
    border-color: var(--border);
    background: var(--card);
    box-shadow: var(--shadow-soft);
    align-items: flex-start;
    min-height: 210px;
}
.folder-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.folder-cta {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    grid-column: 1 / -1;
}
.folder-icon {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: var(--accent);
    display: grid;
    place-items: center;
    font-size: 34px;
    color: var(--primary-strong);
}
.folder-icon-text {
    font-size: 38px;
    line-height: 1;
}
.folder-icon-image {
    width: 62px;
    height: 62px;
    display: block;
    object-fit: contain;
}
.folder-icon svg {
    width: 34px;
    height: 34px;
    display: block;
}
.folder-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.folder-top {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    min-width: 0;
}
.folder-top h4,
.folder-title-row h4 {
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: 18px;
}
.folder-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.folder-title-actions .tag {
    display: inline-flex;
    align-items: center;
    height: 32px;
}
.favorite-form { margin: 0; }
.favorite-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.favorite-toggle svg { width: 18px; height: 18px; display: block; }
.favorite-toggle:hover {
    transform: translateY(-1px);
    color: var(--primary-strong);
    border-color: rgba(227,90,28,0.4);
    box-shadow: 0 8px 18px rgba(227,90,28,0.2);
}
.favorite-toggle.is-active {
    background: rgba(227,90,28,0.12);
    color: var(--primary-strong);
    border-color: rgba(227,90,28,0.4);
}
.folder-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.folder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15,23,42,0.12);
    border-color: rgba(227,90,28,0.45);
}
.folder-card--panel:hover {
    box-shadow: 0 16px 36px rgba(15,23,42,0.12);
    border-color: rgba(227,90,28,0.35);
}
.tag { padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--muted); }
.tag.red { border-color: rgba(244,87,87,0.35); color: #d64545; }
.tag.green { border-color: rgba(43,169,122,0.5); color: var(--success); }
.tag.gray { border-color: var(--border); }

.empty { color: var(--muted); font-style: italic; }

.login-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 38px 28px 24px;
    background: #f3f3f3;
}
[data-theme="dark"] .login-viewport {
    background: var(--bg);
}

[data-theme="dark"] html {
    background: var(--bg);
    background-attachment: fixed;
}
.login-grid {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 26px;
    align-items: stretch;
}
.login-grid.single {
    max-width: 520px;
    justify-content: center;
}
.login-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-strong);
    font-weight: 700;
    letter-spacing: 0.2px;
}
.login-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.highlight-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 10px 26px rgba(0,0,0,0.08);
}
.highlight-chip .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,122,26,0.16);
}
.login-box {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    padding: 32px;
    border-radius: 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.login-box h1, .login-box h2 { margin-top: 0; margin-bottom: 8px; }
.login-logo {
    display: grid;
    justify-items: start;
    gap: 6px;
    margin-bottom: 14px;
}
.login-logo img {
    max-width: 180px;
    width: 100%;
    height: auto;
}
.login-form,
.login-form input,
.login-form select,
.login-form .btn {
    border-radius: 0;
}
.login-form .btn { width: 100%; margin-top: 8px; }

@media (max-width: 720px) {
    .page { padding: 14px; }
    .page.login-page { padding: 10px; }
    .login-viewport { padding: 16px 12px 14px; min-height: 100vh; }
    .login-grid { grid-template-columns: 1fr; }
    .login-box { padding: 22px 18px; }
    .hero { padding: 16px; }
    .search-field--full { padding: 8px 10px; }
    .search-field input { min-width: 0; }
    .card { padding: 14px; }
    .folder-card--panel,
    .upload-card--panel { padding: 16px; }
    .storage-limit-head,
    .card-head,
    .folder-title-row,
    .filter-bar,
    .filter-left,
    .sort-form,
    .upload-actions,
    .entity-form,
    .folder-cta,
    .folder-tree-item,
    .folder-tree-actions {
        width: 100%;
    }
    .filter-bar,
    .filter-left,
    .sort-form,
    .upload-actions,
    .entity-form,
    .folder-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-left .btn,
    .sort-form .btn,
    .sort-form select,
    .entity-form .btn,
    .entity-form .input-compact,
    .folder-cta .btn,
    .folder-cta form,
    .folder-cta form .btn,
    .file-actions .btn,
    .file-actions form,
    .file-actions form .btn {
        width: 100%;
    }
    .view-toggle {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .btn-toggle { width: 100%; }
    .sort-form label { width: 100%; }
    .file-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .folder-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .folder-title-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .folder-tree-item {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
    .folder-tree ul {
        margin-left: 14px;
        padding-left: 10px;
    }
    .folder-tree-actions .btn { width: 100%; }
    .empty-state {
        grid-template-columns: 1fr;
        justify-items: start;
    }
    .user-form input[type="file"] { min-width: 0; }
}

@media (max-width: 1100px) {
    .folder-workspace { grid-template-columns: 1fr; }
    .folder-upload .upload-card { position: static; }
}

@media (max-width: 880px) {
    .upload-panel { grid-template-columns: 1fr; }
    .upload-actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
    .mobile-menu-trigger {
        position: fixed;
        top: 14px;
        left: 14px;
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border: 1px solid var(--border);
        background: var(--card);
        color: var(--primary-strong);
        box-shadow: 0 16px 32px rgba(15,23,42,0.18);
        z-index: 7;
        cursor: pointer;
    }
    .mobile-menu-trigger svg {
        width: 22px;
        height: 22px;
        display: block;
    }
    body.sidebar-open .mobile-menu-trigger {
        opacity: 0;
        pointer-events: none;
    }
    .sidebar-scrim {
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(9, 14, 21, 0.42);
        backdrop-filter: blur(2px);
        z-index: 8;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    body.sidebar-open .sidebar-scrim {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar {
        width: min(86vw, 320px);
        max-width: 320px;
        transform: translateX(-105%);
        box-shadow: 0 24px 44px rgba(0,0,0,0.22);
        z-index: 9;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .app-content {
        margin-left: 0;
        width: 100%;
        padding-top: 66px;
    }
    body.sidebar-collapsed .app-content,
    body:not(.sidebar-collapsed) .app-content {
        margin-left: 0;
    }
    body.sidebar-open {
        overflow: hidden;
    }
    .sidebar-top {
        justify-content: space-between;
    }
    .sidebar-logo img {
        display: block;
        height: 48px;
    }
    .sidebar-label,
    .sidebar-user-name,
    .sidebar-user-role {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
    .sidebar-user {
        gap: 10px;
        padding-left: 0;
    }
    .sidebar-user > div:last-child {
        width: auto;
        overflow: visible;
    }
    .file-grid,
    .folder-grid,
    .cards-grid,
    .storage-summary {
        grid-template-columns: 1fr;
    }
    .file-row { grid-template-columns: 1fr; align-items: flex-start; }
    .file-row-icon { width: 44px; height: 44px; }
    .file-actions { justify-content: flex-start; }
    .entity-card { grid-template-columns: 1fr; align-items: flex-start; }
    .folder-entity-card { grid-template-columns: 1fr; }
    .folder-entity-card .entity-main {
        padding-right: 0;
        border-right: none;
    }
    .entity-actions { justify-items: start; }
    .user-form { grid-template-columns: 1fr; justify-items: stretch; }
    .user-form .btn { justify-self: stretch; }
    .user-card-summary,
    .user-card-summary-main {
        align-items: flex-start;
    }
    .user-card-summary-main {
        flex-direction: column;
    }
    .user-card-summary-meta {
        justify-content: flex-start;
    }
    .folder-card-summary,
    .folder-card-summary-main {
        align-items: flex-start;
    }
    .folder-card-summary-main {
        flex-direction: column;
    }
    .folder-card-summary-meta {
        justify-content: flex-start;
    }
    .upload-panel--inline { grid-template-columns: 1fr; }
    .upload-fields { grid-template-columns: 1fr; }
    .folder-card--panel { grid-template-columns: 1fr; min-height: 0; }
    .folder-cta { align-items: flex-start; justify-content: flex-start; }
    .empty-state { grid-template-columns: 1fr; }
    .file-card--compact { grid-template-columns: 1fr; }
    .file-card--compact .file-actions { justify-content: flex-start; }
    .file-card--compact .file-icon,
    .file-row-icon,
    .folder-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .folder-icon-image {
        width: 30px;
        height: 30px;
    }
    .folder-icon svg {
        width: 22px;
        height: 22px;
    }
    .path-bar {
        padding: 8px;
        gap: 6px;
    }
    .path-crumb {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero, .card, .file-card, .file-row, .folder-card, .login-hero, .login-box {
    animation: fadeUp 0.5s ease both;
}
.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Remove rounded corners across the authenticated app shell only. */
.app-shell,
.app-shell *,
.app-shell *::before,
.app-shell *::after {
    border-radius: 0 !important;
}
