.cloud-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.78);
  color: #e0f2fe;
  cursor: pointer;
  font-weight: 800;
  transition: 0.18s ease;
}

.cloud-login-button:hover,
.cloud-login-button.cloud-logged {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #38bdf8;
}

.cloud-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(4px);
}

.cloud-card {
  color: #f8fafc;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
}

.cloud-login-card {
  width: min(420px, calc(100vw - 36px));
  padding: 18px;
}

.cloud-dashboard-card {
  width: min(1120px, calc(100vw - 36px));
  height: min(820px, calc(100vh - 36px));
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 36px);
  min-width: min(760px, calc(100vw - 36px));
  min-height: min(520px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  resize: both;
  overflow: hidden;
}

.cloud-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cloud-title-wrap {
  display: grid;
  gap: 5px;
}

.cloud-title-wrap strong {
  font-size: 17px;
}

.cloud-title-wrap span {
  color: #cbd5e1;
  font-size: 12px;
}

.cloud-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.cloud-login-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.cloud-field {
  display: grid;
  gap: 6px;
}

.cloud-field span,
.cloud-panel-title {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cloud-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.45);
  color: #f8fafc;
  padding: 8px 10px;
  outline: none;
}

.cloud-field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.cloud-actions,
.cloud-dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-dashboard-toolbar {
  padding-bottom: 4px;
}

.cloud-primary,
.cloud-secondary {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.cloud-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.85);
}

.cloud-secondary {
  background: rgba(30, 41, 59, 0.90);
  color: #f8fafc;
}

.cloud-danger-soft {
  color: #fecaca;
}

.cloud-primary:disabled,
.cloud-secondary:disabled,
.cloud-field input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.cloud-dashboard-body {
  --cloud-list-width: 360px;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, var(--cloud-list-width)) 8px minmax(320px, 1fr);
  gap: 10px;
}

.cloud-dashboard-splitter {
  width: 8px;
  min-height: 0;
  align-self: stretch;
  border-radius: 999px;
  cursor: col-resize;
  background: linear-gradient(to right, transparent 0, transparent 2px, rgba(148, 163, 184, 0.22) 2px, rgba(148, 163, 184, 0.22) 6px, transparent 6px);
  transition: background 0.16s ease;
}

.cloud-dashboard-splitter:hover,
.cloud-resizing-columns .cloud-dashboard-splitter {
  background: linear-gradient(to right, transparent 0, transparent 2px, rgba(96, 165, 250, 0.72) 2px, rgba(96, 165, 250, 0.72) 6px, transparent 6px);
}

.cloud-resizing-columns,
.cloud-resizing-columns * {
  user-select: none;
}

.cloud-project-list-panel,
.cloud-project-detail-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.cloud-project-detail-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.cloud-project-list,
.cloud-project-detail {
  min-height: 0;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(2, 6, 23, 0.36);
  padding: 8px;
}

.cloud-project-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.cloud-project-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.70);
  color: #f8fafc;
  padding: 10px;
  cursor: pointer;
}

.cloud-project-item:hover,
.cloud-project-item.selected {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.20);
}

.cloud-project-item strong,
.cloud-detail-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-project-item span,
.cloud-project-item small,
.cloud-empty,
.cloud-message,
.cloud-detail-description,
.cloud-file-row small,
.cloud-detail-grid span {
  color: #cbd5e1;
  font-size: 12px;
}

.cloud-detail-name {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
}

.cloud-detail-description {
  margin-bottom: 10px;
}

.cloud-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.cloud-detail-grid div {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  padding: 9px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.cloud-detail-grid strong {
  font-size: 13px;
}

.cloud-project-manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.42);
}

.cloud-project-manage-toolbar .cloud-secondary {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.cloud-file-list {
  display: grid;
  gap: 6px;
}

.cloud-file-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.58);
}

