/* IT Lobby Treasury - application styles */
:root {
  --brand: #0b5ed7;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --border: #e3e7ef;
  --text-muted: #6b7385;
  --radius: .6rem;
}

html, body { height: 100%; }
body { font-size: .9rem; color: #1d2433; background: var(--surface-2); }
a { color: var(--brand); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 85%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--brand) 75%, #000); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.nav-pills .nav-link.active { background: var(--brand); }

/* ---------- Guest pages ---------- */
.guest-body { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, #fff) 0%, #f5f7fb 60%); min-height: 100vh; }
.guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card { width: 100%; max-width: 430px; border-radius: 1rem; }
.setup-card { width: 100%; max-width: 860px; border-radius: 1rem; }
.login-logo { max-height: 64px; max-width: 220px; }
.brand-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.brand-mark.sm { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; }
.setup-steps .nav-link { font-size: .82rem; padding: .35rem .7rem; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--sidebar-w); background: #0f172a; color: #cbd5e1; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1030; transition: transform .2s; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo { max-height: 34px; max-width: 120px; background: #fff; border-radius: 6px; padding: 2px; }
.brand-text { font-weight: 600; line-height: 1.1; }
.brand-text small { display: block; font-weight: 400; color: #94a3b8; font-size: .72rem; }
.sidebar-nav { padding: .5rem 0 2rem; }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: #64748b; padding: 1rem 1.2rem .35rem; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .7rem; color: #cbd5e1; padding: .48rem 1.2rem; font-size: .86rem; border-left: 3px solid transparent; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--brand); }
.sidebar-nav .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }
.app-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.app-topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; position: sticky; top: 0; z-index: 1020; }
.topbar-title { font-weight: 600; font-size: 1rem; }
.app-content { padding: 1.25rem; flex: 1; min-width: 0; }
body.sheet-page .app-content { padding: 0; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); overflow: hidden; }

/* Compact sidebar on spreadsheet pages (expands on hover) */
@media (min-width: 992px) {
  body.sheet-page { --sidebar-w: 60px; }
  body.sheet-page .app-sidebar { width: 60px; overflow-x: hidden; transition: width .15s; }
  body.sheet-page .app-sidebar:hover { width: 248px; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  body.sheet-page .app-sidebar:not(:hover) .brand-text, body.sheet-page .app-sidebar:not(:hover) .nav-section,
  body.sheet-page .app-sidebar:not(:hover) .nav-link span { display: none; }
  body.sheet-page .app-sidebar:not(:hover) .nav-link { padding-left: 1.2rem; }
  body.sheet-page .app-topbar .topbar-title { visibility: hidden; }
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .app-main { margin-left: 0; }
}

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 600; font-size: .78rem; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .6rem; }

