/* =========================================
   ASSET MANAGER
========================================= */

.asset-workspace {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  
  [hidden] {
    display: none !important;
  }
  /* =========================================
     TOP TOOLBAR
  ========================================= */
  
  .asset-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
  }
  
  .asset-field {
    display: grid;
    gap: 7px;
  }
  
  
  .asset-field {
    display: grid;
    gap: 7px;
    min-width: 0;
  }

  .asset-field:has(select) {
    width: 260px;
  }

  @media (max-width: 520px) {
    .asset-field:has(select) {
      width: 100%;
    }
  }

  
  .asset-field label {
    color: #3f4859;
    font-size: 0.82rem;
    font-weight: 700;
  }
  
  .asset-field select {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
  }
  
  .asset-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(23, 107, 87, 0.12);
  }
  
  .asset-upload-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition:
      background 150ms ease,
      border-color 150ms ease;
  }
  
  .asset-upload-button:hover {
    background: #105845;
    border-color: #105845;
  }
  
  
  /* =========================================
     EDITOR LAYOUT
  ========================================= */
  
  .asset-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
    min-height: 650px;
  }
  
  .asset-editor-panel {
    min-width: 0;
    padding: 24px;
    border-right: 1px solid var(--line);
  }
  
  .asset-preview-panel {
    min-width: 0;
    padding: 24px;
    background: var(--surface-soft);
  }
  
  .asset-panel-heading {
    min-height: 52px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
  }
  
  .asset-size-badge {
    flex-shrink: 0;
    padding: 7px 10px;
    border: 1px solid #b9e2d5;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
  }
  
  
  /* =========================================
     EMPTY EDITOR
  ========================================= */
  
  .asset-editor-empty {
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 30px;
    border: 2px dashed var(--line-strong);
    border-radius: 14px;
    background:
      linear-gradient(
        135deg,
        rgba(247, 248, 250, 0.7),
        rgba(255, 255, 255, 0.95)
      );
    text-align: center;
  }
  
  .asset-editor-empty strong {
    color: var(--ink);
    font-size: 1rem;
  }
  
  .asset-editor-empty span {
    color: var(--muted);
    font-size: 0.82rem;
  }
  
  
  /* =========================================
     CROPPER AREA
  ========================================= */
  
  .asset-crop-area {
    width: 100%;
    height: 480px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #eef1f5;
  }
  
  .asset-crop-area img {
    display: block;
    max-width: 100%;
  }
  
  
  /* Cropper.js */
  
  .asset-crop-area .cropper-container {
    width: 100% !important;
    height: 100% !important;
  }
  
  .asset-crop-area .cropper-view-box,
  .asset-crop-area .cropper-face {
    border-radius: 3px;
  }
  
  .asset-crop-area .cropper-view-box {
    outline: 2px solid var(--accent);
    outline-color: var(--accent);
  }
  
  .asset-crop-area .cropper-line {
    background-color: var(--accent);
  }
  
  .asset-crop-area .cropper-point {
    width: 7px;
    height: 7px;
    background-color: var(--accent);
  }
  
  
  /* =========================================
     EDITOR CONTROLS
  ========================================= */
  
  .asset-editor-controls {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
  }
  
  .asset-editor-controls .secondary-button {
    min-width: 90px;
  }
  
  
  /* =========================================
     FINAL PREVIEW
  ========================================= */
  
  .asset-preview-stage {
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
      linear-gradient(45deg, #eef1f4 25%, transparent 25%),
      linear-gradient(-45deg, #eef1f4 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #eef1f4 75%),
      linear-gradient(-45deg, transparent 75%, #eef1f4 75%),
      #f8fafc;
    background-position:
      0 0,
      0 8px,
      8px -8px,
      -8px 0;
    background-size: 16px 16px;
  }
  
  .asset-preview-placeholder {
    max-width: 200px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
    text-align: center;
  }
  
  #asset-preview {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(18, 25, 38, 0.12);
  }
  
  
  /* =========================================
     OUTPUT INFO
  ========================================= */
  
  .asset-output-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 18px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--line);
  }
  
  .asset-output-info > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--surface);
  }
  
  .asset-output-info span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
  }
  
  .asset-output-info strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  
  /* =========================================
     SAVE BUTTON
  ========================================= */
  
  #asset-save {
    margin-top: 4px;
  }
  
  #asset-save:disabled {
    border-color: #cfd5dd;
    background: #dfe3e8;
    color: #8b94a3;
    cursor: not-allowed;
  }
  
  
  /* =========================================
     RESPONSIVE
  ========================================= */
  
  @media (max-width: 980px) {
    .asset-editor-layout {
      grid-template-columns: 1fr;
    }
  
    .asset-editor-panel {
      border-right: 0;
      border-bottom: 1px solid var(--line);
    }
  
    .asset-preview-stage {
      min-height: 300px;
    }
  }
  
  
  @media (max-width: 720px) {
    .asset-workspace {
      border-radius: 13px;
    }
  
    .asset-toolbar {
      padding: 18px;
    }
  
    .asset-editor-panel,
    .asset-preview-panel {
      padding: 18px;
    }
  
    .asset-crop-area,
    .asset-editor-empty {
      height: 400px;
      min-height: 400px;
    }
  }
  
  
  @media (max-width: 520px) {
    .asset-toolbar {
      align-items: stretch;
      flex-direction: column;
    }
  
    .asset-field,
    .asset-field:first-child {
      width: 100%;
    }
  
    .asset-panel-heading {
      min-height: 0;
    }
  
    .asset-crop-area,
    .asset-editor-empty {
      height: 340px;
      min-height: 340px;
    }
  
    .asset-editor-controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
  
    .asset-editor-controls .secondary-button {
      width: 100%;
      min-width: 0;
    }
  
    #asset-reset {
      grid-column: 1 / -1;
    }
  
    .asset-preview-stage {
      min-height: 260px;
      padding: 16px;
    }
  
    .asset-output-info {
      grid-template-columns: 1fr;
    }
  }



  .asset-upload-result {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    background: #f0fdf4;
  }
  
  .asset-upload-success {
    margin-bottom: 14px;
    color: #166534;
    font-size: 14px;
    font-weight: 700;
  }
  
  .asset-upload-details {
    display: grid;
    gap: 12px;
  }
  
  .asset-upload-details > div {
    display: grid;
    gap: 5px;
  }
  
  .asset-upload-details span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
  }
  
  .asset-upload-details strong {
    color: #101828;
    font-size: 13px;
    word-break: break-all;
  }
  
  .asset-upload-url-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .asset-upload-url-row a {
    min-width: 0;
    flex: 1;
    color: #175cd3;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    word-break: break-all;
  }
  
  .asset-upload-url-row a:hover {
    text-decoration: underline;
  }
  
  .asset-upload-url-row .secondary-button {
    flex-shrink: 0;
  }
  
  @media (max-width: 650px) {
    .asset-upload-url-row {
      align-items: stretch;
      flex-direction: column;
    }
  }