/* Documents & client portal: folder tree, file grid, drop zone, upload progress, preview, portal hero. Core tokens only. */

/* ---------- layout ---------- */
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 991.98px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } }
.docs-side { position: sticky; top: calc(var(--topbar-h) + 1rem); }
@media (max-width: 991.98px) { .docs-side { position: static; } }

/* ---------- folder tree ---------- */
.ftree { list-style: none; margin: 0; padding: .35rem; }
.ftree ul { list-style: none; margin: 0; padding-left: .9rem; border-left: 1px dashed var(--border); margin-left: .75rem; }
.ftree-item { display: flex; align-items: center; gap: .45rem; width: 100%; border: 0; background: transparent; text-align: left; padding: .38rem .55rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .87rem; font-weight: 520; transition: background var(--dur-fast), color var(--dur-fast); min-width: 0; }
.ftree-item:hover { background: var(--surface-hover); color: var(--text); }
.ftree-item.active { background: var(--brand-soft); color: var(--brand); }
.ftree-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftree-item .count { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ftree-item.drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-softer); }

/* ---------- drop zone ---------- */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  background: var(--surface); transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease); }
.dropzone.over { border-color: var(--brand); background: var(--brand-softer); transform: scale(1.005); }
.dropzone .dz-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.dropzone .dz-text { flex: 1 1 200px; min-width: 0; }
.dropzone .dz-text strong { display: block; font-size: .92rem; }
.dropzone .dz-text small { color: var(--muted); }
.dropzone .dz-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.dz-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upq { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.upq li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; font-size: .82rem; align-items: center; animation: rise var(--dur) var(--ease) both; }
.upq .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.upq .st { color: var(--muted); font-variant-numeric: tabular-nums; }
.upq .st.bad { color: var(--bad); } .upq .st.ok { color: var(--ok); }
.upq .bar-track { grid-column: 1 / -1; height: 6px; }
.upq .bar-fill { background: var(--brand); transition: width 160ms linear; }
.upq li.done .bar-fill { background: var(--ok); } .upq li.failed .bar-fill { background: var(--bad); }

/* ---------- file grid ---------- */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
@media (max-width: 575.98px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }
.fcard { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: .85rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast), border-color var(--dur-fast); animation: pop-in var(--dur) var(--ease) both; min-width: 0; text-align: left; color: var(--text); }
.fcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.fcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fcard.dragging { opacity: .45; }
.fcard .fthumb { height: 86px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.fcard .fthumb img { width: 100%; height: 100%; object-fit: cover; }
.fcard .fthumb .icon { width: 34px; height: 34px; }
.fcard .ftitle { font-weight: 600; font-size: .86rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.fcard .fmeta { font-size: .72rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.fcard .fflags { position: absolute; top: .55rem; right: .55rem; display: flex; gap: .25rem; }
.ext { font-size: .62rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .4rem; border-radius: 5px; background: var(--surface-hover); color: var(--text-2); }
.ext-pdf { background: var(--bad-soft); color: var(--bad); }
.ext-img { background: var(--violet-soft); color: var(--violet); }
.ext-xls { background: var(--ok-soft); color: var(--ok); }
.ext-doc { background: var(--info-soft); color: var(--info); }
.ext-zip { background: var(--warn-soft); color: var(--warn); }
.fthumb.t-pdf { color: var(--bad); } .fthumb.t-img { color: var(--violet); } .fthumb.t-xls { color: var(--ok); } .fthumb.t-doc { color: var(--info); } .fthumb.t-zip { color: var(--warn); }

/* ---------- preview ---------- */
.pv-frame { width: 100%; height: 62vh; min-height: 320px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: block; }
.pv-img { max-width: 100%; max-height: 62vh; display: block; margin: 0 auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.pv-none { padding: 2rem 1rem; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); }
.share-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; word-break: break-all; }
.docs-drawer-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- requests ---------- */
.req-progress { display: flex; align-items: center; gap: .6rem; min-width: 140px; }
.req-progress .bar-track { flex: 1; height: 8px; }
.req-progress .bar-fill { background: var(--ok); }
.req-progress b { font-size: .78rem; font-variant-numeric: tabular-nums; min-width: 2.6rem; text-align: right; }
.ritem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .35rem .8rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); animation: fade-row var(--dur) var(--ease) both; }
.ritem:last-child { border-bottom: 0; }
.ritem .rnum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--surface-hover); color: var(--text-2); }
.ritem.s-accepted .rnum { background: var(--ok-soft); color: var(--ok); }
.ritem.s-uploaded .rnum { background: var(--info-soft); color: var(--info); }
.ritem.s-rejected .rnum { background: var(--bad-soft); color: var(--bad); }
.ritem .rdesc { font-weight: 560; min-width: 0; word-break: break-word; }
.ritem .rsub { font-size: .76rem; color: var(--muted); }
.ritem .racts { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
@media (max-width: 575.98px) { .ritem { grid-template-columns: auto minmax(0, 1fr); } .ritem .racts { grid-column: 1 / -1; justify-content: flex-start; } }
.item-rows .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 70px 34px; gap: .4rem; margin-bottom: .4rem; align-items: center; }
@media (max-width: 575.98px) { .item-rows .item-row { grid-template-columns: minmax(0, 1fr) 90px 34px; } .item-rows .item-row .qty { display: none; } }

/* ---------- register ---------- */
.dir-in { color: var(--info); } .dir-out { color: var(--violet); }
.held-list .form-check { padding: .45rem .5rem .45rem 2rem; border-radius: var(--radius-sm); }
.held-list .form-check:hover { background: var(--surface-hover); }

/* ---------- portal ---------- */
.portal-hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0f172a));
  color: var(--brand-ink); animation: rise var(--dur-slow) var(--ease) both; }
.portal-hero h1 { font-size: 1.45rem; font-weight: 720; margin: 0 0 .25rem; letter-spacing: -.02em; }
.portal-hero p { margin: 0; opacity: .85; font-size: .9rem; }
.portal-hero .firm { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 650; margin-bottom: .35rem; }
.portal-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.invite-badge { display: inline-flex; align-items: center; gap: .35rem; }
.pick-float .pick-list { position: absolute; left: 0; right: 0; z-index: 30; box-shadow: var(--shadow-lg); }
.dropzone.compact { padding: .55rem .7rem; gap: .5rem; border-width: 1.5px; }
.dropzone.compact .dz-ic { width: 32px; height: 32px; border-radius: 9px; }
.dropzone.compact .dz-text small { display: none; }
.dropzone.compact .dz-text strong { font-size: .84rem; font-weight: 600; }
@media (max-width: 575.98px) { .dropzone.compact .dz-ic, .dropzone.compact .dz-text { display: none; } .dropzone.compact { border-style: solid; border-color: var(--border); } }