.cloud-file-row span {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.cloud-message {
  min-height: 18px;
  padding: 7px 0;
}

.cloud-message-error { color: #fecaca; }
.cloud-message-success { color: #bbf7d0; }
.cloud-message-warning { color: #fde68a; }
.cloud-message-info { color: #bfdbfe; }

.cloud-detail-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .cloud-overlay {
    align-items: stretch;
    padding: 12px;
  }

  .cloud-dashboard-card {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 24px);
    min-width: 0;
    resize: none;
  }

  .cloud-dashboard-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(160px, 0.9fr) minmax(220px, 1.1fr);
  }

  .cloud-dashboard-splitter {
    display: none;
  }

  .cloud-detail-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    gap: 8px;
  }

  .cloud-login-button {
    padding-inline: 10px;
  }
}

.cloud-session-card {
  width: min(680px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.cloud-session-content {
  min-height: 0;
  display: grid;
  gap: 12px;
}

.cloud-session-alert {
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  background: rgba(120, 53, 15, 0.24);
  color: #fde68a;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.cloud-active-session-list {
  min-height: 0;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(2, 6, 23, 0.36);
  padding: 8px;
}

.cloud-active-session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.70);
  padding: 10px;
}

.cloud-session-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cloud-session-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.cloud-session-meta span,
.cloud-session-meta small {
  color: #cbd5e1;
  font-size: 12px;
}

.cloud-session-actions {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .cloud-active-session-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cloud-active-session-item button {
    width: 100%;
  }
}

/* Árbol de archivos cloud */
.cloud-project-tree-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 8px;
  color: #e8f0ff;
  font-weight: 800;
}
.cloud-project-tree-toolbar small {
  color: #98a8c5;
  font-weight: 600;
  font-size: 11px;
}
.cloud-project-tree {
  max-height: min(46vh, 420px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(8, 14, 31, 0.58);
  padding: 8px;
}
.cloud-tree-folder {
  margin: 2px 0;
}
.cloud-tree-folder > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px 5px calc(8px + var(--cloud-tree-depth, 0) * 18px);
  border-radius: 10px;
  color: #dbe8ff;
  font-weight: 800;
  user-select: none;
}
.cloud-tree-folder > summary::-webkit-details-marker {
  display: none;
}
.cloud-tree-folder > summary:hover {
  background: rgba(59, 130, 246, 0.12);
}
.cloud-tree-icon {
  color: #7fb5ff;
  font-size: 12px;
  transition: transform 0.16s ease;
}
.cloud-tree-folder:not([open]) > summary .cloud-tree-icon {
  transform: rotate(-90deg);
}
.cloud-tree-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cloud-tree-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 8px 5px calc(8px + var(--cloud-tree-depth, 0) * 18px);
  border-radius: 10px;
  border: 1px solid transparent;
}
.cloud-tree-file:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(59, 130, 246, 0.22);
}
.cloud-tree-file-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cloud-tree-file-icon {
  color: #65a3ff;
  font-size: 12px;
}
.cloud-tree-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eef5ff;
  font-weight: 400;
}
.cloud-tree-file-main small {
  flex: 0 0 auto;
  color: #9badca;
  font-size: 11px;
}
.cloud-file-update-button {
  border: 1px solid rgba(96, 165, 250, 0.52);
  background: rgba(37, 99, 235, 0.22);
  color: #dbeafe;
  font-weight: 800;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.cloud-file-update-button:hover {
  background: rgba(37, 99, 235, 0.45);
  border-color: rgba(147, 197, 253, 0.82);
}
.cloud-upload-options-card {
  width: min(560px, calc(100vw - 28px));
}
.cloud-upload-options {
  display: grid;
  gap: 12px;
}
.cloud-upload-option {
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(8, 14, 31, 0.65);
  color: #e8f0ff;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
}
.cloud-upload-option strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}
.cloud-upload-option span {
  display: block;
  color: #a8b7d3;
  line-height: 1.35;
}
.cloud-upload-option:hover {
  border-color: rgba(96, 165, 250, 0.7);
  background: rgba(37, 99, 235, 0.18);
}
@media (max-width: 720px) {
  .cloud-project-tree-toolbar {
    display: block;
  }
  .cloud-tree-file {
    grid-template-columns: 1fr;
  }
  .cloud-file-update-button {
    justify-self: start;
  }
}

