@font-face {
  font-family: "TOPTI Humanist";
  src: url("topti-humanist.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #eceff1;
  --panel: #ffffff;
  --panel-soft: #f4f5f6;
  --text: #30383f;
  --muted: #6e767d;
  --line: #d9dde0;
  --brand: #0065a8;
  --brand-dark: #004e8f;
  --brand-soft: #e7f2f8;
  --accent: #fe8100;
  --accent-soft: #fff1e2;
  --sidebar: #555b60;
  --sidebar-dark: #454a4e;
  --danger: #b23b32;
  --shadow: 0 12px 34px rgba(48, 56, 63, .12);
  font-family: "TOPTI Humanist", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; min-height: 100%; }
body {
  background: linear-gradient(135deg, #f5f6f7 0%, var(--bg) 100%);
  color: var(--text);
  font: 16px/1.45 "TOPTI Humanist", "Segoe UI", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(254, 129, 0, .34);
  outline-offset: 2px;
}
.hidden { display: none !important; }

#ged-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(170px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 10px clamp(14px, 2.4vw, 30px);
  background: rgba(255, 255, 255, .98);
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 4px 18px rgba(48, 56, 63, .12);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brand-logo { display: block; width: min(182px, 100%); height: 43px; object-fit: contain; object-position: left center; }
.brand-product {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: .08em;
}
.environment-name { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.environment-name strong { overflow: hidden; color: var(--brand-dark); font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.environment-name small { color: var(--muted); }
.topbar-actions, .toolbar-actions, .preview-toolbar { display: flex; align-items: center; gap: 8px; }
.topbar-actions { justify-content: flex-end; }
.ged-help-link {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  text-decoration: none;
  font-weight: 850;
}
.ged-help-link:hover, .ged-help-link:focus-visible { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); outline: none; }

.access-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--brand-dark);
  background: var(--panel);
  font-weight: 750;
}
.access-mode:hover { border-color: var(--accent); }
.access-mode .mode-dot { width: 9px; height: 9px; border-radius: 50%; background: #7d858c; box-shadow: 0 0 0 4px #edf0f2; }
.access-mode.editing { color: #176d54; border-color: #94d5c0; background: #edf9f5; }
.access-mode.editing .mode-dot { background: #1fa077; box-shadow: 0 0 0 4px #d7f2e9; }

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  padding: 12px clamp(10px, 1.5vw, 20px) 16px;
  overflow: hidden;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .8fr) repeat(2, minmax(126px, .6fr)) auto;
  gap: 8px;
  align-items: center;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd1d5;
  border-radius: 9px;
  background: var(--panel);
}
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-field span { color: var(--brand); font-size: 20px; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.toolbar select {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #cbd1d5;
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover:not(:disabled) { border-color: var(--accent); color: #fff; background: var(--accent); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.secondary { color: var(--brand-dark); border-color: #cbd9e2; background: var(--panel); }
.button.ghost { color: var(--brand-dark); border-color: transparent; background: transparent; }
.button.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 13px; }

.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid #9ecfbe;
  border-left: 4px solid #24956f;
  border-radius: 9px;
  background: #edf9f5;
}
.batch-bar strong { margin-right: auto; color: #176d54; }

.explorer {
  display: grid;
  grid-template-columns: minmax(210px, .68fr) minmax(420px, 1.35fr) minmax(340px, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.panel {
  display: flex;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-top: 4px solid var(--brand);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.panel-header h2 { margin: 0; overflow: hidden; color: var(--brand-dark); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.panel-header small { color: var(--muted); font-size: 11px; text-align: right; }
.eyebrow { margin: 0 0 2px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.tree-panel { background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-dark) 100%); }
.tree-panel .panel-header { color: #fff; border-top-color: var(--accent); border-bottom-color: rgba(255,255,255,.12); background: rgba(0,0,0,.08); }
.tree-panel .panel-header h2 { color: #fff; }
.tree-panel .panel-header small { color: #d2d6d9; }

.tree-scroll, .list-scroll, .preview-content { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.tree-scroll { flex: 1; padding: 10px 8px 18px; color: #f5f6f7; }
.tree-repository { margin-bottom: 8px; }
.tree-node {
  display: flex;
  width: 100%;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  margin: 1px 0;
  padding: 6px 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: #f5f6f7;
  background: transparent;
  text-align: left;
}
.tree-node:hover { background: rgba(255,255,255,.1); }
.tree-node.active { border-left-color: var(--accent); background: var(--brand); }
.tree-node.drop-target { color: #fff; outline: 2px dashed var(--accent); background: rgba(254,129,0,.23); }
.tree-node .tree-arrow { width: 14px; flex: none; color: #c5cbd0; font-size: 11px; }
.tree-node .tree-icon { flex: none; color: #ffad59; }
.tree-node .tree-label { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.tree-node.repository { font-weight: 800; }
.tree-node.repository.unavailable {
  border-left-color: #ff6b6b;
  color: #ffd9d9;
  background: rgba(176, 36, 36, .22);
  cursor: not-allowed;
  opacity: 1;
}
.tree-node.repository.unavailable .tree-icon { color: #ff7777; }
.tree-node.repository.degraded { border-left-color: #ffb347; color: #ffe3bd; }
.tree-repository-status {
  display: block;
  margin: 3px 9px 9px 34px;
  line-height: 1.35;
}
.tree-repository-status.unavailable { color: #ff9b9b; }
.tree-repository-status.degraded { color: #ffc879; }
option.repository-unavailable { color: #b42318; background: #fff1f0; }
option.repository-degraded { color: #8a4b00; background: #fff7e6; }
.tree-children { margin-left: 15px; padding-left: 5px; border-left: 1px solid rgba(255,255,255,.14); }
.drop-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: #e5e8ea;
  background: rgba(0,0,0,.12);
  font-size: 11px;
}
.drop-hint span { color: #ffad59; font-size: 18px; }

.list-header { min-height: 65px; }
.folder-heading { min-width: 0; }
.breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 4px; overflow: hidden; }
.breadcrumbs button {
  overflow: hidden;
  max-width: 190px;
  padding: 2px 4px;
  border: 0;
  cursor: pointer;
  color: var(--brand);
  background: transparent;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs button:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb-separator { color: #9ba2a7; }
.mobile-parent { display: none; width: 38px; flex: none; padding: 0; }
.status { min-height: 36px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status.error { color: var(--danger); background: #fff0ef; }
.list-scroll { position: relative; flex: 1; background: var(--panel); }
.list-scroll.drop-target::after {
  position: absolute;
  inset: 8px;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 3px dashed var(--accent);
  border-radius: 10px;
  color: #9a5000;
  background: rgba(255,241,226,.9);
  content: "Solte para enviar à pasta atual";
  font-size: 18px;
  font-weight: 800;
  pointer-events: none;
}
.table-wrap { min-width: 690px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 11px; border-bottom: 1px solid #e7eaec; text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; color: #fff; background: var(--brand); font-size: 11px; letter-spacing: .045em; text-transform: uppercase; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sort-indicator { font-size: 11px; opacity: .65; }
th[aria-sort="ascending"] .sort-indicator, th[aria-sort="descending"] .sort-indicator { opacity: 1; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #f1f6f9; }
tbody tr.selected td { background: var(--accent-soft); }
tbody tr.dragging { opacity: .55; }
.check-column { width: 40px; }
.file-name { display: flex; min-width: 0; align-items: center; gap: 9px; }
.file-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 850;
}
.file-icon.folder { color: #a65300; background: var(--accent-soft); font-size: 18px; }
.file-meta { display: flex; min-width: 0; flex-direction: column; }
.file-meta strong, .file-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta strong { max-width: 330px; color: var(--text); }
.file-meta small, .subtle { color: var(--muted); font-size: 11px; }
.info-cell {
  position: relative;
  max-width: 210px;
  color: var(--muted);
  font-size: 12px;
}
.info-content {
  display: flex;
  align-items: center;
  gap: 7px;
}
.summary-info {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border: 1px solid #b9cedb;
  border-radius: 50%;
  cursor: help;
  color: var(--brand);
  background: var(--brand-soft);
  font: 800 12px/1 Georgia, serif;
}
.summary-info::after {
  content: attr(data-summary);
  position: absolute;
  z-index: 500;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(360px, 76vw);
  padding: 9px 11px;
  border-radius: 8px;
  color: #fff;
  background: var(--sidebar-dark);
  box-shadow: var(--shadow);
  font: 12px/1.4 "TOPTI Humanist", "Segoe UI", sans-serif;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity .14s, transform .14s;
}
.summary-info:hover::after,
.summary-info:focus-visible::after,
.summary-info.open::after { opacity: 1; transform: translate(-50%, 0); }
.deletion-lock { font-size: 13px; cursor: help; }
.pagination { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 12px; }
.mobile-list { display: none; }

.preview-panel { position: relative; }
.preview-header { min-height: 65px; }
.preview-title-wrap { min-width: 0; flex: 1; }
.preview-navigation { display: none; flex: none; align-items: center; gap: 6px; }
.preview-panel.expanded .preview-navigation { display: flex; }
.preview-title-wrap h2, .preview-title-wrap small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-title-wrap small { color: var(--muted); font-size: 11px; }
.icon-button, .mobile-preview-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--brand-dark);
  background: var(--panel);
  font-size: 17px;
}
.icon-button:hover, .mobile-preview-close:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.mobile-preview-close { display: none; }
.preview-toolbar {
  min-height: 47px;
  flex-wrap: wrap;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}
.preview-toolbar .editor-state { margin-left: auto; }
.editor-state { padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.editor-state.clean { color: #52606a; background: #e7ebee; }
.editor-state.dirty { color: #975000; background: #ffe7ca; }
.editor-state.updated { color: #176d54; background: #dff5ed; }
.editor-state.error { color: var(--danger); background: #fce3e1; }
.editor-state.busy { color: var(--brand-dark); background: var(--brand-soft); }

.preview-content { position: relative; display: flex; flex: 1; align-items: stretch; justify-content: stretch; background: #f7f8f9; }
.preview-empty {
  display: grid;
  width: min(310px, 86%);
  margin: auto;
  place-items: center;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}
.preview-empty-icon { color: #aeb5ba; font-size: 52px; line-height: 1; }
.preview-empty strong { margin-top: 8px; color: var(--brand-dark); font-size: 17px; }
.preview-empty p { margin: 7px 0 0; font-size: 13px; }
.preview-unsupported { gap: 5px; }
.preview-unsupported .preview-empty-icon {
  display: grid;
  min-width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid #cbd9e2;
  border-radius: 14px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 20px;
  font-weight: 800;
}
.preview-unsupported .button { margin-top: 15px; text-decoration: none; }
.preview-unsupported .button + .button { margin-top: 3px; }
.preview-loading { margin: auto; color: var(--muted); font-weight: 700; }
.preview-image { display: block; max-width: 100%; max-height: 100%; margin: auto; padding: 12px; object-fit: contain; }
.preview-text {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 17px;
  overflow: auto;
  color: #e8edf1;
  background: #343a40;
  font: 13px/1.55 Consolas, "Cascadia Code", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-csv { width: 100%; height: 100%; overflow: auto; background: white; }
.preview-csv table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.preview-csv caption { padding: 10px 14px; color: var(--muted); text-align: left; font-weight: 700; }
.preview-csv th,
.preview-csv td { max-width: 420px; padding: 8px 10px; overflow: hidden; border-right: 1px solid #dfe5e9; border-bottom: 1px solid #dfe5e9; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.preview-csv th { position: sticky; top: 0; z-index: 1; color: var(--brand-dark); background: #eef5f9; font-weight: 800; }
.preview-csv tbody tr:nth-child(even) td { background: #f8fafb; }
.preview-csv-limit { margin: 12px 14px; color: var(--muted); font-size: 12px; }
.preview-frame { width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }
.component-viewer, .component-editor { width: 100%; min-height: 100%; padding: 0; background: #fff; }
.component-viewer { overflow: auto; padding: 20px; }
.component-viewer .toastui-editor-contents { font-family: "TOPTI Humanist", "Segoe UI", sans-serif; }
.ged-help-dialog { width: min(1040px, 96vw); height: min(88vh, 920px); }
.ged-help-content { flex: 1; min-height: 0; overflow: auto; padding: 24px clamp(18px, 4vw, 48px); }
.ged-help-content > .preview-loading { display: grid; min-height: 220px; place-items: center; }
.component-editor > .toastui-editor-defaultUI { height: 100% !important; border: 0; }
.component-editor .tb-code-editor { min-height: 100%; }
.component-editor .jodit-container { min-height: 100%; border: 0 !important; }
.preview-meta { min-height: 33px; padding: 7px 10px; border-top: 1px solid var(--line); color: var(--muted); background: var(--panel-soft); font-size: 11px; }
.preview-panel.expanded {
  position: fixed;
  inset: 12px;
  z-index: 100;
  border-color: #b8c3ca;
  box-shadow: 0 24px 80px rgba(31,38,44,.34), 0 0 0 100vmax rgba(31,38,44,.60);
}
body.preview-modal-open { overflow: hidden; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 15px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--sidebar-dark);
  box-shadow: var(--shadow);
}

body.editor-open { overflow: hidden; }
.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31,38,44,.66);
  backdrop-filter: blur(4px);
}
.editor-dialog {
  display: flex;
  width: min(920px, 96vw);
  max-height: 92vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 13px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(31,38,44,.35);
}
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line); }
.editor-header h2 { margin: 0; color: var(--brand-dark); }
.editor-header small { color: var(--muted); }
.preview-close-button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; cursor: pointer; color: var(--brand-dark); background: var(--brand-soft); font-size: 24px; }
.repository-config-dialog { width: min(1080px, 96vw); height: min(92vh, 860px); }
.repository-config-content {
  min-height: 0;
  flex: 1;
  resize: none;
  padding: 16px;
  border: 0;
  outline: 0;
  color: #e9eef2;
  background: #20272d;
  font: 13px/1.55 Consolas, "Courier New", monospace;
  tab-size: 2;
}
.repository-config-content:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.ftp-form { display: grid; grid-template-columns: 1fr 130px; gap: 13px 15px; padding: 18px; overflow: auto; }
.ftp-form label { display: flex; flex-direction: column; gap: 5px; color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.ftp-form input[type=text], .ftp-form input[type=number] { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.ftp-wide { grid-column: 1 / -1; }
.ftp-options { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 12px; border: 1px solid #cddfe9; border-radius: 8px; background: var(--brand-soft); }
.ftp-options label { flex-direction: row; align-items: center; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); background: var(--panel-soft); }

.pdf-sign-dialog { width: min(1120px, 96vw); height: min(94vh, 940px); }
.pdf-sign-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow: auto;
  padding: 12px;
  background: #343a40;
}
.pdf-sign-navigation {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 7px;
  border-radius: 9px;
  color: var(--brand-dark);
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 18px rgba(0,0,0,.18);
}
.pdf-sign-navigation strong { min-width: 115px; text-align: center; }
.pdf-sign-stage {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  margin: auto;
  line-height: 0;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
}
.pdf-sign-page {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(94vh - 250px);
  object-fit: contain;
}
.pdf-sign-stamp {
  position: absolute;
  z-index: 2;
  min-width: 84px;
  max-width: 45%;
  height: auto;
  padding: 4px;
  border: 2px dashed var(--accent);
  border-radius: 5px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background: rgba(255,255,255,.88);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.28));
}
.pdf-sign-stamp.dragging { cursor: grabbing; border-style: solid; }
.pdf-sign-help {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #fff;
  background: rgba(0,78,143,.78);
  text-align: center;
  font-size: 12px;
}

.environment-page {
  position: relative;
  max-width: 1140px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 20px;
}
.environment-page::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: 6px;
  background: linear-gradient(90deg, var(--brand-dark) 0 72%, var(--accent) 72% 100%);
}
.portal-brand {
  display: flex;
  width: max-content;
  max-width: min(360px, 92vw);
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  padding: 13px 17px;
  border: 1px solid #d5e0e7;
  border-left: 5px solid var(--brand);
  border-radius: 11px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 9px 26px rgba(0, 78, 143, .10);
  text-decoration: none;
}
.environment-page > .ged-help-link.floating { position: absolute; top: clamp(34px, 6vw, 72px); right: 20px; z-index: 11; }
.portal-brand img { width: min(215px, 62vw); max-height: 58px; object-fit: contain; object-position: left; }
.portal-brand span { padding-left: 13px; border-left: 2px solid var(--accent); font-size: 22px; font-weight: 800; letter-spacing: .08em; }
.hero {
  position: relative;
  max-width: 790px;
  padding: 7px 0 9px 24px;
  border-left: 6px solid var(--accent);
}
.hero::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: -17px;
  width: min(420px, 75vw);
  height: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
}
.hero .eyebrow { color: var(--brand); }
.hero h1 { margin: .2em 0; color: var(--brand-dark); font-size: clamp(34px, 6vw, 58px); line-height: 1.04; }
.hero p { color: var(--muted); font-size: 18px; }
.environment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 50px; }
.environment-card {
  display: grid;
  grid-template: auto auto / 52px 1fr;
  gap: 2px 14px;
  align-items: center;
  padding: 21px;
  border: 1px solid #d5e0e7;
  border-top: 4px solid var(--brand);
  border-radius: 12px;
  color: var(--text);
  background: linear-gradient(115deg, #fff 0%, #fff 78%, var(--brand-soft) 100%);
  box-shadow: 0 12px 34px rgba(0, 78, 143, .10);
  text-decoration: none;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.environment-card:hover { transform: translateY(-3px); border-top-color: var(--accent); box-shadow: 0 18px 40px rgba(0, 78, 143, .16); }
.environment-icon { grid-row: 1 / 3; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); box-shadow: inset 0 -3px 0 var(--accent); font-size: 22px; }
.environment-card strong { color: var(--brand-dark); }
.environment-card small { color: var(--muted); }

@media (max-width: 1280px) {
  .toolbar { grid-template-columns: minmax(210px, 1.3fr) minmax(145px, .8fr) repeat(2, minmax(112px, .55fr)); }
  .toolbar-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .explorer { grid-template-columns: minmax(190px, .58fr) minmax(390px, 1.2fr) minmax(315px, .9fr); }
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: minmax(150px, 210px) minmax(130px, 1fr) auto; min-height: 66px; padding: 8px 12px; gap: 10px; }
  .brand-logo { height: 36px; width: 145px; }
  .brand-product { font-size: 16px; }
  .environment-name strong { font-size: 15px; }
  .environment-name small { font-size: 11px; }
  .topbar-actions .button { display: none; }
  .access-mode { min-height: 36px; padding: 6px 9px; font-size: 12px; }
  .workspace { padding: 9px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) minmax(140px, .55fr); overflow: visible; }
  .toolbar > select { display: none; }
  .toolbar #repository-filter { display: block; }
  .toolbar-actions { grid-column: 1 / -1; justify-content: stretch; overflow-x: auto; }
  .toolbar-actions .button { flex: 1; }
  .explorer { display: block; min-height: 0; }
  .tree-panel { display: none; }
  .list-panel { height: 100%; }
  .table-wrap { display: none; }
  .mobile-list { display: block; }
  .mobile-parent { display: inline-flex; }
  .file-card { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 62px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
  .file-card:hover, .file-card.selected { background: var(--accent-soft); }
  .file-card .card-details { min-width: 0; }
  .file-card .card-details strong, .file-card .card-details small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-card .card-details small { color: var(--muted); font-size: 11px; }
  .file-card .card-actions { display: flex; align-items: center; gap: 7px; }
  .file-card .card-check { width: 20px; }
  .preview-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    border: 0;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .22s ease;
  }
  .preview-panel.mobile-open { transform: translateX(0); }
  .preview-panel.expanded { inset: 0; border: 0; border-radius: 0; }
  .preview-panel.mobile-open .preview-navigation { display: flex; order: 4; width: 100%; justify-content: center; }
  .mobile-preview-close { display: grid; }
  .preview-header { flex-wrap: wrap; border-radius: 0; }
  .preview-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .preview-toolbar .editor-state { margin-left: 0; }
  .batch-bar { overflow-x: auto; }
}

@media (max-width: 560px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .brand { min-width: 0; }
  .brand-logo { width: 125px; }
  .brand-product { font-size: 14px; }
  .environment-name { display: none; }
  .access-mode span:last-child { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace { gap: 7px; padding: 7px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 112px; gap: 6px; }
  .search-field, .toolbar select { height: 39px; }
  .toolbar-actions .button { min-width: 116px; padding: 7px 9px; font-size: 12px; }
  .panel-header { min-height: 57px; padding: 9px 10px; }
  .status { min-height: 32px; padding: 7px 10px; }
  .pagination { min-height: 43px; }
  .preview-toolbar .button { min-width: max-content; }
  .editor-overlay { padding: 0; }
  .editor-dialog { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .ftp-form { grid-template-columns: 1fr; padding: 13px; }
  .ftp-wide { grid-column: auto; }
  .ftp-options { flex-direction: column; align-items: flex-start; }
  .pdf-sign-dialog { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .pdf-sign-body { padding: 7px; }
  .pdf-sign-navigation { justify-content: space-between; gap: 5px; }
  .pdf-sign-navigation .button { min-width: 0; padding: 7px 8px; font-size: 11px; }
  .pdf-sign-navigation strong { min-width: 86px; font-size: 12px; }
  .pdf-sign-page { max-height: calc(100vh - 235px); }
  .pdf-sign-stamp { min-width: 64px; }
}

.logged-user {
  display: grid;
  min-width: 170px;
  padding: 6px 12px;
  border-left: 1px solid var(--border, #d8e2ea);
  line-height: 1.2;
}
.logged-user span { color: #718092; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
.logged-user strong { color: #172033; font-size: .85rem; margin-top: 2px; }
.logged-user small { color: #536477; font-size: .75rem; margin-top: 2px; }
@media (max-width: 860px) {
  .logged-user { min-width: 0; border-left: 0; padding: 4px 6px; }
  .logged-user span, .logged-user small { display: none; }