/* ---------- Components ---------- */
.card { border-color: var(--border); border-radius: var(--radius); }
.card-header { background: var(--surface); border-bottom-color: var(--border); font-weight: 600; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-header h1 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.page-header .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; height: 100%; }
.kpi .label { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.45rem; font-weight: 700; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--text-muted); }
.kpi .icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.table { --bs-table-bg: transparent; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-card .table { margin: 0; }
.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .6; }
.notif-menu { width: 360px; max-width: 92vw; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: block; padding: .6rem .9rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; font-size: .82rem; }
.notif-item.unread { background: color-mix(in srgb, var(--brand) 6%, #fff); }
.notif-item:hover { background: #f1f5f9; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { border-left-color: transparent; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small-muted { font-size: .78rem; color: var(--text-muted); }
.perm-grid .form-check { min-width: 210px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { min-height: 31px; }
@media print {
  .app-sidebar, .app-topbar, .no-print, .filter-bar, .page-header .actions { display: none !important; }
  .app-main { margin: 0; }
  body { background: #fff; }
}

/* ============================================== shared small controls (wbx-) */
.wbx-seg { display: inline-flex; background: #eef1f6; border-radius: .55rem; padding: 3px; gap: 2px; }
.wbx-seg a, .wbx-seg button { border: 0; background: transparent; color: #475569; padding: .25rem .6rem; border-radius: .4rem; font-size: .82rem; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; line-height: 1.5; }
.wbx-seg a:hover, .wbx-seg button:hover { color: #0f172a; }
.wbx-seg .active { background: var(--surface); color: #0f172a; box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.wbx-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; max-height: 260px; overflow: auto; padding: 2px; }
.wbx-tpl { margin: 0; cursor: pointer; position: relative; }
.wbx-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.wbx-tpl span { display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--border); border-radius: .65rem; padding: .7rem .8rem; height: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s, background .15s; }
.wbx-tpl span i { font-size: 1.2rem; color: var(--brand); margin-bottom: .2rem; }
.wbx-tpl span b { font-size: .86rem; font-weight: 600; }
.wbx-tpl span small { color: var(--text-muted); font-size: .74rem; }
.wbx-tpl:hover span { border-color: #c5cfdd; }
.wbx-tpl input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: color-mix(in srgb, var(--brand) 5%, #fff); }
.wbx-tpl input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.wbx-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.wbx-swatches label { cursor: pointer; margin: 0; position: relative; }
.wbx-swatches input { position: absolute; opacity: 0; }
.wbx-swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; transition: box-shadow .15s; }
.wbx-swatches input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a; }
.wbx-swatches input:focus-visible + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }

/* ============================================================ file icons */
.fx-folder { display: inline-flex; align-items: center; justify-content: center; color: var(--ws, #e8a33d); line-height: 1; flex-shrink: 0; }
.fx-folder i { filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--ws, #e8a33d) 30%, transparent)); }
.fx-folder.xs { font-size: 1.05rem; } .fx-folder.sm { font-size: 1.6rem; width: 36px; } .fx-folder.lg { font-size: 3.6rem; height: 64px; } .fx-folder.xl { font-size: 4.6rem; }
.fx-file { --fc: #15803d; position: relative; display: inline-flex; align-items: flex-end; justify-content: center; flex-shrink: 0; background: #fff; border: 1px solid #d3d9e3; border-radius: 3px 10px 3px 3px; color: #fff; }
.fx-file::before { content: ''; position: absolute; top: -1px; right: -1px; width: 32%; aspect-ratio: 1; background: linear-gradient(225deg, var(--surface-2) 50%, #e3e8ef 50%); border-bottom-left-radius: 3px; }
.fx-file i { background: var(--fc); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.fx-file.tpl { --fc: #6d28d9; } .fx-file.arc { --fc: #94a3b8; }
.fx-file.lg { width: 48px; height: 60px; padding-bottom: 8px; box-shadow: 0 2px 4px rgba(15,23,42,.06); } .fx-file.lg i { width: 28px; height: 24px; font-size: .9rem; }
.fx-file.xl { width: 64px; height: 80px; padding-bottom: 10px; box-shadow: 0 3px 8px rgba(15,23,42,.08); } .fx-file.xl i { width: 38px; height: 32px; font-size: 1.15rem; }
.fx-file.sm { width: 28px; height: 34px; padding-bottom: 5px; } .fx-file.sm i { width: 17px; height: 14px; font-size: .55rem; border-radius: 3px; }
.fx-file.xs { width: 15px; height: 18px; padding-bottom: 3px; border-radius: 2px 5px 2px 2px; } .fx-file.xs::before { display: none; } .fx-file.xs i { width: 9px; height: 7px; font-size: 0; border-radius: 1px; }
.fx-place { width: 64px; height: 64px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); }

/* ============================================================ explorer */
.app-content:has(> .fx-app) { padding-bottom: 1rem; }
.fx-app { display: grid; grid-template-columns: 236px 1fr; height: calc(100vh - var(--topbar-h) - 3rem); min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.05); position: relative; }
.fx-side { background: #f7f8fb; border-right: 1px solid var(--border); padding: .75rem .5rem; overflow: auto; }
.fx-side-sect { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #8a93a4; font-weight: 600; padding: .9rem .6rem .35rem; }
.fx-side-sect:first-child { padding-top: .25rem; }
.fx-side-add { border: 0; background: transparent; color: #64748b; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fx-side-add:hover { background: #e8ebf1; color: #0f172a; }
.fx-nav { width: 100%; display: flex; align-items: center; gap: .55rem; border: 0; background: transparent; color: #334155; padding: .38rem .6rem; border-radius: 7px; font-size: .86rem; text-align: left; min-width: 0; }
.fx-nav i { font-size: 1rem; color: #64748b; flex-shrink: 0; }
.fx-nav small { margin-left: auto; color: #94a3b8; font-size: .72rem; font-variant-numeric: tabular-nums; }
.fx-nav:hover { background: #eceff4; }
.fx-nav.active { background: color-mix(in srgb, var(--brand) 12%, #fff); color: #0f172a; font-weight: 600; }
.fx-nav.active > i.bi-hdd-stack, .fx-nav.active > i.bi-clock-history, .fx-nav.active > i.bi-stars, .fx-nav.active > i.bi-archive { color: var(--brand); }
.fx-side-empty { padding: .3rem .6rem; color: #94a3b8; font-size: .8rem; }
.fx-nav.drop-over { background: color-mix(in srgb, var(--brand) 18%, #fff); box-shadow: 0 0 0 2px var(--brand) inset; }

.fx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.fx-bar { display: flex; align-items: center; gap: .35rem; padding: .55rem .75rem; border-bottom: 1px solid #eef1f5; min-width: 0; }
.fx-bar2 { padding: .4rem .75rem; background: #fcfcfd; flex-wrap: wrap; }
.fx-icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; color: #475569; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-icon-btn:hover:not(:disabled) { background: #eef1f5; color: #0f172a; }
.fx-icon-btn:disabled { opacity: .35; }
.fx-icon-btn.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); }
.fx-crumbs { display: flex; align-items: center; gap: .15rem; flex: 1; min-width: 0; border: 1px solid #e5e9f0; border-radius: 8px; padding: 0 .3rem; height: 34px; background: #fff; overflow: hidden; }
.fx-crumb { border: 0; background: transparent; display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .45rem; border-radius: 6px; font-size: .86rem; color: #334155; white-space: nowrap; min-width: 0; }
.fx-crumb span { overflow: hidden; text-overflow: ellipsis; }
button.fx-crumb:hover { background: #eef1f5; }
.fx-crumb.current { font-weight: 600; color: #0f172a; }
.fx-crumb-sep { font-size: .7rem; color: #a0a9b8; }
.fx-search { display: flex; align-items: center; gap: .4rem; margin: 0 0 0 .25rem; height: 34px; border: 1px solid #e5e9f0; border-radius: 8px; padding: 0 .6rem; width: 240px; background: #fff; }
.fx-search:focus-within { border-color: color-mix(in srgb, var(--brand) 60%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.fx-search i { color: #94a3b8; font-size: .85rem; }
.fx-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: .86rem; background: transparent; }
.fx-new { border-radius: 8px; display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; font-weight: 500; }
.fx-sep { width: 1px; height: 22px; background: #e2e6ed; margin: 0 .35rem; }
.fx-tool { border: 0; background: transparent; display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 7px; color: #334155; font-size: .82rem; }
.fx-tool:hover:not(:disabled) { background: #eef1f5; }
.fx-tool:disabled { opacity: .38; }
.fx-sort { width: auto; height: 32px; border-radius: 8px; border-color: #e5e9f0; font-size: .82rem; }

.fx-body { flex: 1; display: flex; min-height: 0; }
.fx-content { flex: 1; overflow: auto; padding: 1rem; outline: none; min-width: 0; user-select: none; }
.fx-content:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .35rem; align-content: start; }
.fx-tile { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .75rem .4rem .6rem; border-radius: 10px; border: 1px solid transparent; cursor: default; text-align: center; min-width: 0; }
.fx-tile:hover { background: #f3f6fa; }
.fx-tile.selected { background: color-mix(in srgb, var(--brand) 10%, #fff); border-color: color-mix(in srgb, var(--brand) 35%, #fff); }
.fx-tile .fx-folder.lg, .fx-tile .fx-file.lg { margin-bottom: .15rem; }
.fx-tile .fx-file.lg { margin-top: 2px; margin-bottom: 2px; }
.fx-tile-name { font-size: .83rem; color: #0f172a; line-height: 1.3; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.fx-tile-sub { font-size: .72rem; color: #8a93a4; }
.fx-tile.dim { opacity: .65; }
.fx-item.drop-over { background: color-mix(in srgb, var(--brand) 14%, #fff) !important; border-color: var(--brand) !important; }
.fx-app.dragging .fx-item[data-kind="file"] { opacity: .8; }

.fx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.fx-table th { position: sticky; top: -1rem; background: var(--surface); z-index: 1; font-weight: 500; color: #64748b; border-bottom: 1px solid #e8ecf2; padding: 0; font-size: .78rem; white-space: nowrap; }
.fx-table th button, .fx-table th:not(:has(button)) { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: .45rem .6rem; color: inherit; font-weight: 500; }
.fx-table th:not(:has(button)) { padding: .45rem .6rem; }
.fx-table th button:hover { color: #0f172a; background: #f6f8fb; }
.fx-table th.num button, .fx-table td.num { text-align: right; }
.fx-table td { padding: .42rem .6rem; border-bottom: 1px solid #f1f3f7; color: #475569; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.fx-table td:first-child { color: #0f172a; max-width: 420px; }
.fx-table tr.fx-item:hover td { background: #f6f8fb; }
.fx-table tr.fx-item.selected td { background: color-mix(in srgb, var(--brand) 10%, #fff); }
.fx-name { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.fx-tag { font-size: .66rem; font-weight: 600; padding: .05rem .35rem; border-radius: 4px; flex-shrink: 0; }
.fx-tag.tpl { background: #f2efff; color: #5b47c9; } .fx-tag.arc { background: #fff4e5; color: #9a5b00; }
.fx-empty { height: 100%; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #8a93a4; text-align: center; }
.fx-empty > i { font-size: 2.6rem; opacity: .45; }
.fx-empty p { margin: 0 0 .5rem; max-width: 340px; font-size: .9rem; }

.fx-info { width: 272px; flex-shrink: 0; border-left: 1px solid #eef1f5; padding: 1.25rem 1rem; overflow: auto; background: #fcfcfd; }
.fx-info-hero { text-align: center; padding-bottom: 1rem; margin-bottom: .75rem; border-bottom: 1px solid #eef1f5; }
.fx-info-hero h3 { font-size: 1rem; font-weight: 600; margin: .75rem 0 .15rem; word-break: break-word; color: #0f172a; }
.fx-info-hero p { font-size: .8rem; color: #8a93a4; margin: 0; }
.fx-info-row { display: flex; justify-content: space-between; gap: .75rem; font-size: .8rem; padding: .3rem 0; }
.fx-info-row span { color: #8a93a4; flex-shrink: 0; }
.fx-info-row b { font-weight: 500; color: #334155; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.fx-info-desc { font-size: .8rem; color: #475569; margin: .75rem 0 0; padding-top: .75rem; border-top: 1px solid #eef1f5; white-space: pre-line; }
.fx-info-hint { font-size: .8rem; color: #94a3b8; text-align: center; margin-top: 1rem; }
.fx-info-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.fx-info-actions .btn { flex: 1; border-radius: 8px; }
.fx-status { display: flex; align-items: center; gap: 1rem; padding: .35rem .9rem; border-top: 1px solid #eef1f5; font-size: .74rem; color: #8a93a4; background: #fcfcfd; min-height: 30px; white-space: nowrap; overflow: hidden; }
.fx-status-sel { color: #475569; overflow: hidden; text-overflow: ellipsis; }
.fx-menu { position: fixed; z-index: 1080; min-width: 200px; padding: .3rem; border-radius: 10px; border-color: #e3e7ee; box-shadow: 0 12px 32px -8px rgba(15,23,42,.25); }
.fx-menu .dropdown-item { display: flex; align-items: center; gap: .55rem; border-radius: 6px; font-size: .84rem; padding: .38rem .6rem; }
.fx-menu .dropdown-item kbd { margin-left: auto; background: transparent; color: #94a3b8; font-size: .7rem; padding: 0; }
.fx-menu .dropdown-divider { margin: .25rem 0; }
@media (max-width: 1199.98px) { .fx-info { display: none; } }
@media (max-width: 991.98px) {
  .fx-app { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 2rem); }
  .fx-side { position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 24px rgba(15,23,42,.12); }
  .fx-app.side-open .fx-side { transform: none; }
  .fx-search { width: 160px; }
  .fx-tool span { display: none; }
}
@media (max-width: 575.98px) {
  .fx-bar:first-child { flex-wrap: wrap; }
  .fx-search { width: 100%; margin: .25rem 0 0; order: 5; }
  .fx-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .fx-content { padding: .6rem; }
}

/* ============================================================ dashboard */
.dbx-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin: .25rem 0 1.25rem; }
.dbx-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin: 0; color: #0f172a; }
.dbx-sub { margin: .2rem 0 0; color: var(--text-muted); font-size: .9rem; }
.dbx-actions { margin-left: auto; display: flex; gap: .5rem; }
.dbx-actions .btn { border-radius: 8px; display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.dbx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dbx-tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon label' 'icon value' 'icon note'; column-gap: .75rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.dbx-tile:hover { border-color: #cbd5e1; box-shadow: 0 6px 16px -6px rgba(15,23,42,.12); color: inherit; }
.dbx-tile-icon { grid-area: icon; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #f1f4f9; color: #475569; font-size: 1.05rem; align-self: start; }
.dbx-tile-label { grid-area: label; font-size: .76rem; color: #64748b; font-weight: 500; }
.dbx-tile-value { grid-area: value; font-size: 1.45rem; font-weight: 700; color: #0f172a; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dbx-tile-note { grid-area: note; font-size: .72rem; color: #94a3b8; }
.dbx-tile.attn { border-color: #f5c46b; background: #fffaf0; }
.dbx-tile.attn .dbx-tile-icon { background: #fdecc8; color: #9a5b00; }
.dbx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.dbx-card-head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .85rem; }
.dbx-card-head h2 { font-size: .98rem; font-weight: 600; margin: 0; color: #0f172a; }
.dbx-card-head p { font-size: .78rem; color: #8a93a4; margin: .1rem 0 0; }
.dbx-num { font-variant-numeric: tabular-nums; color: #334155; font-weight: 600; font-size: .85rem; }
.dbx-bar { display: block; height: 5px; background: #eef1f5; border-radius: 99px; margin: .3rem 0 .2rem; overflow: hidden; }
.dbx-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.dbx-people, .dbx-files, .dbx-folders, .dbx-log { list-style: none; margin: 0; padding: 0; }
.dbx-people li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid #f1f3f7; }
.dbx-people li:last-child, .dbx-files li:last-child, .dbx-folders li:last-child { border-bottom: 0; }
.dbx-people b { font-weight: 600; font-size: .86rem; }
.dbx-people small, .dbx-files small, .dbx-folders small { color: #8a93a4; font-size: .74rem; }
.dbx-files li, .dbx-folders li { border-bottom: 1px solid #f1f3f7; }
.dbx-files a, .dbx-folders a { display: flex; align-items: center; gap: .75rem; padding: .55rem .4rem; border-radius: 8px; color: inherit; text-decoration: none; min-width: 0; }
.dbx-files a:hover, .dbx-folders a:hover { background: #f6f8fb; }
.dbx-files b, .dbx-folders b { font-weight: 600; font-size: .87rem; color: #0f172a; }
.dbx-files time { font-size: .76rem; color: #8a93a4; white-space: nowrap; }
.dbx-folders a > .min-w-0 { display: block; }
.dbx-log li { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid #f1f3f7; }
.dbx-log li:last-child { border-bottom: 0; }
.dbx-log-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .85rem; background: #f1f4f9; color: #475569; }
.dbx-log .k-edit .dbx-log-icon { background: #e8f1fd; color: #1d5fbf; }
.dbx-log .k-create .dbx-log-icon { background: #e6f6ee; color: #137a48; }
.dbx-log .k-permission .dbx-log-icon { background: #f2efff; color: #5b47c9; }
.dbx-log .k-version .dbx-log-icon { background: #e7f6f8; color: #0f6b78; }
.dbx-log .k-archive .dbx-log-icon, .dbx-log .k-delete .dbx-log-icon { background: #fff1e6; color: #a2520b; }
.dbx-log-text { font-size: .86rem; color: #1e293b; overflow-wrap: anywhere; }
.dbx-log-meta { font-size: .76rem; color: #8a93a4; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .15rem; }
.dbx-log-meta .avatar.xs { width: 18px; height: 18px; font-size: .5rem; }
.dbx-log time { font-size: .76rem; color: #8a93a4; white-space: nowrap; }
.dbx-empty { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2rem 1rem; color: #94a3b8; font-size: .86rem; text-align: center; }
.dbx-empty i { font-size: 1.8rem; opacity: .5; }
@media (max-width: 575.98px) { .dbx-tiles { grid-template-columns: repeat(2, 1fr); } .dbx-actions { margin-left: 0; } }
.min-w-0 { min-width: 0; }

/* subfolders: nested navigation tree */
.fx-tree-row { display: flex; align-items: center; padding-left: calc(var(--d, 0) * 14px); min-width: 0; }
.fx-tree-row .fx-nav { flex: 1; min-width: 0; padding-left: .3rem; }
.fx-twisty, .fx-twisty-space { width: 18px; height: 22px; flex-shrink: 0; }
.fx-twisty { border: 0; background: transparent; padding: 0; color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-size: .65rem; }
.fx-twisty:hover { color: #0f172a; background: #e8ebf1; }
.fx-twisty i { transition: transform .15s; }
.fx-twisty.open i { transform: rotate(90deg); }
.fx-crumb.drop-over { box-shadow: 0 0 0 2px var(--brand) inset; }
.fx-location { font-size: .82rem; color: #475569; background: #f6f8fb; border: 1px solid #e8ecf2; border-radius: 8px; padding: .45rem .65rem; }

/* ============================================================ files in folders */
/* file-type colors (icon chip) */
.fx-file.cat-pdf { --fc: #d93025; } .fx-file.cat-word { --fc: #1f5fbf; } .fx-file.cat-excel { --fc: #107c41; }
.fx-file.cat-image { --fc: #8b3fd9; } .fx-file.cat-video { --fc: #d9580b; } .fx-file.cat-other { --fc: #64748b; }
.fx-thumb { position: relative; width: 64px; height: 60px; display: inline-flex; align-items: center; justify-content: center; }
.fx-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; box-shadow: 0 2px 4px rgba(15,23,42,.06); }
.fx-info-thumb { display: block; margin: 0 auto; max-width: 200px; }
.fx-info-thumb img { display: block; max-width: 100%; max-height: 150px; margin: 0 auto; border-radius: 8px; border: 1px solid #e2e8f0; }
.fx-tag.ver { background: #e0f2fe; color: #075985; }
.fx-nav small:empty { display: none; }
.fx-new.btn-light { background: #fff; }
.fx-new.btn-light:disabled { opacity: .45; }
.fx-info-actions { flex-wrap: wrap; }
.fx-info-actions .btn { white-space: nowrap; }
.fx-info-lock { font-size: .76rem; color: #0f6b78; background: #e7f6f8; border-radius: 8px; padding: .4rem .6rem; margin-bottom: .5rem; }
.fx-note { font-size: .8rem; color: #475569; background: #f6f8fb; border: 1px solid #e8ecf2; border-radius: 8px; padding: .5rem .75rem; margin-bottom: .75rem; }
.fx-note i { color: var(--brand); margin-right: .25rem; }
/* drop files from the computer */
.fx-content.drop-files { background: color-mix(in srgb, var(--brand) 6%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 55%, transparent); }
.fx-content.drop-files::after { content: 'Drop to upload into this folder'; position: sticky; bottom: .5rem; display: block; width: max-content; margin: 1rem auto 0; padding: .35rem .8rem; border-radius: 99px; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 500; }

/* versions in the details pane */
.fx-vers { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #eef1f5; }
.fx-vers-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8a93a4; font-weight: 600; margin-bottom: .35rem; }
.fx-vers-head small { color: #b0b8c6; margin-left: .25rem; }
.fx-ver { display: flex; align-items: center; gap: .5rem; padding: .35rem .25rem; border-radius: 6px; }
.fx-ver:hover { background: #f3f6fa; }
.fx-ver-no { font-size: .7rem; font-weight: 700; color: #475569; background: #eef1f5; border-radius: 4px; padding: .05rem .3rem; flex-shrink: 0; }
.fx-ver.current .fx-ver-no { background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); }
.fx-ver-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-ver-main b { font-size: .78rem; font-weight: 600; color: #1e293b; }
.fx-ver-main small { font-size: .7rem; color: #8a93a4; overflow-wrap: anywhere; }
.fx-ver-acts { display: flex; flex-shrink: 0; }
.fx-ver-acts .fx-icon-btn { width: 26px; height: 26px; font-size: .8rem; }

/* upload progress panel */
.fx-uploads { position: fixed; right: 1rem; bottom: 1rem; width: min(360px, calc(100vw - 2rem)); z-index: 1070; background: #fff; border: 1px solid #e3e7ee; border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(15,23,42,.3); overflow: hidden; }
.fx-up-head { display: flex; align-items: center; padding: .55rem .5rem .55rem .9rem; border-bottom: 1px solid #eef1f5; font-size: .85rem; }
.fx-up-list { max-height: 280px; overflow: auto; padding: .25rem; }
.fx-up { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 8px; }
.fx-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .8rem; color: #1e293b; }
.fx-up-main small { color: #8a93a4; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-up.fail .fx-up-main small { color: #b42318; white-space: normal; }
.fx-up-bar { display: block; height: 4px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin-top: .25rem; }
.fx-up-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .2s; }

/* replace / keep both choice */
.fx-choices { display: flex; flex-direction: column; gap: .5rem; }
.fx-choice { display: flex; gap: .65rem; align-items: flex-start; border: 1px solid #e3e7ee; border-radius: 10px; padding: .65rem .8rem; cursor: pointer; }
.fx-choice:hover { border-color: #cbd5e1; background: #fafbfd; }
.fx-choice:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.fx-choice.disabled { opacity: .55; cursor: not-allowed; }
.fx-choice input { margin-top: .3rem; }
.fx-choice span { display: flex; flex-direction: column; min-width: 0; }
.fx-choice b { font-weight: 600; font-size: .9rem; color: #0f172a; }
.fx-choice small { color: #64748b; font-size: .78rem; overflow-wrap: anywhere; }

/* open / preview */
.fx-pv-head { gap: .75rem; padding: .7rem 1rem; }
.fx-pv-titles { flex: 1; min-width: 0; }
.fx-pv-titles .modal-title { font-size: 1rem; font-weight: 600; }
.fx-pv-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.fx-pv-actions .btn { border-radius: 8px; display: inline-flex; align-items: center; gap: .3rem; }
.fx-pv-body { background: #f1f4f8; min-height: 60vh; max-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 0; overflow: auto; }
.modal-fullscreen-lg-down .fx-pv-body { max-height: none; }
.fx-pv-img { max-width: 100%; max-height: 78vh; object-fit: contain; margin: 1rem; box-shadow: 0 4px 16px rgba(15,23,42,.15); background-color: #fff; }
.fx-pv-body.cat-video { background: #0b0f17; }
.fx-pv-video { width: 100%; max-height: 78vh; background: #000; }
.fx-pv-body.cat-pdf { align-items: stretch; }
.fx-pv-frame { width: 100%; height: 78vh; border: 0; background: #fff; }
.fx-pv-loading { display: flex; flex-direction: column; align-items: center; gap: .75rem; color: #64748b; font-size: .9rem; }
.fx-pv-none { text-align: center; padding: 3rem 1.5rem; max-width: 440px; }
.fx-pv-body.cat-video .fx-pv-none h6, .fx-pv-body.cat-video .fx-pv-none p { color: #e2e8f0; }
.fx-pv-none h6 { margin: 1rem 0 .35rem; font-weight: 600; color: #0f172a; }
.fx-pv-none p { color: #64748b; font-size: .88rem; }
.fx-pv-more { font-size: .78rem; color: #64748b; text-align: center; padding: .6rem 1rem; }
.fx-pv-sheetbox { align-self: stretch; width: 100%; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.fx-pv-tabs { display: flex; gap: .15rem; padding: .4rem .5rem 0; border-bottom: 1px solid #e3e7ee; overflow-x: auto; background: #f8fafc; flex-shrink: 0; }
.fx-pv-tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: .35rem .8rem; font-size: .8rem; color: #475569; border-radius: 6px 6px 0 0; white-space: nowrap; }
.fx-pv-tabs button.active { background: #fff; border-color: #e3e7ee; color: #107c41; font-weight: 600; margin-bottom: -1px; }
.fx-pv-sheet { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.fx-pv-scroll { overflow: auto; max-height: calc(80vh - 90px); }
.modal-fullscreen-lg-down .fx-pv-scroll { max-height: none; }
.fx-pv-table { border-collapse: separate; border-spacing: 0; font-size: .8rem; font-variant-numeric: tabular-nums; }
.fx-pv-table th, .fx-pv-table td { border-right: 1px solid #e8ecf2; border-bottom: 1px solid #e8ecf2; padding: .25rem .5rem; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.fx-pv-table thead th { position: sticky; top: 0; background: #f3f5f8; color: #64748b; font-weight: 500; text-align: center; z-index: 2; }
.fx-pv-table tbody th { position: sticky; left: 0; background: #f3f5f8; color: #64748b; font-weight: 500; text-align: right; z-index: 1; min-width: 40px; }
.fx-pv-table thead th:first-child { left: 0; z-index: 3; }
.fx-pv-page { background: #fff; width: min(820px, 100%); margin: 1.5rem auto .5rem; padding: 2.5rem 3rem; box-shadow: 0 4px 16px rgba(15,23,42,.1); color: #1e293b; font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.fx-pv-body:has(.fx-pv-page) { flex-direction: column; justify-content: flex-start; }
.fx-pv-page p { margin: 0 0 .6rem; white-space: pre-wrap; }
.fx-pv-page p.li { padding-left: 1.2rem; position: relative; }
.fx-pv-page p.li::before { content: '•'; position: absolute; left: .3rem; color: #64748b; }
.fx-pv-page h2, .fx-pv-page h3, .fx-pv-page h4, .fx-pv-page h5, .fx-pv-page h6 { font-weight: 600; margin: 1.1rem 0 .5rem; color: #0f172a; }
.fx-pv-page h2 { font-size: 1.4rem; } .fx-pv-page h3 { font-size: 1.2rem; } .fx-pv-page h4 { font-size: 1.05rem; }
.fx-pv-doctable { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .88rem; }
.fx-pv-doctable td { border: 1px solid #d5dbe4; padding: .35rem .5rem; vertical-align: top; white-space: pre-wrap; }
@media (max-width: 575.98px) { .fx-pv-page { padding: 1.25rem; margin: .5rem; } .fx-pv-actions .btn span { display: none; } }

/* share dialog */
.fx-share-form { background: #f8fafc; border: 1px solid #e8ecf2; border-radius: 10px; padding: .85rem; }
.fx-share-sect { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #8a93a4; font-weight: 600; margin: 1.1rem 0 .35rem; }
.fx-person { display: flex; align-items: center; gap: .7rem; padding: .5rem .25rem; border-bottom: 1px solid #f1f3f7; }
.fx-person:last-of-type { border-bottom: 0; }
.fx-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eef1f5; color: #475569; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fx-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-person-main b { font-size: .88rem; font-weight: 600; color: #0f172a; }
.fx-person-main small { font-size: .76rem; color: #8a93a4; overflow-wrap: anywhere; }
.fx-share-adv summary { font-size: .82rem; color: var(--brand); cursor: pointer; }
