/* Finestra Documenti — explorer locale anti-cloud */

.docs-panel {
  padding: 24px;
  color: var(--text-1);
}

.docs-panel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  min-height: 100%;
  padding: 32px 24px;
}

.docs-panel-center h2 {
  margin: 12px 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
}

.docs-panel-center p {
  margin: 0 0 10px;
  font-size: 0.875rem;
  color: var(--text-2);
  max-width: 360px;
  line-height: 1.5;
}

.docs-muted {
  font-size: 0.75rem !important;
  color: var(--text-3) !important;
  margin-top: 8px !important;
}

.docs-unsupported-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.docs-unsupported-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  line-height: 1.45;
}

.docs-explorer-unsupported {
  flex: 1;
  min-height: 0;
}

.docs-folder-hero {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.docs-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: 8px;
}

.docs-btn.primary {
  background: var(--accent);
  color: #fff;
}

.docs-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.docs-btn.danger,
.docs-prompt-ok.danger {
  background: #c42b1c;
  color: #fff;
}

.docs-btn.danger:hover,
.docs-prompt-ok.danger:hover {
  background: #a52316;
}

.docs-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.docs-prompt-overlay[hidden] {
  display: none !important;
}

.docs-prompt {
  width: min(420px, 100%);
  background: rgba(32, 32, 32, 0.98);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 16px;
}

.docs-prompt-title {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-1);
}

.docs-prompt-message {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.45;
}

.docs-prompt-saved-wrap {
  display: block;
  margin-bottom: 8px;
}

.docs-prompt-saved-wrap[hidden] {
  display: none !important;
}

.docs-prompt-saved-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.docs-prompt-saved {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-1);
  font: inherit;
  font-size: 0.8125rem;
}

.docs-prompt-saved:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.docs-prompt-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-1);
  font: inherit;
  font-size: 0.875rem;
}

.docs-prompt-input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.docs-prompt-hint {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.45;
}

.docs-prompt-hint[hidden] {
  display: none !important;
}

.docs-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.docs-prompt-picker {
  margin-right: auto;
}

.docs-prompt-picker[hidden] {
  display: none !important;
}

.docs-prompt-actions .docs-btn {
  margin-top: 0;
  padding: 8px 14px;
}

.docs-context-menu,
.poseidon-context-menu {
  z-index: 400;
}

.docs-context-menu .context-menu-item[data-danger="1"],
.poseidon-context-menu .context-menu-item[data-danger="1"] {
  color: #f1707a;
}

.docs-context-menu .context-menu-item[data-danger="1"]:hover,
.poseidon-context-menu .context-menu-item[data-danger="1"]:hover {
  background: #c42b1c;
  color: #fff;
}

.docs-folder-menu {
  z-index: 401;
  width: min(320px, calc(100vw - 16px));
  padding: 10px 0 6px;
}

.docs-folder-menu-head {
  padding: 4px 14px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3, #9aa3c4);
}

.docs-folder-select {
  display: block;
  width: calc(100% - 28px);
  margin: 0 14px 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #2c3350);
  background: var(--bg-2, #1b2030);
  color: var(--text-1, #eef1fb);
  font: inherit;
  font-size: 13px;
}

.docs-folder-select:focus {
  outline: 2px solid rgba(0, 120, 212, 0.45);
  outline-offset: 1px;
}

.docs-folder-menu .context-menu-item {
  width: 100%;
  text-align: left;
}

.docs-explorer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  outline: none;
}

.docs-explorer:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(0, 120, 212, 0.35);
}

.docs-agent-banner-slot {
  flex-shrink: 0;
}

.docs-agent-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 8px 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 120, 212, 0.35);
  background: rgba(0, 120, 212, 0.12);
  color: var(--text-1);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.docs-agent-banner--ok {
  justify-content: center;
  border-color: rgba(76, 175, 80, 0.45);
  background: rgba(76, 175, 80, 0.15);
  color: #a5d6a7;
  font-weight: 600;
  padding: 10px 14px;
}

.docs-agent-banner--wait {
  justify-content: center;
  border-color: rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.1);
  color: var(--text-2);
  padding: 10px 14px;
}

.docs-agent-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.875rem;
}

.docs-agent-banner p {
  margin: 0;
  color: var(--text-2);
}

.docs-agent-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-2);
}

.docs-agent-steps li {
  margin-bottom: 4px;
}

.docs-agent-steps code,
.docs-agent-cmd {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-1);
}

.docs-file-icon-wrap {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.docs-ext-badge {
  position: absolute;
  top: -3px;
  left: -6px;
  padding: 0 2px;
  border-radius: 2px;
  background: #1e88e5;
  color: #fff;
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.docs-setup-step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 100%);
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.docs-setup-step.done {
  border-color: rgba(76, 175, 80, 0.45);
}

.docs-setup-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 120, 212, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.docs-setup-step.done .docs-setup-num {
  background: rgba(76, 175, 80, 0.3);
}

.docs-setup-label {
  flex: 1;
  text-align: left;
  font-size: 0.8125rem;
}

.docs-setup-ok {
  color: #a5d6a7;
  font-weight: 600;
  font-size: 0.8125rem;
}

.docs-agent-alt {
  margin: 8px 0 0;
  font-size: 0.7rem;
  color: var(--text-2);
  opacity: 0.8;
}

.docs-agent-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.docs-agent-url-row label {
  font-size: 0.75rem;
  color: var(--text-2);
  white-space: nowrap;
}

.docs-agent-url-input {
  flex: 1;
  min-width: 180px;
  padding: 5px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-1);
  font-size: 0.75rem;
  font-family: inherit;
}