/* Ajustes etapa control de estructura cloud */
.cloud-project-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  padding: 8px;
}
.cloud-detail-scroll {
  min-height: 0;
}
.cloud-project-tree-wrap {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}
.cloud-project-tree {
  max-height: none;
  height: 100%;
  min-height: 0;
  overflow: auto;
}
.cloud-folder-target {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(14, 165, 233, 0.10);
}
.cloud-folder-target span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
}
.cloud-folder-target strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 800;
}
.cloud-folder-target small {
  grid-column: 1 / -1;
  color: #a8b7d3;
  font-size: 11px;
}
.cloud-tree-root-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px dashed rgba(96, 165, 250, 0.45);
  background: rgba(15, 23, 42, 0.54);
  color: #dbeafe;
  cursor: pointer;
}
.cloud-tree-root-drop:hover,
.cloud-tree-root-drop.cloud-drop-target {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(147, 197, 253, 0.8);
}
.cloud-tree-root-drop small {
  color: #93a7c5;
  font-size: 11px;
}
.cloud-tree-folder.selected-folder > summary {
  background: rgba(37, 99, 235, 0.22);
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.9);
}
.cloud-tree-folder > summary.cloud-drop-target {
  background: rgba(34, 197, 94, 0.18);
  outline: 1px dashed rgba(134, 239, 172, 0.85);
}
.cloud-tree-folder-badge {
  flex: 0 0 auto;
  margin-left: auto;
  color: #93a7c5;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
}
.cloud-tree-file.cloud-dragging,
.cloud-tree-folder > summary.cloud-dragging {
  opacity: 0.5;
}
.cloud-tree-file {
  cursor: grab;
}
.cloud-tree-file:active,
.cloud-tree-folder > summary:active {
  cursor: grabbing;
}
@media (max-width: 760px) {
  .cloud-project-detail {
    overflow: auto;
  }
  .cloud-project-tree-wrap {
    min-height: 260px;
  }
}

/* Ajustes raíz como nombre del proyecto e ingreso inline de carpetas */
.cloud-tree-project-root > summary {
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.20);
  margin-bottom: 4px;
}
.cloud-tree-project-root > summary:hover,
.cloud-tree-project-root > summary.cloud-drop-target {
  background: rgba(37, 99, 235, 0.20);
  border-color: rgba(147, 197, 253, 0.75);
}
.cloud-tree-project-root > summary .cloud-tree-folder-name {
  font-weight: 900;
}
.cloud-empty-inside-tree {
  margin: 8px 8px 8px 26px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.45);
}
.cloud-create-folder-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  margin: -4px 0 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  background: rgba(14, 165, 233, 0.09);
}
.cloud-create-folder-panel[hidden] {
  display: none !important;
}
.cloud-create-folder-panel > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.cloud-create-folder-panel > div span,
.cloud-inline-field span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
}
.cloud-create-folder-panel > div strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e0f2fe;
  font-size: 12px;
}
.cloud-inline-field {
  display: grid;
  gap: 5px;
}
.cloud-inline-field input {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.56);
  color: #f8fafc;
  padding: 7px 10px;
  outline: none;
}
.cloud-inline-field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}
.cloud-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.cloud-inline-actions .cloud-primary,
.cloud-inline-actions .cloud-secondary {
  min-height: 34px;
  padding: 7px 11px;
}
@media (max-width: 900px) {
  .cloud-create-folder-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .cloud-inline-actions {
    justify-content: flex-start;
  }
}

/* Progreso visible para acciones cloud */
.cloud-progress {
  display: grid;
  gap: 5px;
  padding: 8px 0 2px;
}
.cloud-progress[hidden] {
  display: none !important;
}
.cloud-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}
.cloud-progress-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cloud-progress-info strong {
  flex: 0 0 auto;
  color: #e0f2fe;
  font-size: 11px;
}
.cloud-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: rgba(2, 6, 23, 0.62);
}
.cloud-progress-track i {
  display: block;
  height: 100%;
  min-width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.22s ease;
}
.cloud-progress-indeterminate .cloud-progress-track i {
  width: 38% !important;
  animation: cloud-progress-slide 1.1s ease-in-out infinite;
}
@keyframes cloud-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}


