/* =========================================================
   Shared "manage" layout (lists + side panels)
   Used by: services_manage, clients_manage, careers_manage
   ========================================================= */

/* Full width variant (used by About manage only) */
.manage-grid--full {
  max-width: none;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 1400px) {
  .manage-grid--full {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.manage-grid,
.service-manage-grid { /* legacy alias kept */
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .manage-grid,
  .service-manage-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Section headers */
.manage-list-header,
.svc-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.manage-list-header h1,
.manage-list-header h2,
.manage-list-header h4,
.svc-list-header h1 {
  margin-bottom: 0;
}

/* Right column headers */
.svc-images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* =========================================================
   Global overlay/dialog (confirm + edit modal)
   Single modal system used everywhere
   ========================================================= */

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Keep hidden working with [hidden] */
.confirm-overlay[hidden] {
  display: none !important;
}

.confirm-dialog {
  background: var(--surface, #fff);
  color: var(--text, #111);
  width: 100%;
  max-width: 520px; /* default modal width like Clients */
  max-height: calc(100vh - 2rem);
  border-radius: var(--radius-card-xl, 16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border-subtle, rgba(0,0,0,.08));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollable modal body */
.confirm-body {
  padding: 1.25rem 1.25rem 1rem;
  overflow-y: auto;
}

/* Footer actions */
.confirm-actions {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--surface, #fff);
}

/* Buttons in modal */
.confirm-dialog .btn {
  border-radius: 999px;
  padding: 0.4rem 1rem;
}

/* Mobile adjustments */
@media (max-width: 576px) {
  .confirm-dialog {
    max-width: 100%;
    border-radius: 14px;
  }
  .confirm-body { padding: 1rem; }
  .confirm-actions { padding: 0.75rem 1rem 1rem; }
}

/* =========================================================
   Services intro image manager
   ========================================================= */

#svc-img-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.svc-img-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.svc-img-slot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.svc-img-frame {
  position: relative;
  width: 100%;
  background: var(--surface-2, #f6f7f9);
  border: 1px solid var(--border-subtle, rgba(0,0,0,.08));
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card-lg, 14px);
  overflow: hidden;
}

.svc-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.svc-img-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.svc-img-slot--deleted .svc-img-frame {
  opacity: 0.4;
}

@media (max-width: 900px) {
  #svc-img-grid,
  .svc-img-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Careers previews
   ========================================================= */

.career-hero-frame {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-card-xl, 16px);
  overflow: hidden;
  background: var(--surface-2, #f6f7f9);
  box-shadow: var(--shadow-soft, 0 10px 30px rgba(0,0,0,.12));
  margin-left: auto;
}

.career-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 992px) {
  .career-hero-frame {
    margin-left: 0;
    max-width: 520px;
  }
}

.career-poster-wrapper {
  border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,.08));
  border-radius: 12px 12px 0 0;
  background: var(--surface-2, #f6f7f9);
  overflow: hidden;
}

.career-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.career-poster-frame {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(0,0,0,.10));
  background: var(--surface-2, #f6f7f9);
  overflow: hidden;
}

.career-poster-actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

.file-error {
  color: #dc2626;
  font-size: .9rem;
}

/* =========================================================
   Career application cards
   ========================================================= */

.career-apply-summary,
.career-apply-card {
  border-radius: var(--radius-card-lg, 14px);
  border: 1px solid var(--border-subtle, rgba(0,0,0,.08));
}

.career-apply-card .card-body {
  padding: 1.5rem 1.5rem 1.25rem;
}

.career-apply-card .form-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.career-apply-card .form-text {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
}

.career-apply-card .form-control,
.career-apply-card .form-select {
  border-radius: 0.75rem;
}

/* =========================================================
   Action buttons (View / Edit / Delete)
   ========================================================= */

.action-btns {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.btn-action {
  height: 32px;
  padding: 0 .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill, 999px);
  font-size: .95rem;
  border: 1px solid var(--border-subtle, rgba(0,0,0,.10));
  background: var(--surface, #fff);
  color: var(--text-muted, #6b7280);
  transition: all .15s ease;
}

.btn-action:hover,
.btn-action:focus {
  background: var(--surface-2, #f6f7f9);
  color: var(--text, #111);
  border-color: var(--brand, #0d6efd);
}

.btn-edit { color: var(--brand, #0d6efd); }

.btn-delete { color: #dc3545; }
.btn-delete:hover,
.btn-delete:focus {
  background: rgba(220,53,69,0.06);
  border-color: #dc3545;
}

.btn-action i { line-height: 1; }

/* =========================================================
   Clients manage helpers
   ========================================================= */

.client-logo-preview {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
}

@media (max-width: 992px) {
  .client-logo-preview {
    max-width: 320px;
  }
}

.client-url-truncate {
  max-width: 100%;
  word-break: break-word;
}

/* Logo preview inside modal */
.client-logo-preview--modal {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.5rem;
}

.client-logo-preview--modal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-2, #f8f9fa);
}

/* =========================================================
   Optional studio shell
   ========================================================= */

.studio-shell {
  padding-top: var(--nav-height, 64px);
  background: var(--surface, #fff);
  min-height: 100vh;
}

/* =========================================================
   Full-width / single-column variant (About manage)
   Put AFTER .manage-grid so it overrides correctly
   ========================================================= */

.manage-grid.manage-grid--full {
  max-width: none;
  width: 100%;
  grid-template-columns: 1fr;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 1400px) {
  .manage-grid.manage-grid--full {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
