/* FileShare UI · css/layout.css · App shell: header, left panel, document list, preview. Loaded in the order listed in index.html. */
/* ---------------------------------------------------------------- app shell */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: auto auto 1fr; background: #fff; }
.appbar { display: flex; align-items: center; gap: 28px; padding: 6px 16px 4px 28px; border-bottom: 1px solid var(--line-soft); }
.quick-search { position: relative; width: min(280px, 26vw); }
.quick-search input { width: 100%; padding: 8px 38px 8px 14px; border-radius: 20px; }
.quick-search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--c-blue); cursor: pointer; padding: 4px; display: grid; }
.appbar-actions { margin-left: auto; display: flex; align-items: stretch; gap: 2px; }
.top-action { display: grid; justify-items: center; gap: 2px; padding: 4px 10px; border: 0; background: none; color: var(--ink); font-size: 12.5px; cursor: pointer; border-radius: 4px; }
.top-action .ic { width: 26px; height: 26px; stroke-width: 1.5; }
.top-action:hover { background: var(--hover); }
.top-user { cursor: default; }
.top-user:hover { background: none; }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 10px; background: var(--welcome); font-size: 13.5px; border-bottom: 1px solid #EFE39A; }
.welcome button { border: 0; background: none; color: var(--c-blue); cursor: pointer; display: grid; padding: 2px; }
.welcome .ic { width: 16px; height: 16px; stroke-width: 2.2; }

.workspace { --left-w: 290px; --preview-w: 44%; display: grid; grid-template-columns: var(--left-w) 5px minmax(360px, 1fr); min-height: 0; background: var(--panel); }
.workspace.has-preview { grid-template-columns: var(--left-w) 5px minmax(360px, 1fr) 5px var(--preview-w); }

.splitter { background: var(--line-soft); position: relative; }
.splitter-v { cursor: col-resize; }
.splitter-v::after { content: ""; position: absolute; left: 1px; top: 50%; width: 3px; height: 28px; transform: translateY(-50%); border-left: 1px dotted #9AA5B1; border-right: 1px dotted #9AA5B1; }
.splitter-h { cursor: row-resize; height: 5px; }
.splitter-h::after { content: ""; position: absolute; top: 1px; left: 50%; height: 3px; width: 28px; transform: translateX(-50%); border-top: 1px dotted #9AA5B1; border-bottom: 1px dotted #9AA5B1; }
.splitter:hover, .splitter.dragging { background: #CFE3EE; }

/* ---------------------------------------------------------------- left panel */
.leftpanel { display: grid; grid-template-rows: auto 1fr; min-height: 0; background: #fff; border-right: 1px solid var(--line-soft); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 6px 0; background: var(--panel); }
.tab { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px; border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; background: #E4E8EC; color: var(--muted); font-weight: 500; cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); }
.tab .ic { width: 18px; height: 18px; }

.tree { overflow: auto; padding: 6px 4px 20px; font-size: 14px; }
.tnode { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; }
.trow { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 2px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.trow:hover { background: var(--hover); }
.trow.selected { background: var(--select); font-weight: 600; }
.tog { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: none; color: var(--c-blue); font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; flex: none; }
.tog.leaf { visibility: hidden; }
.trow .fic { width: 22px; height: 22px; flex: none; }
.tlabel { overflow: hidden; text-overflow: ellipsis; }
.trow.root .tlabel { font-weight: 700; }

.search-panel { display: grid; gap: 10px; align-content: start; padding: 14px 12px; }
.search-help { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- center */
.center { display: grid; grid-template-rows: auto auto 1fr; min-width: 0; min-height: 0; background: #fff; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; background: var(--panel); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.tool { display: grid; place-items: center; width: 34px; height: 32px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.tool .ic { width: 22px; height: 22px; }
.tool:hover:not(:disabled) { background: #fff; border-color: var(--line); }
.tool:disabled { opacity: .35; cursor: default; }
.tool-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.listbar { display: flex; align-items: center; gap: 12px; padding: 4px 12px; font-size: 13px; background: #F8F9FA; border-bottom: 1px solid var(--line-soft); }
.list-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-count { color: var(--muted); white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-left: auto; margin-right: 12px; }
.pager label { display: flex; align-items: center; gap: 5px; }
.pager select, .pager input { font: inherit; font-size: 13px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--ink); }
.pager input { width: 48px; }
.pager-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.pgbtn { border: 1px solid var(--line); background: #fff; border-radius: 3px; width: 22px; height: 22px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0; }
.pgbtn:disabled { opacity: .35; cursor: default; }

.center-split { --grid-h: 52%; display: grid; grid-template-rows: var(--grid-h) 5px 1fr; min-height: 0; }
.center-split.no-details { grid-template-rows: 1fr 0 0; }
.center-split.no-details .splitter-h, .center-split.no-details .details { display: none; }

.grid-wrap { overflow: auto; position: relative; min-height: 0; }
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--grid-head); color: var(--ink); font-weight: 500; padding: 7px 10px; text-align: center; border-right: 1px solid #fff; white-space: nowrap; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: center; }
.grid td.left, .grid th.left { text-align: left; }
.grid td.wrap { white-space: normal; text-align: left; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--hover); }
.grid tbody tr.selected td { background: var(--select); }
.grid .ficon { width: 20px; height: 20px; vertical-align: middle; }
.grid .num { text-align: right; }
.grid-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.grid-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; font-weight: 500; }

.drop-overlay { position: absolute; inset: 6px; border: 2px dashed var(--brand); border-radius: 6px; background: rgba(230, 242, 248, .94); display: grid; place-items: center; font-size: 16px; z-index: 5; pointer-events: none; }

.details { display: grid; grid-template-columns: 46px 1fr; min-height: 0; border-top: 1px solid var(--line-soft); }
.dtabs { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; background: #fff; border-right: 1px solid var(--line-soft); }
.dtab { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.dtab .ic { width: 22px; height: 22px; }
.dtab[aria-selected="true"] { background: var(--select-soft); border-color: #EADB70; }
.dtab:disabled { opacity: .3; cursor: default; }
.details-body { overflow: auto; padding: 12px 14px 20px; }

.kv { border-collapse: collapse; min-width: min(560px, 100%); font-size: 13.5px; }
.kv th, .kv td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: middle; }
.kv th { background: var(--grid-head); font-weight: 400; color: #4A5560; width: 150px; white-space: nowrap; }
.kv td { background: #F4F6F8; word-break: break-all; }
.kv td input { width: 100%; max-width: 280px; background: #fff; }
.kv a, .linklike { color: var(--c-blue); text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.section-title { margin: 0 0 10px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.section-title .btn { margin-left: auto; }

.meta-rows { display: grid; gap: 6px; max-width: 620px; margin-bottom: 10px; }
.meta-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; }
.meta-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------------- preview */
.preview { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 0; background: #525659; }
.preview-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #323639; color: #fff; }
.preview-name { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.pbtn { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 4px; background: none; color: #E8EAED; cursor: pointer; }
.pbtn:hover { background: rgba(255, 255, 255, .12); }
.pbtn .ic { width: 18px; height: 18px; }
.preview-body { min-height: 0; overflow: auto; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #2A2A2E; display: block; }
.preview-body img { max-width: 100%; margin: auto; display: block; background: #fff; }
.preview-body pre { margin: 12px; padding: 16px; background: #fff; white-space: pre-wrap; word-break: break-word; font-size: 13px; min-height: calc(100% - 24px); }
.preview-msg { margin: auto; max-width: 320px; text-align: center; color: #E8EAED; display: grid; gap: 12px; justify-items: center; padding: 20px; }