/* Ajuste compacto de cabecera y eliminación */
.cloud-dashboard-card .cloud-header {
  align-items: center;
}
.cloud-dashboard-card .cloud-title-wrap {
  min-width: 190px;
  flex: 1 1 auto;
}
.cloud-dashboard-toolbar-header {
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 1 auto;
}
.cloud-dashboard-toolbar-header .cloud-primary,
.cloud-dashboard-toolbar-header .cloud-secondary {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.cloud-project-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.cloud-project-item-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.cloud-mini-danger {
  width: 24px;
  height: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.46);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.cloud-mini-danger:hover {
  background: rgba(220, 38, 38, 0.42);
  border-color: rgba(252, 165, 165, 0.78);
  color: #fff1f2;
}
.cloud-detail-grid div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cloud-detail-grid span {
  flex: 0 0 auto;
}
.cloud-detail-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cloud-tree-folder > summary {
  position: relative;
}
.cloud-tree-delete {
  flex: 0 0 auto;
  margin-left: 4px;
}
.cloud-tree-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.cloud-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(3px);
}
.cloud-confirm-card {
  width: min(430px, calc(100vw - 32px));
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 70px rgba(2, 6, 23, 0.48);
  padding: 16px;
  color: #f8fafc;
  display: grid;
  gap: 10px;
}
.cloud-confirm-card.danger {
  border-color: rgba(248, 113, 113, 0.36);
}
.cloud-confirm-card > strong {
  font-size: 16px;
}
.cloud-confirm-target {
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 8px 10px;
  color: #dbeafe;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.cloud-confirm-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}
.cloud-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.cloud-confirm-danger {
  background: #dc2626;
  border-color: rgba(252, 165, 165, 0.72);
}
.cloud-confirm-danger:hover {
  background: #b91c1c;
}
@media (max-width: 760px) {
  .cloud-dashboard-card .cloud-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .cloud-dashboard-toolbar-header {
    width: 100%;
    order: 3;
    justify-content: flex-start;
  }
  .cloud-tree-file-actions {
    justify-content: flex-start;
  }
}

.cloud-tree-file-badge {
  flex: 0 0 auto;
  color: #93a7c5;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.55);
}

/* Compacta el panel de detalles cloud: el resumen ya vive en el listado de proyectos. */
.cloud-detail-scroll-compact {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.cloud-project-manage-toolbar-compact {
  margin: 0 0 8px;
  padding: 6px;
  gap: 6px;
}

.cloud-project-manage-toolbar-compact .cloud-secondary {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11.5px;
}

.cloud-project-tree-toolbar-compact {
  margin-top: 0;
  padding: 6px 8px;
}

.cloud-project-tree-toolbar-compact span {
  font-size: 12px;
}

.cloud-project-tree-toolbar-compact small {
  display: none;
}

/* Sincronización manual del ExportModel_Web_Cache en modo nube */
.app-shell.cloud-cache-sync-visible {
  grid-template-rows: auto minmax(0, 1fr);
}

.cloud-cache-sync-host {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.cloud-cache-sync-host:empty {
  display: none;
}

.cloud-cache-sync-toolbar {
  position: static;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 5px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.82);
  color: #e5e7eb;
}

.cloud-cache-sync-toolbar-floating {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2200;
  max-width: min(720px, calc(100vw - 28px));
  padding: 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 16px 42px rgba(2, 6, 23, 0.36);
  backdrop-filter: blur(5px);
}

.cloud-cache-sync-button {
  min-height: 29px;
  border-radius: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(30, 41, 59, 0.9);
  color: #e0f2fe;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.cloud-cache-sync-button:hover {
  border-color: rgba(125, 211, 252, 0.85);
  background: rgba(14, 165, 233, 0.28);
}

.cloud-cache-sync-primary {
  background: #2563eb;
  border-color: rgba(96, 165, 250, 0.85);
  color: #ffffff;
}

.cloud-cache-discard-button {
  border-color: rgba(248, 113, 113, 0.62);
  color: #fecaca;
}

.cloud-cache-discard-button:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.95);
  background: rgba(220, 38, 38, 0.28);
}

.cloud-cache-sync-status {
  min-width: 0;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-inline: 3px;
  font-size: 11px;
  color: #cbd5e1;
}

.cloud-cache-sync-status.is-dirty {
  color: #fde68a;
  font-weight: 800;
}

.cloud-cache-sync-toolbar.is-busy {
  opacity: 0.88;
}

.cloud-cache-sync-toolbar button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.cloud-cache-sync-toolbar.is-busy button:disabled {
  cursor: wait;
}

.top-actions.cloud-cache-sync-visible {
  min-width: 0;
  gap: 8px;
}

.top-actions.cloud-cache-sync-visible .header-status {
  max-width: 260px;
}

