
/* Luna4 v1.5 - interfaz profesional para herramientas de imagen */
.v15-page {
  --v15-panel: #ffffff;
  --v15-soft: #f7f9fe;
  --v15-ink: #17223e;
  --v15-muted: #6d7690;
  --v15-line: #dce4f3;
  --v15-accent: #5b7cff;
  --v15-accent-dark: #465fe4;
  --v15-success: #178b62;
  --v15-danger: #c94255;
  --v15-warn: #9a6a0b;
}

.v15-editor {
  display: grid;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.v15-panel,
.v15-workspace {
  border: 1px solid var(--v15-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.v15-panel {
  padding: 18px;
  position: sticky;
  top: 88px;
}

.v15-panel-section + .v15-panel-section {
  border-top: 1px solid var(--v15-line);
  margin-top: 16px;
  padding-top: 16px;
}

.v15-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.v15-step {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(145deg, var(--v15-accent), #8b7cff);
  font-size: 12px;
  font-weight: 850;
}

.v15-heading-row h2,
.v15-heading-row h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.v15-dropzone {
  border: 2px dashed #cbd6eb;
  border-radius: 18px;
  background: #fbfcff;
  min-height: 162px;
  padding: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  cursor: pointer;
}

.v15-dropzone:hover,
.v15-dropzone.is-dragover,
.v15-dropzone:focus-visible {
  border-color: var(--v15-accent);
  background: #f4f7ff;
}

.v15-dropzone.is-dragover {
  transform: scale(1.006);
}

.v15-drop-inner {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.v15-upload-symbol {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--v15-accent), #8b7cff);
  box-shadow: 0 11px 24px rgba(91, 124, 255, .22);
}

.v15-upload-symbol svg {
  width: 27px;
  height: 27px;
}

.v15-dropzone strong {
  font-size: 15px;
}

.v15-dropzone span {
  color: var(--v15-muted);
  font-size: 13px;
  line-height: 1.45;
}

.v15-file-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--v15-line);
  border-radius: 15px;
  background: var(--v15-soft);
  padding: 10px;
  margin-top: 10px;
}

.v15-file-thumb {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  background: #e9eef9;
  display: grid;
  place-items: center;
}

.v15-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v15-file-copy {
  min-width: 0;
}

.v15-file-copy strong,
.v15-file-copy span {
  display: block;
  min-width: 0;
}

.v15-file-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.v15-file-copy span {
  color: var(--v15-muted);
  margin-top: 3px;
  font-size: 11.5px;
}

.v15-icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--v15-line);
  border-radius: 11px;
  background: #fff;
  color: var(--v15-muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.v15-icon-button:hover {
  color: var(--v15-danger);
  border-color: rgba(201, 66, 85, .35);
  background: rgba(201, 66, 85, .05);
}

.v15-controls {
  display: grid;
  gap: 13px;
}

.v15-field {
  display: grid;
  gap: 7px;
}

.v15-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v15-field label,
.v15-label-row label,
.v15-field legend {
  font-size: 13px;
  font-weight: 780;
  color: var(--v15-ink);
}

.v15-value {
  color: var(--v15-accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.v15-input,
.v15-select {
  width: 100%;
  border: 1px solid var(--v15-line);
  border-radius: 13px;
  color: var(--v15-ink);
  background: #fff;
  min-height: 44px;
  padding: 10px 12px;
}

.v15-input:focus,
.v15-select:focus {
  border-color: var(--v15-accent);
  box-shadow: 0 0 0 3px rgba(91, 124, 255, .12);
  outline: 0;
}

.v15-range {
  width: 100%;
  accent-color: var(--v15-accent);
}

.v15-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--v15-muted);
  font-size: 13px;
  line-height: 1.4;
}

.v15-check input {
  margin-top: 2px;
  accent-color: var(--v15-accent);
}

.v15-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.v15-segmented {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.v15-segmented button {
  border: 1px solid var(--v15-line);
  border-radius: 11px;
  background: #fff;
  color: var(--v15-muted);
  padding: 9px 11px;
  min-height: 40px;
  font-weight: 750;
  font-size: 12.5px;
}

.v15-segmented button:hover {
  border-color: #bdcae3;
  color: var(--v15-ink);
}

.v15-segmented button.is-active {
  border-color: var(--v15-accent);
  background: rgba(91, 124, 255, .10);
  color: var(--v15-accent-dark);
}

.v15-help {
  margin: 0;
  color: var(--v15-muted);
  font-size: 12px;
  line-height: 1.5;
}

.v15-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.v15-actions .v15-primary,
.v15-actions .v15-secondary,
.v15-actions .v15-tertiary {
  min-height: 46px;
  border-radius: 13px;
  font-weight: 820;
  padding: 11px 13px;
}

.v15-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(145deg, var(--v15-accent), #8b7cff);
  box-shadow: 0 10px 22px rgba(91, 124, 255, .20);
}

.v15-primary:hover:not(:disabled) {
  filter: brightness(.98);
  transform: translateY(-1px);
}

.v15-secondary {
  border: 1px solid var(--v15-line);
  color: var(--v15-ink);
  background: #fff;
}

.v15-tertiary {
  border: 0;
  color: var(--v15-muted);
  background: transparent;
}

.v15-primary:disabled,
.v15-secondary:disabled,
.v15-tertiary:disabled {
  opacity: .52;
  cursor: not-allowed;
  transform: none;
}

.v15-status {
  min-height: 0;
  border-radius: 13px;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.45;
}

.v15-status:not(:empty) {
  padding: 10px 12px;
  border: 1px solid var(--v15-line);
  background: var(--v15-soft);
  color: var(--v15-muted);
}

.v15-status[data-tone="success"] {
  border-color: rgba(23, 139, 98, .24);
  background: rgba(23, 139, 98, .07);
  color: var(--v15-success);
}

.v15-status[data-tone="warn"] {
  border-color: rgba(154, 106, 11, .24);
  background: rgba(244, 191, 63, .10);
  color: var(--v15-warn);
}

.v15-status[data-tone="error"] {
  border-color: rgba(201, 66, 85, .24);
  background: rgba(201, 66, 85, .06);
  color: var(--v15-danger);
}

.v15-workspace {
  padding: 16px;
  min-width: 0;
}

.v15-workspace-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.v15-workspace-title {
  min-width: 0;
}

.v15-workspace-title strong,
.v15-workspace-title span {
  display: block;
}

.v15-workspace-title strong {
  font-size: 15px;
}

.v15-workspace-title span {
  margin-top: 3px;
  color: var(--v15-muted);
  font-size: 12px;
}

.v15-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2fa;
}

.v15-view-switch button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--v15-muted);
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 760;
  font-size: 12px;
}

