/* Management Studio (#studio / /admin) — uses portfolio design tokens */

.studio-shell {
  min-height: 100vh;
  padding: 28px 4.5% 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.studio-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.studio-badge {
  font: var(--type-meta);
  color: var(--accent);
  background: var(--accent-soft, rgba(50, 226, 150, 0.12));
  border: 1px solid rgba(50, 226, 150, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-save-status {
  font: var(--type-meta);
  color: var(--muted);
  margin-right: 4px;
}

.studio-save-status.is-dirty {
  color: #ffb15e;
}

.studio-save-status.is-saved {
  color: var(--accent);
}

.studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--type-meta);
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.studio-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.studio-btn.is-primary {
  background: var(--accent);
  color: #09140e;
  border-color: var(--accent);
}

.studio-btn.is-primary:hover {
  filter: brightness(1.06);
  color: #09140e;
}

.studio-btn.is-danger {
  color: #ff7a70;
  border-color: rgba(255, 122, 112, 0.35);
}

.studio-btn.is-danger:hover {
  background: rgba(255, 122, 112, 0.12);
  border-color: #ff7a70;
}

.studio-btn.is-small {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.studio-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-tab {
  font: var(--type-meta);
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.studio-tab:hover {
  color: var(--ink);
}

.studio-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--table-head-bg);
  border-color: var(--line);
}

/* General Settings Layout */
.studio-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.studio-card {
  background: var(--surface, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.studio-card.is-full {
  grid-column: 1 / -1;
}

.studio-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.studio-card-head h2 {
  font: var(--type-title-3);
  margin: 0;
  color: var(--ink);
}

.studio-card-head span {
  font: var(--type-meta);
  color: var(--muted);
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-field > label,
.studio-field-label {
  font: var(--type-meta);
  color: var(--muted);
  font-weight: 600;
}

.studio-field input[type="text"],
.studio-field input[type="url"],
.studio-field input[type="number"],
.studio-field select,
.studio-field textarea {
  width: 100%;
  font: var(--type-body-2);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 140ms ease;
}

.studio-field input:focus,
.studio-field select:focus,
.studio-field textarea:focus {
  border-color: var(--accent);
}

.studio-field textarea {
  resize: vertical;
  min-height: 76px;
}

.studio-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.studio-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Availability Day & Slot Picker */
.studio-days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-pill-toggle {
  font: var(--type-meta);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 140ms ease;
}

.studio-pill-toggle[aria-pressed="true"] {
  background: rgba(50, 226, 150, 0.14);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.studio-slots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.studio-slot-pill {
  font: var(--type-meta);
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(50, 226, 150, 0.35);
  background: rgba(50, 226, 150, 0.1);
  color: var(--ink);
  cursor: pointer;
}

.studio-slot-pill.is-blocked {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.6;
}

/* Projects Workspace */
.studio-projects-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.studio-list-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-list-heading {
  font: var(--type-meta);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--ink);
  transition: border-color 140ms ease, background 140ms ease;
}

.studio-project-item:hover {
  border-color: var(--accent);
}

.studio-project-item.is-active {
  background: var(--table-head-bg);
  border-color: var(--accent);
}

.studio-project-item-title {
  font: var(--type-body-2);
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.studio-project-item-meta {
  font: var(--type-meta);
  color: var(--muted);
  display: block;
}

.studio-ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.studio-ref-row.is-hidden {
  opacity: 0.58;
}

.studio-ref-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Editor Workspace */
.studio-editor-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Section Cards in Content Builder */
.studio-section-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface, rgba(255, 255, 255, 0.02));
}

.studio-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-section-badge {
  font: var(--type-meta);
  color: var(--muted);
  font-weight: 600;
}

.studio-layout-warn {
  font: var(--type-meta);
  color: #ffb15e;
  background: rgba(255, 177, 94, 0.12);
  border: 1px solid rgba(255, 177, 94, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
}

.studio-layout-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.studio-layout-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.studio-layout-opt strong {
  font: var(--type-meta);
  font-weight: 600;
}

.studio-layout-opt span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.studio-layout-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(50, 226, 150, 0.1);
}

/* Rich Text Editor */
.studio-rte-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
}

.studio-rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--table-head-bg);
}

.studio-rte-btn {
  font: var(--type-meta);
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
}

.studio-rte-btn:hover {
  border-color: var(--line);
  background: var(--paper);
}

.studio-rte-area {
  min-height: 110px;
  padding: 12px 14px;
  font: var(--type-body-2);
  color: var(--ink);
  outline: none;
  line-height: 1.6;
}

.studio-rte-area p { margin: 0 0 8px; }
.studio-rte-area h3 { font: var(--type-title-3); margin: 8px 0 6px; }
.studio-rte-area blockquote,
.studio-rte-area .quote {
  margin: 8px 0;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}
.studio-rte-area ul { margin: 6px 0; padding-left: 18px; }
.studio-rte-area a { color: var(--accent); text-decoration: underline; }

/* Table Editor Grid */
.studio-table-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: auto;
}

.studio-table-editor table {
  width: 100%;
  border-collapse: collapse;
}

.studio-table-editor th,
.studio-table-editor td {
  padding: 4px;
}

.studio-table-editor input {
  width: 100%;
  font: var(--type-meta);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.studio-table-editor th input {
  font-weight: 600;
  background: var(--table-head-bg);
}

.studio-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.studio-media-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  max-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.studio-media-preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

/* Custom Editorial Media in Public Project Pages */
.editorial-media-frame {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editorial-media-frame img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.editorial-embed-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}

.editorial-embed-wrap.is-vimeo {
  aspect-ratio: 16 / 9;
}

.editorial-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.editorial-media-frame figcaption {
  font: var(--type-caption);
  color: var(--muted);
}

@media (max-width: 960px) {
  .studio-settings-grid,
  .studio-projects-layout {
    grid-template-columns: 1fr;
  }
  .studio-sidebar {
    position: static;
  }
  .studio-layout-picker {
    grid-template-columns: 1fr;
  }
}
