:root {
  --blue: #0b88c8;
  --blue-dark: #076a9d;
  --purple: #6c45d9;
  --forest: #173e35;
  --orange: #0b88c8;
  --ink: #20262c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --panel: #ffffff;
  --hover: #f1f5f9;
  --selected: #e8f2fb;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body:has(.auth-shell) { overflow: auto; }
button, input, textarea, select { font: inherit; }
button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 34px;
  padding: 7px 11px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 650;
}
button:hover { background: var(--blue-dark); }
button.secondary { background: #fff; color: #374151; border-color: var(--line); }
button.secondary:hover { background: var(--hover); }
button.danger, button.secondary.danger {
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
}
button.danger:hover, button.secondary.danger:hover { background: #fef2f2; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d7dce2;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(11,136,200,.14); }
label { display: grid; gap: 5px; color: #374151; font-weight: 650; font-size: 12px; }
textarea { min-height: 92px; resize: vertical; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(16, 39, 31, 0.44), rgba(238, 244, 239, 0.76) 48%, rgba(248, 241, 228, 0.86)),
    url("/login-file-management-bg.png") center 48% / cover no-repeat;
  overflow: auto;
}
.auth-card {
  width: fit-content;
  max-width: min(92vw, 980px);
  display: grid;
  grid-template-columns: 1.05fr 0.72fr;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.76));
  box-shadow: 0 28px 72px rgba(24, 35, 30, 0.20);
  backdrop-filter: blur(20px);
}
.login-intro {
  border-radius: 22px;
  min-height: 280px;
  padding: 24px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(31,107,80,.15), transparent 22rem),
    linear-gradient(180deg, rgba(232,244,239,.78), rgba(255,255,255,.44));
}
.login-logo { width: min(230px, 64vw); height: auto; margin-bottom: 14px; }
.login-intro h1 { margin: 0; color: #17241f; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.02; }
.login-intro p { margin: 12px 0 0; max-width: 420px; color: #52645b; line-height: 1.5; }
.auth-form {
  align-self: center;
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: min(330px, 80vw);
  min-height: 280px;
  border-radius: 22px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.84);
  box-shadow: 0 14px 36px rgba(24, 35, 30, 0.08);
}
.auth-form .eyebrow {
  color: #1f6b50;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-form h2 { margin: 0; color: var(--ink); font-size: 22px; line-height: 1.15; }
.auth-form p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.auth-card .form { display: grid; gap: 12px; width: 100%; }
.auth-card label { color: #374151; font-size: 12px; letter-spacing: 0; }
.auth-card input { border-radius: 8px; min-height: 40px; }
.auth-card button { width: 100%; min-height: 40px; background: #1f6b50; border-color: #1f6b50; border-radius: 8px; }
.auth-card button:hover { background: #174f3a; }
.note { color: var(--muted); font-size: 13px; }
.auth-card .note { color: var(--muted); }
.error { background: #fff1f0; border: 1px solid #efc7c2; border-radius: 8px; color: #8a2d26; font-size: 13px; padding: 11px 12px; width: 100%; }

.file-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 54px 56px minmax(0, 1fr);
  background: #fff;
}
.file-shell.has-inspector { grid-template-columns: 280px minmax(0, 1fr) 360px; }
.global-commandbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbfd 0%, #edf7fb 100%);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06);
}
.top-brand { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.top-brand img { width: 116px; height: auto; display: block; }
.top-brand span { color: var(--forest); font: 700 18px/1 Georgia, serif; white-space: nowrap; }
.top-nav {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}
.top-nav-item {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  border-color: transparent;
  white-space: nowrap;
}
.top-nav-item:hover { background: #e0f2fe; color: #075985; }
.top-nav-item.active { background: #0b88c8; border-color: #0b88c8; color: #fff; }
.top-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-user .role-pill { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.folder-tree {
  grid-column: 1;
  grid-row: 2 / span 2;
  border-right: 1px solid var(--line);
  background: #fff;
  overflow: auto;
  padding: 10px;
}
.folder-tree-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: -10px -10px 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.folder-tree-head strong { font-size: 13px; color: #334155; }
.tree-actions { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
.create-btn { background: var(--purple); text-align: left; }
.tree-section {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 14px 6px 6px;
}
.tree-empty { color: var(--muted); font-size: 12px; padding: 8px; }
.tree-row {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  gap: 5px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: #374151;
  border-radius: 5px;
  padding: 6px 7px;
  min-height: 30px;
}
.tree-row:hover, .tree-row.active { background: var(--selected); color: #075985; }
.tree-row.child { padding-left: 20px; color: #4b5563; }
.tree-row strong, .tree-row { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row em { color: #64748b; font-style: normal; font-size: 10px; font-weight: 700; margin-left: 4px; text-transform: uppercase; }

.file-main { grid-column: 2; grid-row: 2 / span 2; min-width: 0; display: grid; grid-template-rows: 56px minmax(0,1fr); }
.file-topbar {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(220px, 360px) minmax(360px, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: #ffffff;
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.icon-btn { background: #fff; color: #4b5563; border-color: var(--line); min-height: 32px; }
.crumb { background: transparent; color: #4b5563; padding: 4px 5px; min-height: 28px; }
.crumb:hover { background: var(--hover); }
.crumb.current { color: var(--ink); font-weight: 800; }
.slash { color: #9ca3af; }
.folder-search { min-height: 36px; }
.file-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}
.admin-context-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.file-toolbar button {
  min-height: 32px;
  padding: 5px 9px;
  white-space: nowrap;
}
.toolbar-divider { width: 1px; min-width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.primary-action { background: var(--purple); }
.file-workarea { min-height: 0; overflow: auto; background: #fff; }
.table-title { padding: 18px 18px 8px; }
.table-title h1 { margin: 0; font: 600 20px/1.2 Inter, sans-serif; }
.table-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.search-title { display: grid; gap: 8px; }
.search-control-panel {
  margin: 0 18px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}
.filter-grid label { min-width: 0; font-size: 12px; font-weight: 700; color: #334155; }
.filter-grid input,
.filter-grid select { min-height: 34px; font-size: 13px; }
.filter-actions { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.saved-search-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.saved-search-chip {
  background: #eef6ff;
  color: #0f5f8d;
  border-color: #bfdbfe;
  min-height: 30px;
  padding: 5px 10px;
}
.search-results-table .file-name { align-items: flex-start; }
.search-snippet {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
}
.search-facets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: #526173;
  font-size: 12px;
}
.search-facets section {
  min-width: 0;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
.search-facets strong { color: #334155; }
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #4b5563;
  font-size: 12px;
  text-align: left;
  font-weight: 750;
  padding: 9px 10px;
}
.file-table td { border-bottom: 1px solid #eef0f2; padding: 6px 10px; height: 42px; color: #2f3742; }
.file-table th:first-child, .file-table td:first-child { width: 38px; }
.file-table th:nth-child(2), .file-table td:nth-child(2) { width: 34%; }
.file-table th:nth-child(3), .file-table td:nth-child(3) { width: 22%; }
.file-table th:nth-child(4), .file-table td:nth-child(4) { width: 95px; }
.file-table th:nth-child(5), .file-table td:nth-child(5) { width: 170px; }
.file-table th:last-child, .file-table td:last-child { width: 42px; text-align: center; }
.file-row { cursor: pointer; }
.file-row:hover { background: var(--hover); }
.file-row.selected { background: var(--selected); }
.check-cell input { width: auto; min-height: auto; }
.file-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.file-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.folder-icon {
  width: 24px;
  height: 18px;
  display: inline-block;
  position: relative;
  border-radius: 3px 4px 4px 4px;
  background: linear-gradient(180deg, #f8c849, #f2a81d);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}
.folder-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -5px;
  width: 11px;
  height: 7px;
  border-radius: 3px 3px 0 0;
  background: #f8c849;
}
.tree-branch {
  width: 20px;
  height: 1px;
  display: inline-block;
  background: #cbd5e1;
}
.doc-icon {
  width: 30px;
  min-width: 30px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #075985;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .02em;
}
.row-menu { color: #6b7280; font-size: 14px; letter-spacing: 1px; }
.status-pill, .role-pill, .tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
}
.status-pill.ok { color: #166534; background: #dcfce7; }
.status-pill.locked { color: #92400e; background: #fef3c7; }
.tag { color: #075985; background: #e0f2fe; margin-right: 3px; }
.empty { margin: 18px; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 28px; text-align: center; color: var(--muted); background: #fbfdff; }
.error-banner { margin: 14px 18px 0; border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; border-radius: 7px; padding: 10px 12px; }

.file-inspector {
  grid-column: 3;
  grid-row: 2 / span 2;
  border-left: 1px solid var(--line);
  background: #fbfdff;
  overflow: auto;
}
.inspector-head { position: relative; padding: 24px 18px 16px; text-align: center; border-bottom: 1px solid var(--line); background: #fff; }
.close-inspector { position: absolute; right: 12px; top: 10px; background: transparent; color: #6b7280; font-size: 22px; padding: 0 8px; }
.preview-icon { width: 112px; height: 112px; margin: 12px auto; border-radius: 12px; background: #eef6ff; display: grid; place-items: center; color: #075985; font-size: 22px; font-weight: 850; letter-spacing: .03em; }
.folder-preview::before {
  content: "";
  width: 68px;
  height: 48px;
  display: block;
  position: relative;
  border-radius: 7px;
  background: linear-gradient(180deg, #f8c849, #f2a81d);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.inspector-head h2 { margin: 6px 0 4px; font-size: 18px; word-break: break-word; }
.inspector-head p { margin: 0 0 8px; color: var(--muted); }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 0; background: #fff; border-bottom: 1px solid var(--line); }
.detail-tabs button { border-radius: 0; background: #fff; color: #4b5563; border: 0; border-bottom: 3px solid transparent; }
.detail-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.detail-body { padding: 16px; }
.action-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 18px; }
.metadata-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: 12px; }
.metadata-list dt { color: var(--muted); font-weight: 700; }
.metadata-list dd { margin: 0; word-break: break-word; }
.stack { display: grid; gap: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-size: 13px; }
.inline-check input { width: auto; min-height: auto; }
.version-row { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; }
.version-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.small { min-height: 29px; padding: 4px 8px; font-size: 12px; }

.admin-top-tabs { display: flex; gap: 8px; padding: 16px 18px 0; border-bottom: 1px solid var(--line); background: #fff; }
.admin-top-tabs button { background: #fff; color: #374151; border-color: var(--line); border-radius: 7px 7px 0 0; }
.admin-top-tabs button.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.admin-page {
  min-width: 0;
  min-height: 100%;
  overflow: auto;
  background: #f8fafc;
}
.admin-tabs { display: flex; gap: 8px; padding: 16px 18px 0; }
.admin-tabs button { background: #fff; color: #374151; border-color: var(--line); border-radius: 7px 7px 0 0; }
.admin-tabs button.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.admin-card { margin: 14px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }
.admin-split { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(320px, 420px); gap: 0; align-items: start; }
.admin-split .admin-card { margin-right: 0; }
.admin-detail { margin: 14px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 14px; align-self: start; min-width: 0; overflow: hidden; }
.admin-task-flow .admin-card { min-width: 0; }
.admin-drawer {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}
.drawer-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.drawer-heading h2 { margin: 2px 0 3px; }
.drawer-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.create-panel {
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.create-panel summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 800;
  color: #1f2937;
}
.admin-form.compact {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  border-bottom: 0;
  padding-top: 0;
}
.admin-detail h2 { margin: 0 0 10px; font-size: 17px; }
.admin-detail h3 { margin: 14px 0 7px; font-size: 12px; color: #4b5563; text-transform: uppercase; letter-spacing: .05em; }
.detail-section { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfdff; margin-bottom: 10px; }
.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.card-title-row h2 { padding-left: 0; border-bottom: 0; }
.json-detail summary { cursor: pointer; color: #0f72a8; font-weight: 700; }
.json-detail pre {
  max-width: 520px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
}
.section-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-title-row h3 { margin: 0; }
.detail-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.detail-form input, .detail-form select { min-width: 0; }
.detail-primary { justify-self: start; }
.check-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.admin-danger-row { display: flex; gap: 8px; margin: 8px 0 14px; flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.check-row input { width: auto; min-height: auto; }
.reset-password-form { border: 1px solid #fed7aa; background: #fff7ed; border-radius: 8px; padding: 12px; overflow: hidden; }
.reset-password-form input { min-width: 0; }
.reset-password-form button { justify-self: start; }
.admin-card h2 { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.pad-note { margin: 12px 16px; }
.audit-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.connection-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-table small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; word-break: break-all; }
.storage-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.storage-health-grid.compact-metrics { padding: 10px 0 0; border-bottom: 0; }
.card-subsection { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-subsection h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #475569; }
.access-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 14px 14px; }
.metric-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdff; display: grid; gap: 4px; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.metric-card strong { color: var(--ink); font-size: 22px; line-height: 1.1; }
.metric-card small { color: var(--muted); font-size: 12px; }
.metric-card.ok { border-color: #bbf7d0; background: #f0fdf4; }
.metric-card.warn { border-color: #fed7aa; background: #fff7ed; }
.warning-box { margin: 14px 16px; border: 1px solid #fed7aa; background: #fff7ed; border-radius: 8px; padding: 12px; color: #7c2d12; }
.warning-box ul { margin: 8px 0 0; padding-left: 18px; }
.admin-form { display: grid; grid-template-columns: minmax(160px, 260px) auto; gap: 10px; align-items: end; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.admin-form.two { grid-template-columns: minmax(160px,240px) minmax(160px,240px) auto; }
.admin-form.three { grid-template-columns: minmax(150px,220px) minmax(150px,220px) minmax(140px,200px) auto; }
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th, .settings-table td { border-bottom: 1px solid #eef0f2; text-align: left; padding: 8px 10px; vertical-align: top; }
.settings-table th { background: #fbfdff; color: #4b5563; font-size: 12px; }
.selectable-row { cursor: pointer; }
.selectable-row:hover { background: var(--hover); }
.selectable-row.selected { background: var(--selected); }
.permission-list { border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.permission-list h3 { margin: 0; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: #4b5563; text-transform: uppercase; letter-spacing: .06em; }
.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #eef0f2; }
.permission-row:last-child { border-bottom: 0; }
.permission-row strong { color: #075985; text-transform: capitalize; }
.permission-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.permission-preview {
  margin: 0;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  background: #f0f9ff;
  color: #075985;
  padding: 9px 10px;
  font-size: 12px;
}
.capability-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
.capability-grid legend { color: #4b5563; font-weight: 800; font-size: 12px; padding: 0 4px; }
.capability-grid label { font-weight: 600; font-size: 12px; color: #475569; text-transform: capitalize; }
.preview-text {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
  color: #263241;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
}
.member-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: pre-wrap; }

@media (max-width: 1420px) {
  .file-topbar { grid-template-columns: minmax(220px, .8fr) minmax(220px, 320px) minmax(300px, 1.4fr); }
  .file-toolbar button,
  .top-nav-item { font-size: 13px; }
  .admin-split { grid-template-columns: 1fr; }
  .admin-card,
  .admin-detail { margin: 14px; }
  .admin-split .admin-card { margin-right: 14px; }
  .admin-detail { margin-top: 0; }
}
@media (max-width: 1180px) {
  .file-shell { grid-template-columns: 235px minmax(0, 1fr); }
  .file-shell.has-inspector { grid-template-columns: 235px minmax(0, 1fr); }
  .file-inspector { grid-column: 1 / -1; grid-row: auto; max-height: 46vh; border-left: 0; border-top: 1px solid var(--line); }
  .top-brand { min-width: 150px; }
  .top-brand img { width: 96px; }
  .top-brand span { font-size: 16px; }
}
@media (max-width: 980px), (max-height: 680px) {
  .auth-shell { place-items: start center; padding: 18px; }
  .auth-card { width: min(100%, 720px); grid-template-columns: 1fr; gap: 14px; padding: 16px; border-radius: 22px; }
  .login-intro { min-height: auto; padding: 18px; }
  .login-logo { width: min(210px, 58vw); }
  .auth-form { min-width: 0; min-height: auto; width: 100%; }
  .file-shell { height: auto; min-height: 100vh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; }
  .global-commandbar { position: sticky; top: 0; grid-template-columns: 1fr; gap: 8px; }
  .top-brand { min-width: 0; }
  .top-user { justify-content: space-between; }
  .folder-tree { grid-column: 1; grid-row: 2; border-right: 0; border-bottom: 1px solid var(--line); max-height: 230px; }
  .file-main { grid-column: 1; grid-row: 3; display: block; }
  .file-inspector { grid-column: 1; grid-row: 4; }
  .file-topbar { grid-template-columns: 1fr; height: auto; }
  .file-table { min-width: 640px; }
  .file-workarea { overflow: auto; }
  .admin-form, .admin-form.two, .admin-form.three { grid-template-columns: 1fr; }
  .admin-form.compact,
  .filter-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .admin-split { grid-template-columns: 1fr; }
  .admin-drawer { position: static; max-height: none; }
  .split { grid-template-columns: 1fr; }
  .settings-table { min-width: 620px; font-size: 13px; }
  .access-summary-grid,
  .storage-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-card { overflow-x: auto; }
}
@media (max-width: 560px) {
  .auth-shell { min-height: 100svh; padding: 12px; }
  .auth-card { width: 100%; max-width: 100%; padding: 12px; border-radius: 18px; }
  .login-intro { padding: 16px 12px; border-radius: 16px; }
  .login-logo { width: min(190px, 78vw); margin-bottom: 10px; }
  .login-intro h1 { font-size: clamp(26px, 9vw, 34px); }
  .login-intro p { font-size: 13px; }
  .auth-form { padding: 16px; border-radius: 16px; }
  .global-commandbar { padding: 8px 10px; }
  .top-brand img { width: 86px; }
  .top-brand span { font-size: 15px; }
  .top-nav { gap: 4px; }
  .top-nav-item {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }
  .top-user .role-pill { max-width: 190px; }
  .file-topbar { padding: 8px 10px; gap: 8px; }
  .folder-tree {
    max-height: 220px;
    padding: 8px;
  }
  .tree-section h2 {
    font-size: 11px;
    margin: 7px 0 5px;
  }
  .tree-row {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 13px;
  }
  .crumbs { gap: 4px; }
  .icon-btn, .crumb { min-height: 28px; padding: 4px 7px; font-size: 12px; }
  .folder-search { min-height: 32px; font-size: 13px; }
  .file-toolbar { gap: 4px; }
  .file-toolbar button { min-height: 30px; padding: 5px 8px; font-size: 12px; }
  .table-title { padding: 12px 12px 4px; }
  .table-title h1 { font-size: 17px; }
  .table-title p { font-size: 12px; margin-top: 2px; }
  .file-table {
    min-width: 0;
    table-layout: auto;
    font-size: 13px;
  }
  .file-table thead { display: none; }
  .file-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    min-height: 42px;
    border-bottom: 1px solid #eef0f2;
  }
  .file-table td {
    display: block;
    height: auto;
    border: 0;
    padding: 6px 10px;
  }
  .file-table td:first-child,
  .file-table td:nth-child(4),
  .file-table td:nth-child(5),
  .file-table td:nth-child(6),
  .file-table td:last-child {
    display: none;
  }
  .file-table td:nth-child(2) {
    width: auto;
    min-width: 0;
    padding-right: 0;
  }
  .file-table td:nth-child(3) {
    width: auto;
    justify-self: end;
    padding-left: 0;
  }
  .search-results-table td:first-child {
    display: block;
    padding-right: 0;
  }
  .search-results-table td:nth-child(2) {
    justify-self: end;
    padding-left: 0;
  }
  .search-results-table td:nth-child(3),
  .search-results-table td:nth-child(4),
  .search-results-table td:nth-child(5),
  .search-results-table td:last-child {
    display: none;
  }
  .file-name { gap: 8px; }
  .folder-icon {
    width: 20px;
    height: 15px;
    border-radius: 3px;
  }
  .folder-icon::before {
    top: -4px;
    width: 9px;
    height: 6px;
  }
  .doc-icon {
    width: 25px;
    min-width: 25px;
    height: 21px;
    border-radius: 4px;
    font-size: 8px;
  }
  .status-pill, .role-pill, .tag {
    padding: 2px 6px;
    font-size: 10px;
    max-width: 112px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .empty { margin: 12px; padding: 18px; }
  .file-inspector {
    max-height: 42vh;
  }
  .inspector-head {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 10px;
    text-align: left;
    align-items: center;
    padding: 12px 42px 10px 12px;
  }
  .preview-icon {
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: 8px;
    font-size: 10px;
  }
  .folder-preview::before {
    width: 28px;
    height: 20px;
    border-radius: 4px;
  }
  .inspector-head h2 {
    grid-column: 2;
    margin: 0;
    font-size: 15px;
  }
  .inspector-head p {
    grid-column: 2;
    font-size: 12px;
    margin: 2px 0 4px;
  }
  .inspector-head .status-pill {
    grid-column: 2;
    justify-self: start;
  }
  .detail-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .detail-tabs button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
    white-space: nowrap;
  }
  .detail-body { padding: 12px; }
  .action-grid { gap: 6px; margin-bottom: 12px; }
  .metadata-list { grid-template-columns: 88px 1fr; font-size: 11px; }
  .version-row { padding: 8px; }
  .admin-tabs {
    padding: 8px 10px 0;
    gap: 4px;
    scrollbar-width: thin;
  }
  .admin-tabs button {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }
  .admin-card,
  .admin-detail {
    margin: 8px;
    border-radius: 8px;
  }
  .admin-card h2 {
    padding: 10px 12px;
    font-size: 14px;
  }
  .admin-form {
    padding: 10px;
    gap: 8px;
  }
  .admin-form.compact,
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .search-control-panel {
    margin: 0 8px 8px;
    padding: 10px;
  }
  .card-title-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 10px;
  }
  .card-title-row h2 { padding: 0; }
  .admin-detail {
    padding: 10px;
  }
  .admin-detail h2 {
    font-size: 16px;
  }
  .access-summary-grid,
  .storage-health-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 8px;
  }
  .metric-card {
    padding: 10px;
  }
  .metric-card strong {
    font-size: 18px;
  }
  .detail-section,
  .reset-password-form {
    padding: 8px;
  }
  .settings-table {
    min-width: 520px;
    font-size: 12px;
  }
  .settings-table th,
  .settings-table td {
    padding: 7px 8px;
  }
  .settings-table input,
  .settings-table select,
  .settings-table button {
    min-height: 30px;
    font-size: 12px;
  }
  .connection-actions {
    flex-wrap: nowrap;
  }
}
@media (max-height: 560px) and (max-width: 980px) {
  .auth-shell { padding: 12px; }
  .auth-card { grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr); width: min(100%, 900px); }
  .login-intro { min-height: 220px; }
}