.v15-view-switch button.is-active {
  background: #fff;
  color: var(--v15-ink);
  box-shadow: 0 3px 10px rgba(20, 35, 74, .08);
}

.v15-preview {
  position: relative;
  width: 100%;
  border: 1px solid var(--v15-line);
  border-radius: 20px;
  overflow: hidden;
  background: #f4f7fd;
  display: grid;
  place-items: center;
  padding: 14px;
}

.v15-preview:not(.has-media) {
  min-height: 360px;
}

.v15-preview.has-media {
  min-height: 0;
}

.v15-preview img,
.v15-preview canvas,
.v15-preview .v15-crop-stage {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(68vh, 720px);
}

.v15-preview canvas {
  touch-action: none;
}

.v15-placeholder {
  min-height: 330px;
  width: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #949eb3;
  padding: 34px 20px;
}

.v15-placeholder-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 330px;
}

.v15-placeholder svg {
  width: 48px;
  height: 48px;
  color: #aab4c8;
}

.v15-placeholder strong {
  color: #6e7891;
  font-size: 15px;
}

.v15-placeholder span {
  font-size: 13px;
  line-height: 1.5;
}

.v15-checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f8 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f8 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.v15-busy {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(247, 249, 254, .82);
  backdrop-filter: blur(5px);
}

.v15-busy-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--v15-line);
  border-radius: 14px;
  background: #fff;
  padding: 11px 14px;
  color: var(--v15-muted);
  font-size: 13px;
  box-shadow: var(--shadow);
}

