/* Namotech Documents – Explorer-style UI */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --side: #f7f8fa;
  --line: #e3e7ed;
  --line-2: #d4dae3;
  --text: #1c2430;
  --muted: #667085;
  --accent: #1f6feb;
  --accent-2: #175cd3;
  --accent-soft: #e8f0fe;
  --sel: #cce4ff;
  --sel-line: #99c8ff;
  --hover: #eef3fb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --green: #067647;
  --green-soft: #ecfdf3;
  --radius: 8px;
  --shadow: 0 8px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --top: 56px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
code { font: 12px/1.4 ui-monospace, Consolas, monospace; background: #f1f3f6; padding: 2px 6px; border-radius: 4px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.row-gap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.only-mobile { display: none !important; }
.scrim { display: none; }
.ok-text { color: var(--green); font-weight: 600; }

.ic { width: 18px; height: 18px; flex: none; display: block; }
.ficon { width: 22px; height: 22px; flex: none; display: inline-flex; }
.ficon svg { width: 100%; height: 100%; }
.ficon.xs { width: 18px; height: 18px; }
.ficon.sm { width: 22px; height: 22px; }
.ficon.xl { width: 72px; height: 72px; }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; color: var(--text); }
.btn:hover { background: #f5f7fa; border-color: #c2cad6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; }
.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-soft); border-color: #fecdca; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 40px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: #344054; flex: none; }
.icon-btn:hover { background: #e9edf3; }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.icon-btn.dark { color: #e6e9ee; }
.icon-btn.dark:hover { background: rgba(255, 255, 255, .12); }
.link { background: none; border: 0; padding: 0 4px; color: var(--accent); cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }
.input, .form input, .field input, .field select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font: inherit; color: var(--text); outline: none; }
.input:focus, .form input:focus, .field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .15); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 500; color: #344054; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; margin: 10px 0; }
.check input { margin-top: 3px; }

/* ---------- top bar */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: var(--top); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 16px; width: 228px; flex: none; }
.brand img { border-radius: 6px; }
.search { flex: 1; max-width: 640px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: #f0f3f7; border: 1px solid transparent; border-radius: 19px; color: var(--muted); transition: background .15s, border-color .15s; }
.search:focus-within { background: #fff; border-color: var(--line-2); box-shadow: 0 1px 4px rgba(16, 24, 40, .08); }
.search input { flex: 1; border: 0; background: transparent; outline: none; font: inherit; color: var(--text); height: 100%; min-width: 0; }
.user-menu { margin-left: auto; position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 8px 4px 4px; border-radius: 20px; cursor: pointer; }
.user-btn:hover { background: #f0f3f7; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #2e7cf6, #7a5af8); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; vertical-align: middle; }
.user-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #f2f4f7; color: #475467; }
.role-chip.admin { background: #ebe9fe; color: #5925dc; }

.dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.dropdown.right { left: auto; right: 0; }
.dropdown button, .dropdown a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); text-align: left; }
.dropdown button:hover, .dropdown a:hover { background: var(--hover); }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); }