.docs-agent-url-input:focus {
  outline: none;
  border-color: rgba(0, 120, 212, 0.6);
}

.docs-agent-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.docs-agent-banner-actions .docs-btn {
  margin-top: 0;
  white-space: nowrap;
}

.docs-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 6px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}

.docs-tool {
  width: 32px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-1);
  font-size: 1rem;
  cursor: pointer;
}

.docs-tool:hover:not(:disabled) {
  background: var(--bg-hover);
}

.docs-tool:disabled {
  opacity: 0.35;
  cursor: default;
}

.docs-breadcrumb {
  flex: 1;
  min-width: 0;
  margin-left: 4px;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-crumb,
.docs-crumb-sep {
  display: none;
}

.docs-sync {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.docs-sync.is-active {
  opacity: 1;
}

.docs-sync-icon {
  width: 18px;
  height: 18px;
  color: var(--text-2);
  animation: docs-spin 0.85s linear infinite;
  opacity: 0;
}

.docs-sync.is-active .docs-sync-icon {
  opacity: 1;
}

@keyframes docs-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.docs-crumb {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0 2px;
}

.docs-crumb.current {
  color: var(--text-1);
}

.docs-crumb-sep {
  margin: 0 4px;
  color: var(--text-3);
}

.docs-list-head {
  display: grid;
  grid-template-columns: 28px 1fr 88px 120px;
  gap: 8px;
  padding: 0 12px;
  height: 28px;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.docs-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  user-select: none;
}

.docs-row {
  display: grid;
  grid-template-columns: 28px 1fr 88px 120px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: var(--text-1);
  font: inherit;
  text-align: left;
  cursor: default;
}

.docs-toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.docs-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  margin-left: auto;
}

.docs-tool-gear {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.docs-tool-gear img {
  display: block;
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.docs-tool-gear:hover:not(:disabled) img {
  opacity: 1;
}

.docs-row.selected {
  background: rgba(0, 120, 212, 0.22);
  outline: 1px solid rgba(0, 120, 212, 0.45);
  outline-offset: -1px;
}

.docs-row:hover {
  background: var(--bg-hover);
}

.docs-row.selected:hover {
  background: rgba(0, 120, 212, 0.28);
}

.docs-row.is-cut {
  opacity: 0.45;
}

.docs-row.is-cut .docs-row-name {
  font-style: italic;
}

.docs-row.is-dragging {
  opacity: 0.45;
}

.docs-row.is-drop-target {
  background: rgba(0, 120, 212, 0.35) !important;
  outline: 2px dashed rgba(0, 120, 212, 0.75);
  outline-offset: -2px;
}

.docs-list.is-drop-target {
  background: rgba(0, 120, 212, 0.08);
  outline: 2px dashed rgba(0, 120, 212, 0.35);
  outline-offset: -2px;
}

.docs-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.docs-file-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

.docs-file-thumb {
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.docs-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.docs-row-meta,
.docs-row-date {
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: right;
}

.docs-row-meta {
  white-space: nowrap;
}

.docs-row-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-loading,
.docs-empty-list {
  padding: 24px;
  text-align: center;
  color: var(--text-2);
}

.docs-error {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #e57373;
  background: rgba(229, 115, 115, 0.1);
}

.docs-eco-block {
  margin: 4px 8px 10px;
  padding: 2px 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.docs-eco-head {
  padding: 8px 12px 4px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.docs-row-eco {
  opacity: 0.88;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 42px;
}

.docs-row-eco:last-child {
  border-bottom: none;
}

.docs-row-eco .docs-row-icon {
  opacity: 0.7;
}

.docs-row-eco:hover {
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

.docs-row-eco:hover .docs-row-icon {
  opacity: 0.9;
}

.docs-row-eco.selected {
  background: rgba(0, 120, 212, 0.16);
  outline: none;
  opacity: 1;
}

.docs-row-eco.selected:hover {
  background: rgba(0, 120, 212, 0.22);
}

.docs-eco-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}

.docs-eco-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.docs-eco-modules {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  color: var(--text-3);
}

.docs-eco-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffb74d;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.22);
}

.docs-eco-pill-online {
  color: #81c784;
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.28);
}

.docs-eco-hint {
  margin-top: 0;
  padding: 8px 12px 10px;
}

.docs-eco-hint p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.docs-row-eco-file .docs-row-name {
  font-weight: 500;
}

.docs-eco-ext-badge {
  background: #6a1b9a !important;
  opacity: 0.85;
}

.docs-eco-icon-wrap {
  filter: saturate(0.7) brightness(0.95);
}

.docs-eco-setup-hint {
  font-size: 0.8125rem;
  color: #e65100;
  background: rgba(230, 81, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-width: 360px;
  margin: 0 0 12px;
  line-height: 1.45;
}

.os-window-body:has(.docs-explorer),
.os-window-body:has(.docs-panel),
.os-window-body:has(.docs-unsupported-view) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