.v15-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dce3f0;
  border-top-color: var(--v15-accent);
  border-radius: 50%;
  animation: v15-spin .8s linear infinite;
}

@keyframes v15-spin {
  to { transform: rotate(360deg); }
}

.v15-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.v15-stat {
  min-width: 0;
  border: 1px solid var(--v15-line);
  border-radius: 14px;
  background: #fbfcff;
  padding: 12px;
}

.v15-stat span,
.v15-stat strong {
  display: block;
  min-width: 0;
}

.v15-stat span {
  color: var(--v15-muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.v15-stat strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.v15-crop-stage {
  position: relative;
  display: inline-block;
  user-select: none;
  line-height: 0;
}

.v15-crop-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(68vh, 720px);
  pointer-events: none;
}

.v15-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(9, 19, 42, .50);
  cursor: move;
  touch-action: none;
  outline: 1px solid rgba(0, 0, 0, .20);
}

.v15-crop-box::before,
.v15-crop-box::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .58;
}

.v15-crop-box::before {
  left: 33.333%;
  top: 0;
  bottom: 0;
  width: 33.333%;
  border-left: 1px solid rgba(255,255,255,.75);
  border-right: 1px solid rgba(255,255,255,.75);
}

.v15-crop-box::after {
  top: 33.333%;
  left: 0;
  right: 0;
  height: 33.333%;
  border-top: 1px solid rgba(255,255,255,.75);
  border-bottom: 1px solid rgba(255,255,255,.75);
}

.v15-handle {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--v15-accent);
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
}

.v15-handle[data-handle="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.v15-handle[data-handle="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.v15-handle[data-handle="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.v15-handle[data-handle="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }

.v15-crop-readout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.v15-readout {
  border: 1px solid var(--v15-line);
  background: var(--v15-soft);
  border-radius: 12px;
  padding: 9px 10px;
}

.v15-readout span {
  display: block;
  color: var(--v15-muted);
  font-size: 10.5px;
  margin-bottom: 3px;
}

.v15-readout strong {
  font-size: 12.5px;
}

.v15-color-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.v15-color-input {
  width: 48px;
  height: 44px;
  border: 1px solid var(--v15-line);
  border-radius: 12px;
  padding: 4px;
  background: #fff;
}

.v15-color-swatch {
  width: 48px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--v15-line);
  background: #fff;
}

.v15-pick-hint {
  color: var(--v15-muted);
  font-size: 12px;
  line-height: 1.45;
}

.v15-pick-marker {
  position: absolute;
  z-index: 5;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--v15-accent), 0 2px 10px rgba(0,0,0,.25);
  pointer-events: none;
}

.v15-manual-tools {
  border: 1px solid var(--v15-line);
  border-radius: 15px;
  background: var(--v15-soft);
  padding: 12px;
}

.v15-manual-tools h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.v15-brush-canvas {
  cursor: crosshair;
}

.v15-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--v15-line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 9px;
  color: var(--v15-muted);
  font-size: 11px;
  font-weight: 760;
}

.v15-hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .v15-editor {
    grid-template-columns: 1fr;
  }

  .v15-panel {
    position: static;
  }

  .v15-preview img,
  .v15-preview canvas,
  .v15-preview .v15-crop-stage,
  .v15-crop-stage img {
    max-height: 62vh;
  }
}

@media (max-width: 720px) {
  .v15-editor {
    gap: 12px;
  }

  .v15-panel,
  .v15-workspace {
    border-radius: 19px;
  }

  .v15-panel {
    padding: 14px;
  }

  .v15-workspace {
    padding: 12px;
  }

  .v15-dropzone {
    min-height: 142px;
    padding: 15px;
  }

  .v15-workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .v15-view-switch {
    width: 100%;
  }

  .v15-view-switch button {
    flex: 1;
  }

  .v15-preview:not(.has-media) {
    min-height: 265px;
  }

  .v15-placeholder {
    min-height: 235px;
    padding: 26px 15px;
  }

  .v15-stats {
    grid-template-columns: 1fr 1fr;
  }

  .v15-inline-grid,
  .v15-actions {
    grid-template-columns: 1fr;
  }

  .v15-segmented button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v15-spinner {
    animation-duration: 1.8s;
  }
}