/* ---------- layout */
.layout { flex: 1; display: flex; min-height: 0; position: relative; }
.sidebar { width: 260px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.new-wrap { position: relative; padding: 14px 14px 8px; }
.btn-new { height: 44px; padding: 0 22px 0 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); font-weight: 600; }
.btn-new:hover { background: #f4f8ff; box-shadow: 0 2px 6px rgba(16, 24, 40, .14); }
.new-wrap .dropdown { left: 14px; top: 60px; }

.tree { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.tree-row { display: flex; align-items: center; gap: 4px; height: 32px; padding-left: calc(var(--d) * 14px + 4px); padding-right: 8px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.tree-row:hover { background: #e9eef5; }
.tree-row.current { background: var(--sel); font-weight: 600; }
.tw { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: #667085; flex: none; border-radius: 4px; }
.tw:hover { background: rgba(0, 0, 0, .06); }
.tw .ic { width: 14px; height: 14px; transition: transform .15s; }
.tw .rot .ic { transform: rotate(90deg); }
.ti { width: 20px; height: 20px; display: inline-flex; color: #475467; flex: none; }
.ti svg { width: 100%; height: 100%; }
.tn { overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
.side-links { border-top: 1px solid var(--line); padding: 8px; }
.side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px; }
.side-links a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.side-links a:hover { background: #e9eef5; }
.side-links a.current { background: var(--sel); font-weight: 600; }
.side-links .ic { color: #475467; }
.badge { margin-left: auto; background: #f79009; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 700; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); }

/* ---------- explorer */
.explorer { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.addressbar { display: flex; align-items: center; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.crumbs { flex: 1; min-width: 0; margin-left: 8px; height: 34px; border: 1px solid var(--line-2); border-radius: 6px; display: flex; align-items: center; padding: 0 6px; overflow: hidden; background: #fff; }
.crumbs-inner { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.crumbs-inner::-webkit-scrollbar { display: none; }
.crumb-wrap { display: inline-flex; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; color: var(--text); }
a.crumb:hover { background: var(--hover); }
.crumb .ic { width: 16px; height: 16px; color: #475467; }
.sep { color: #98a2b3; display: inline-flex; }
.sep .ic { width: 14px; height: 14px; }

.cmdbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 48px; }
.cmd-left, .cmd-right { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.cmd-right { flex: none; gap: 8px; }
.cmd { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text); }
.cmd:hover { background: var(--hover); }
.cmd .ic { width: 17px; height: 17px; color: #475467; }
.cmd.primary .ic { color: var(--accent); }
.cmd.danger, .cmd.danger .ic { color: var(--danger); }
.sort-select { display: inline-flex; align-items: center; gap: 4px; color: #475467; }
.sort-select select { border: 1px solid var(--line-2); border-radius: 6px; height: 32px; padding: 0 6px; background: #fff; font: inherit; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { width: 34px; height: 30px; border: 0; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #475467; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

.content { flex: 1; overflow: auto; position: relative; user-select: none; -webkit-user-select: none; }
.loading-bar { position: sticky; top: 0; height: 2px; z-index: 3; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.table { min-width: 100%; }
.thead, .trow { display: grid; grid-template-columns: minmax(240px, 1fr) 170px 150px 96px 150px; align-items: center; }
.thead { position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--line); }
.thead > * { text-align: left; border: 0; background: none; padding: 8px 12px; font-size: 12.5px; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; }
.thead > button:hover { background: var(--hover); }
.thead i { font-style: normal; font-size: 9px; margin-left: 4px; }
.trow { height: 40px; margin: 0 4px; border: 1px solid transparent; border-radius: 4px; cursor: default; }
.trow:hover { background: var(--hover); }
.trow.sel { background: var(--sel); border-color: var(--sel-line); }
.trow > span { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #475467; font-size: 13px; }
.trow .c-name { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.trow .c-size { text-align: right; padding-right: 16px; }
.thead .c-size { text-align: right; padding-right: 20px; }
.fname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fname > span { overflow: hidden; text-overflow: ellipsis; }
.fpath { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.grey { background: #f2f4f7; color: #475467; }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.blue { background: #eff8ff; color: #175cd3; }
.tag.on-dark { background: rgba(255, 255, 255, .12); color: #e6e9ee; height: 30px; padding: 0 10px; border-radius: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 6px; padding: 12px; }
.gitem { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border: 1px solid transparent; border-radius: 6px; cursor: default; text-align: center; }
.gitem:hover { background: var(--hover); }
.gitem.sel { background: var(--sel); border-color: var(--sel-line); }
.gicon { width: 64px; height: 64px; display: block; }
.gicon svg { width: 100%; height: 100%; }
.gname { font-size: 13px; line-height: 1.3; max-width: 100%; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gbadges { position: absolute; top: 8px; right: 8px; display: flex; gap: 3px; }
.gbadges .mini { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line); display: inline-flex; align-items: center; justify-content: center; color: #667085; }
.gbadges .mini.green { color: var(--green); }
.gbadges .mini .ic { width: 12px; height: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin: 5px; }
.dot.amber { background: #f79009; box-shadow: 0 0 0 2px #fff; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 20px; color: var(--muted); }
.empty h3 { margin: 12px 0 4px; color: var(--text); font-weight: 600; }
.empty p { margin: 0 0 14px; }
.empty-ic { width: 56px; height: 56px; border-radius: 50%; background: #f2f4f7; display: inline-flex; align-items: center; justify-content: center; color: #667085; }
.empty-ic .ic { width: 26px; height: 26px; }

.statusbar { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: 5px 14px; font-size: 12px; color: #475467; border-top: 1px solid var(--line); background: #fafbfc; white-space: pre; }

/* ---------- pages (admin) */
.page { flex: 1; overflow: auto; padding: 22px 26px 40px; background: var(--bg); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 650; }
.page-head p { margin: 0; max-width: 680px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.card.pad { padding: 20px 22px; }
.card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.card h3 { font-size: 13px; margin: 18px 0 8px; color: #344054; }
.card-tools { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-tools .input { max-width: 320px; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable td { padding: 9px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: #fafcff; }
.dtable tr.dim td { opacity: .55; }
.dtable.small td, .dtable.small th { padding: 6px 10px; font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtable .hl { background: #eef4ff; }
.dtable .t-right .btn { margin-left: 4px; }
.w-check { width: 36px; }
.file-link { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); text-align: left; }
.file-link:not(.static):hover span:last-child { color: var(--accent); text-decoration: underline; }
.scroll-x { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.col-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 16px; background: #fff; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.chip b { background: var(--accent); color: #fff; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.master .row-gap { margin-top: 14px; }
.path-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.path-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; break-inside: avoid; }
.path-list svg { width: 18px; height: 18px; flex: none; }
.steps { padding-left: 20px; margin: 10px 0 16px; }
.steps li { margin-bottom: 6px; }
.scan { margin-top: 16px; padding: 14px 16px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; }
.kv { display: flex; gap: 12px; padding: 4px 0; }
.kv > span:first-child { width: 190px; flex: none; color: var(--muted); }
.scan .row-gap { margin-top: 10px; }
.errors { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; padding-left: 18px; }

/* ---------- context menu */
.ctx { position: fixed; z-index: 80; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; }
.ctx button:hover { background: var(--hover); }
.ctx button > span:first-child { width: 18px; display: inline-flex; color: #475467; }
.ctx button.danger, .ctx button.danger > span:first-child { color: var(--danger); }
.ctx kbd { margin-left: auto; font: 11px var(--font); color: var(--muted); }

/* ---------- drag overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(31, 111, 235, .1); border: 3px dashed var(--accent); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-overlay > div { background: #fff; padding: 24px 40px; border-radius: 14px; box-shadow: var(--shadow); text-align: center; color: var(--accent); }
.drop-overlay .ic { width: 40px; height: 40px; margin: 0 auto; }
.drop-overlay h2 { margin: 8px 0 2px; }
.drop-overlay p { margin: 0; color: var(--muted); }

/* ---------- viewer */
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 24, .94); display: flex; flex-direction: column; color: #e6e9ee; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(0, 0, 0, .35); }
.vtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vtitle b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vtitle small { color: #a6adbb; }
.vtools { display: flex; align-items: center; gap: 6px; }
.zoom { font-size: 12px; min-width: 40px; text-align: center; }
.viewer-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; position: relative; padding: 16px; }
.vimg { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 6px 30px rgba(0, 0, 0, .5); background: #fff; }
.vmedia { max-width: 100%; max-height: 100%; background: #000; border-radius: 6px; }
.vtext { align-self: stretch; width: 100%; max-width: 1000px; margin: 0 auto; background: #fff; color: #1c2430; padding: 24px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font: 13px/1.55 ui-monospace, Consolas, monospace; user-select: text; }
.pdf-pages { align-self: flex-start; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; padding-bottom: 30px; }
.pdf-page { background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .4); max-width: none; }
.pdf-page canvas { display: block; }
.vnone { background: #fff; color: var(--text); border-radius: 14px; padding: 36px 40px; text-align: center; max-width: 440px; }
.vnone h3 { margin: 14px 0 6px; word-break: break-word; }
.vloading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.verror { background: #fff; color: var(--danger); padding: 16px 20px; border-radius: 8px; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modals */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.top { z-index: 110; }
.modal { width: 440px; max-width: 100%; max-height: calc(100vh - 32px); background: #fff; border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.modal > div:not(.modal-head), .modal > form { display: flex; flex-direction: column; min-height: 0; }
.modal.perms, .modal.user, .modal.creds { width: 560px; }
.modal.picker { width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-head h2 { font-size: 17px; margin: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 10px 18px 6px; overflow: auto; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 18px 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.span2 { grid-column: span 2; }
.note { background: var(--amber-soft); color: var(--amber); padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.choice { display: grid; gap: 8px; margin: 4px 0 8px; }
.choice label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.choice label.on { border-color: var(--accent); background: #f5f9ff; }
.choice label > span .ic { width: 22px; height: 22px; color: #475467; }
.choice label.on > span .ic { color: var(--accent); }
.choice small { display: block; color: var(--muted); }
.choice input { accent-color: var(--accent); }
.upload-sum { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #f8fafc; border-radius: 10px; margin-bottom: 12px; }
.upload-sum .ic { width: 26px; height: 26px; color: var(--accent); }
.upload-sum p { margin: 2px 0 0; }
.props-head { display: flex; justify-content: center; padding: 6px 0 12px; }
.props { margin: 0; }
.props div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid #f0f2f5; }
.props dt { color: var(--muted); }
.props dd { margin: 0; word-break: break-word; }
.perm-list .card-tools { padding: 8px 0; border: 0; }
.perm-scroll { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.perm-row:last-child { border-bottom: 0; }
.perm-row:hover { background: #fafcff; }
.perm-row small { display: block; color: var(--muted); }
.picker-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; background: #f8fafc; border-radius: 6px; margin-bottom: 8px; }
.picker-list { height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.picker-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid #f0f2f5; background: none; cursor: pointer; text-align: left; }
.picker-row:hover { background: var(--hover); }
.picker-row:disabled { opacity: .4; cursor: not-allowed; }
.picker-row .ic { width: 14px; height: 14px; color: #98a2b3; }
.pad-s { padding: 14px; }

/* ---------- upload panel */
.uppanel { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 380px; max-width: calc(100vw - 24px); background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.uphead { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; background: #1c2430; color: #fff; cursor: pointer; }
.uphead b { font-weight: 600; font-size: 13.5px; }
.uphead .icon-btn { color: #fff; width: 28px; height: 28px; }
.uphead .icon-btn:hover { background: rgba(255, 255, 255, .15); }
.rot180 .ic { transform: rotate(180deg); }
.upbar { height: 4px; background: #e4e7ec; }
.upbar > div { height: 100%; background: var(--accent); transition: width .3s; }
.upbar.thin { height: 3px; border-radius: 2px; margin-top: 4px; }
.upbody { padding: 10px 14px 12px; max-height: 340px; overflow: auto; }
.upstats { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: #344054; font-weight: 500; }
.upitem { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.upitem small { color: var(--muted); width: 34px; text-align: right; }
.upname { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 270px; }
.uperrors { margin-top: 8px; padding: 8px 10px; background: var(--danger-soft); color: #b42318; border-radius: 6px; font-size: 12px; max-height: 120px; overflow: auto; }
.upfoot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* ---------- toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1c2430; color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 520px; animation: pop .18s ease-out; }
.toast.error { background: #b42318; }
.toast.warn { background: #b54708; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ---------- auth pages */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, #dbe8ff 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ece6ff 0, transparent 60%), var(--bg); }
.auth-card { width: 400px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 30px 26px; }
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; }
.auth-card .muted { margin: 0 0 18px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { border-radius: 8px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand span { color: var(--muted); font-size: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: #344054; }
.form input { height: 40px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: var(--danger-soft); color: #b42318; border: 1px solid #fecdca; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .thead, .trow { grid-template-columns: minmax(200px, 1fr) 150px 90px 130px; }
  .c-type { display: none; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .hide-mobile { display: none !important; }
  .brand { width: auto; }
  .brand span { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .sidebar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: absolute; inset: 0; background: rgba(16, 24, 40, .35); z-index: 35; }
  .thead, .trow { grid-template-columns: 1fr 86px; }
  .c-date, .c-type, .c-acc { display: none; }
  .trow { height: 48px; }
  .cmd-label { display: none; }
  .addressbar .icon-btn:nth-child(2) { display: none; }
  .page { padding: 16px 12px 40px; }
  .kv { flex-direction: column; gap: 2px; }
  .kv > span:first-child { width: auto; }
  .path-list { columns: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .uppanel { right: 12px; bottom: 12px; }
  .statusbar .muted { display: none; }
}
