/* ==========================================================================
   STUDIO BRANDS VIEW — UNIFIED WORKBENCH EDIT VIEW (OPTION 1)
   ========================================================================== */

.brands-view {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  padding-bottom: 1rem;
}

.brands-edit-container {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  --brand-ctrl-h: 34px;
  --brand-btn-h: 30px;
}

/* Top Edit Header Bar */
.brands-edit-header-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.52rem 0.85rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 12px;
}

.brands-edit-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  min-width: 0;
}

.brands-edit-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.brands-domain-pill {
  font-size: 0.68rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Compact Square Icon Buttons for Back & Save in Top Bar */
.brands-header-icon-btn {
  appearance: none;
  width: var(--brand-ctrl-h);
  height: var(--brand-ctrl-h);
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.brands-header-icon-btn:active {
  transform: translateY(1px);
}

.brands-header-icon-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.brands-back-icon-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.brands-back-icon-btn:hover {
  background: rgba(51, 65, 85, 0.96);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.brands-save-icon-btn {
  border: 1px solid rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.brands-save-icon-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* 2-Column Equal-Height Workbench Grid */
.brands-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 0.75rem;
  align-items: stretch;
}

.brands-card.brands-workbench-card {
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.brands-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  padding-bottom: 0.48rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brands-subcard-header {
  margin-top: 0.15rem;
}

.brands-card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f8fafc;
}

.brands-card-subtitle-inline {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}

/* Identity 3-Column Top + Full-Width Bio Row */
.brands-identity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.6rem;
}

.brands-field {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  min-width: 0;
}

.brands-field.brands-field-full {
  grid-column: 1 / -1;
}

.brands-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.brands-input-row {
  display: flex;
  align-items: center;
  gap: 0.32rem;
}

/* Standardized 34px Input & Icon Copy Button */
.brands-input {
  flex: 1;
  min-width: 0;
  height: var(--brand-ctrl-h);
  background: rgba(7, 11, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  padding: 0 0.6rem;
  color: #f8fafc;
  font-size: 0.78rem;
  font-family: inherit;
}

.brands-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.65);
}

.brands-icon-btn {
  appearance: none;
  width: var(--brand-ctrl-h);
  height: var(--brand-ctrl-h);
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.brands-icon-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Compact 2-Column Social Channels Grid */
.brands-socials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
}

.brand-social-compact-card {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.26rem 0.34rem;
  border-radius: 8px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-social-badge {
  min-width: 44px;
  height: 28px;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-social-compact-card .brand-social-handle-input {
  height: 28px;
  border-color: transparent;
  background: transparent;
  padding: 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.brand-social-compact-card .brand-social-handle-input:focus {
  background: rgba(7, 11, 20, 0.85);
  border-color: rgba(96, 165, 250, 0.5);
}

.brand-social-compact-card .brands-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

/* Custom Social Links Section */
.brands-custom-socials-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.brands-section-divider {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-top: 0.2rem;
}

.brands-custom-socials-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.brand-custom-social-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.7fr) minmax(95px, 0.8fr) minmax(130px, 1.3fr) auto;
  gap: 0.38rem;
  align-items: center;
}

.brands-referrals-primary-row {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.brand-referral-kalshi-card {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(6, 40, 30, 0.32);
}

.brand-referral-kalshi-badge {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
  min-width: 54px;
}

.brand-referral-param-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-custom-referral-row {
  display: grid;
  grid-template-columns: minmax(85px, 0.8fr) minmax(85px, 0.8fr) minmax(110px, 1fr) minmax(72px, 0.6fr) auto;
  gap: 0.38rem;
  align-items: center;
}

.brand-social-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Standardized 30px Action Buttons (Used across Social Header & All 4 Asset Rows) */
.brands-action-btn {
  appearance: none;
  height: var(--brand-btn-h);
  min-width: 50px;
  padding: 0 0.62rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.82);
  color: #e2e8f0;
  font-size: 0.69rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.brands-action-btn:hover {
  background: rgba(51, 65, 85, 0.96);
  color: #ffffff;
}

.brands-action-btn.brands-upload-btn {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.38);
  color: #93c5fd;
}

.brands-action-btn.brands-upload-btn:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #ffffff;
}

.brands-action-btn.brands-delete-btn {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.brands-action-btn.brands-delete-btn:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

/* Right Column: 4 Uniform Horizontal Asset Rows */
.brands-asset-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  justify-content: space-between;
}

.brand-asset-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.52rem 0.65rem;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-asset-thumb {
  width: 76px;
  height: 50px;
  border-radius: 7px;
  overflow: hidden;
  background-color: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-asset-thumb.aspect-square .brand-asset-img {
  object-fit: contain;
  padding: 2px;
}

.brand-asset-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-asset-empty {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
}

.brand-asset-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.brand-asset-title-line {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.brand-asset-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.brand-asset-spec {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.08rem 0.36rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
}

.brand-asset-meta {
  font-size: 0.64rem;
  font-weight: 600;
  color: #64748b;
}

.brand-asset-meta.is-ready {
  color: #34d399;
}

.brand-asset-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex-shrink: 0;
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .brands-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .brands-edit-container {
    --brand-ctrl-h: 40px;
    --brand-btn-h: 36px;
  }

  .brands-input,
  .brand-social-compact-card .brand-social-handle-input {
    font-size: 16px;
  }

  .brands-identity-grid,
  .brands-socials-grid {
    grid-template-columns: 1fr;
  }

  .brand-custom-social-row,
  .brand-custom-referral-row {
    grid-template-columns: 1fr 1fr;
  }

  .brand-asset-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.55rem;
  }

  .brand-asset-thumb {
    width: 64px;
    height: 46px;
  }

  .brand-asset-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .brand-asset-actions .brands-action-btn {
    width: 100%;
    min-width: 0;
    padding: 0 0.35rem;
  }
}