/* En anchos intermedios, mantiene todo en la cabecera usando dos filas compactas. */
@media (min-width: 981px) and (max-width: 1600px) {
  .top-actions.cloud-cache-sync-visible {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto auto;
    grid-template-areas:
      "status login upload"
      "cache  cache cache";
    align-items: center;
    column-gap: 8px;
    row-gap: 3px;
    width: min(620px, 58vw);
  }

  .top-actions.cloud-cache-sync-visible .header-status {
    grid-area: status;
    max-width: none;
  }

  .top-actions.cloud-cache-sync-visible .cloud-cache-sync-host {
    grid-area: cache;
    justify-content: flex-end;
  }

  .top-actions.cloud-cache-sync-visible #cloudLoginButton {
    grid-area: login;
  }

  .top-actions.cloud-cache-sync-visible .header-upload {
    grid-area: upload;
  }
}

@media (max-width: 980px) {
  .top-actions.cloud-cache-sync-visible .cloud-cache-sync-host {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }

  .cloud-cache-sync-toolbar {
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .cloud-cache-sync-host {
    flex: 1 1 100%;
    width: 100%;
  }

  .cloud-cache-sync-toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .cloud-cache-sync-button {
    flex: 1 1 138px;
    min-height: 28px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .cloud-cache-sync-status {
    flex: 1 1 100%;
    max-width: none;
    text-align: center;
    font-size: 10px;
  }

  .cloud-cache-sync-toolbar-floating {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}


/* Selección previa y edición inline del árbol cloud */
.cloud-tree-select {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0 1px 0 0;
  accent-color: #3b82f6;
  cursor: pointer;
}
.cloud-tree-select:disabled {
  opacity: 0.35;
  cursor: default;
}
.cloud-tree-folder-name[data-cloud-edit-name],
.cloud-tree-file-name[data-cloud-edit-name] {
  cursor: text;
}
.cloud-tree-name-editor {
  width: min(360px, 100%);
  min-width: 120px;
  height: 26px;
  border: 1px solid rgba(96, 165, 250, 0.9);
  border-radius: 7px;
  background: #08101f;
  color: #f8fbff;
  padding: 3px 7px;
  font: inherit;
  font-weight: inherit;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}
.cloud-tree-file-main .cloud-tree-select {
  margin-left: 0;
}

/* Edición diferida de nombres y control de expansión del árbol cloud */
.cloud-apply-renames {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.cloud-apply-renames:not(:disabled) {
  border-color: rgba(96, 165, 250, 0.78);
  background: rgba(37, 99, 235, 0.34);
  color: #eff6ff;
}

.cloud-apply-renames:not(:disabled):hover {
  background: rgba(37, 99, 235, 0.56);
}

.cloud-name-pending {
  color: #fbbf24 !important;
  text-decoration: underline dotted rgba(251, 191, 36, 0.72);
  text-underline-offset: 3px;
}

.cloud-tree-folder > summary .cloud-tree-icon {
  flex: 0 0 14px;
  text-align: center;
}

@media (max-width: 720px) {
  .cloud-project-tree-toolbar-compact {
    display: flex;
    align-items: center;
  }

  .cloud-apply-renames {
    margin-left: auto;
  }
}

/* Sangría real para archivos dentro del árbol cloud */
.cloud-tree-file-indent {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  position: relative;
}

.cloud-tree-file-indent::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -11px;
  bottom: 7px;
  border-left: 1px solid rgba(125, 181, 255, 0.24);
}

.cloud-tree-file-indent::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 7px;
  width: 8px;
  border-top: 1px solid rgba(125, 181, 255, 0.34);
}

.cloud-tree-file-main {
  padding-left: 0;
}


/* Fase 13: detalle y descarte selectivo de cambios cloud */
.cloud-cache-sync-status {
  cursor: pointer;
  user-select: none;
}
.cloud-cache-sync-status:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.cloud-changes-panel {
  position: fixed;
  z-index: 10080;
  max-height: min(72vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: #17191d;
  color: #f3f4f6;
  box-shadow: 0 18px 48px rgba(0,0,0,.48);
}
.cloud-changes-panel.hidden,
.cloud-change-file-content.hidden { display: none; }
.cloud-changes-panel-header,
.cloud-changes-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #111318;
}
.cloud-changes-panel-header { border-bottom: 1px solid rgba(255,255,255,.1); }
.cloud-changes-panel-footer { border-top: 1px solid rgba(255,255,255,.1); justify-content: flex-end; }
.cloud-changes-identity { margin-top: 3px; color: #aeb5c0; font-size: 11px; }
.cloud-changes-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7dbe2;
  font-size: 22px;
  cursor: pointer;
}
.cloud-changes-close:hover { background: rgba(255,255,255,.08); }
.cloud-changes-panel-body { overflow: auto; padding: 10px; }
.cloud-changes-empty { padding: 28px 12px; text-align: center; color: #adb4bf; }
.cloud-change-file { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; overflow: hidden; margin-bottom: 9px; }
.cloud-change-file-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; background: #202329; }
.cloud-change-file-toggle { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 7px; row-gap: 1px; align-items: center; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.cloud-change-file-toggle > span { grid-row: 1 / span 2; }
.cloud-change-file-toggle strong,
.cloud-change-file-toggle small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-change-file-toggle small { color: #99a2ae; font-size: 10px; }
.cloud-change-file-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 10px; color: #b4bbc5; }
.cloud-change-discard-file,
.cloud-change-discard-one { border: 1px solid rgba(239,68,68,.65); border-radius: 5px; background: transparent; color: #fca5a5; padding: 5px 7px; cursor: pointer; font-size: 10px; }
.cloud-change-discard-file:hover,
.cloud-change-discard-one:hover:not(:disabled) { background: rgba(239,68,68,.14); }
.cloud-change-discard-one:disabled { opacity: .45; cursor: not-allowed; }
.cloud-change-file-content { padding: 4px 10px; background: #191c21; }
.cloud-change-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.cloud-change-row:last-child { border-bottom: 0; }
.cloud-change-description { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cloud-change-description strong { font-size: 12px; font-weight: 500; }
.cloud-change-description small { color: #949ca8; font-size: 10px; overflow-wrap: anywhere; }
.cloud-change-diagnostic { margin: 7px 0; padding: 8px; border-radius: 6px; background: rgba(59,130,246,.12); color: #bfdbfe; font-size: 11px; line-height: 1.35; }
@media (max-width: 640px) {
  .cloud-changes-panel { left: 8px !important; right: 8px; width: auto !important; max-height: 76vh; }
  .cloud-change-file-header { align-items: flex-start; flex-direction: column; }
  .cloud-change-file-actions { width: 100%; justify-content: flex-end; }
}


/* Colaboración y permisos por proyecto */
.cloud-project-access-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
}
.cloud-project-access-summary strong { color: #7dd3fc; font-size: 12px; }
.cloud-project-access-summary span { color: #cbd5e1; font-size: 12px; }
.cloud-team-card {
  width: min(820px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}
.cloud-team-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
}
.cloud-team-form,
.cloud-team-list-wrap {
  min-height: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.28);
}
.cloud-team-form { display: grid; align-content: start; gap: 12px; }
.cloud-team-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.45);
  color: #f8fafc;
  padding: 8px 10px;
}
.cloud-team-permissions { display: grid; gap: 8px; }
.cloud-team-permissions label { display: flex; align-items: center; gap: 8px; color: #e2e8f0; font-size: 12px; }
.cloud-team-list-wrap { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
.cloud-team-list { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 8px; }
.cloud-team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
}
.cloud-team-member > div:first-child { display: grid; gap: 3px; }
.cloud-team-member strong { font-size: 13px; }
.cloud-team-member span,
.cloud-team-member small { color: #94a3b8; font-size: 11px; }
.cloud-team-member-actions { display: flex; gap: 6px; }
.cloud-team-member-actions .cloud-secondary { min-height: 30px; padding: 5px 8px; font-size: 11px; }
@media (max-width: 760px) {
  .cloud-team-body { grid-template-columns: 1fr; overflow: auto; }
  .cloud-team-card { overflow: auto; }
}


/* Controles prioritarios del panel cloud */
.cloud-detail-heading {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 2px;
}

.cloud-technical-files-control {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.cloud-technical-files-control[hidden] {
  display: none !important;
}

.cloud-technical-files-control input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.cloud-dashboard-toolbar-header .cloud-team-button {
  border-color: rgba(56, 189, 248, 0.58);
  color: #e0f2fe;
}

.cloud-dashboard-toolbar-header .cloud-team-button:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
}

@media (max-width: 760px) {
  .cloud-detail-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .cloud-technical-files-control {
    width: 100%;
    justify-content: flex-end;
  }
}
