/* Admin console — Grand Vista */
:root {
  --adm-bg: #0f1419;
  --adm-surface: #161d27;
  --adm-elevated: #1c2533;
  --adm-border: rgba(148, 163, 184, 0.12);
  --adm-text: #e2e8f0;
  --adm-muted: #94a3b8;
  --adm-accent: #c9a962;
  --adm-accent-dim: rgba(201, 169, 98, 0.15);
  --adm-success: #2dd4bf;
  --adm-danger: #f87171;
  --adm-radius: 12px;
  --adm-font: "DM Sans", system-ui, sans-serif;
  --sidebar-w: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.adm-body {
  margin: 0;
  font-family: var(--adm-font);
  background: var(--adm-bg);
  color: var(--adm-text);
  min-height: 100vh;
}

a {
  color: var(--adm-accent);
}

.adm-layout {
  display: flex;
  min-height: 100vh;
}

.adm-sidebar {
  width: var(--sidebar-w);
  background: var(--adm-surface);
  border-right: 1px solid var(--adm-border);
  padding: 1.25rem 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--adm-border);
  margin-bottom: 0.75rem;
}

.adm-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--adm-accent), #8b7355);
  color: var(--adm-bg);
  font-weight: 800;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
}

.adm-brand-text {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.adm-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.65rem;
}

.adm-nav a {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: var(--adm-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.adm-nav a:hover,
.adm-nav a.active {
  background: var(--adm-accent-dim);
  color: var(--adm-text);
  text-decoration: none;
}

.adm-nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--adm-muted);
  padding: 1rem 0.85rem 0.35rem;
}

.adm-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 1.75rem 2rem 3rem;
  min-width: 0;
}

.adm-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.adm-topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
}

.adm-user {
  font-size: 0.88rem;
  color: var(--adm-muted);
}

.adm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.adm-card {
  background: var(--adm-elevated);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.1rem 1.2rem;
}

.adm-card h3 {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--adm-muted);
  font-weight: 600;
}

.adm-card p {
  margin: 0.4rem 0 0;
  font-size: 1.65rem;
  font-weight: 700;
}

.adm-panel {
  background: var(--adm-elevated);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

.adm-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.adm-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--adm-border);
}

table.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.adm-table th,
.adm-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--adm-border);
}

.adm-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--adm-muted);
  font-weight: 600;
}

.adm-table tr:last-child td {
  border-bottom: none;
}

.adm-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.adm-badge-pending {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}
.adm-badge-paid {
  background: rgba(45, 212, 191, 0.15);
  color: var(--adm-success);
}

.adm-form-grid {
  display: grid;
  gap: 0.85rem;
  max-width: 520px;
}

.adm-form-grid.wide {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label.adm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--adm-muted);
  margin-bottom: 0.3rem;
}

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  background: var(--adm-bg);
  color: var(--adm-text);
  font-family: inherit;
}

.adm-textarea {
  min-height: 100px;
}

.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-size: 0.88rem;
  text-decoration: none;
}

.adm-btn-primary {
  background: var(--adm-accent);
  color: #1a1520;
}
.adm-btn-ghost {
  background: transparent;
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
}
.adm-btn-danger {
  background: rgba(248, 113, 113, 0.2);
  color: var(--adm-danger);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.adm-btn-sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

.adm-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.adm-alert-ok {
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.25);
  color: var(--adm-success);
}

.adm-alert-err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--adm-danger);
}

.adm-muted {
  color: var(--adm-muted);
  font-size: 0.88rem;
}

.adm-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--adm-border);
  background: var(--adm-elevated);
  color: var(--adm-text);
  font-size: 1.25rem;
  cursor: pointer;
}

@media (max-width: 960px) {
  .adm-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .adm-sidebar.is-open {
    transform: translateX(0);
  }
  .adm-main {
    margin-left: 0;
    padding: 1.25rem 1rem 4rem;
  }
  .adm-sidebar-toggle {
    display: grid;
    place-items: center;
  }
}

.adm-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(201, 169, 98, 0.12), transparent 50%),
    var(--adm-bg);
}

.adm-login-card {
  width: min(400px, 100%);
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 2rem;
}

.adm-login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.adm-inline-form {
  display: inline;
}

.thumb-64 {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.thumb-gallery {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.adm-topbar-titles h1 {
  margin: 0;
}

.adm-topbar-sub {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--adm-muted);
  font-weight: 500;
  max-width: 42rem;
  line-height: 1.45;
}

.adm-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.adm-env-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--adm-border);
  color: var(--adm-muted);
  background: rgba(0, 0, 0, 0.2);
}

.adm-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.adm-page-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.adm-page-toolbar p {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--adm-muted);
  max-width: 40rem;
}

.adm-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.adm-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.adm-stat-chip {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.adm-stat-chip strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.adm-stat-chip span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--adm-muted);
}

.adm-form-section {
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.12);
}

.adm-form-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--adm-accent);
}

.adm-dropzone {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 1.15rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.adm-dropzone:hover,
.adm-dropzone.is-drag {
  border-color: var(--adm-accent);
  background: var(--adm-accent-dim);
}

.adm-dropzone input[type="file"] {
  display: none;
}

.adm-dropzone-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.adm-dropzone p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--adm-muted);
}

.adm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.adm-section-lead {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  max-width: 48rem;
}

.adm-media-upload-grid {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .adm-media-upload-grid {
    grid-template-columns: 1fr;
  }
}

.adm-cover-block .adm-label,
.adm-gallery-drop-block .adm-label {
  display: block;
  margin-bottom: 0.45rem;
}

.adm-cover-block {
  min-width: 0;
  max-width: 100%;
}

.adm-cover-preview-wrap {
  position: relative;
  width: 100%;
  max-width: min(280px, 100%);
  aspect-ratio: 4 / 3;
  max-height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--adm-border);
  background: #0a0e14;
}

.adm-cover-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.adm-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--adm-muted);
  text-align: center;
  line-height: 1.45;
}

.adm-cover-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.adm-file-trigger {
  cursor: pointer;
  margin: 0;
}

.adm-file-name {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-word;
}

.adm-check-remove {
  font-size: 0.82rem;
  color: var(--adm-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.adm-dropzone-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--adm-muted);
}

.adm-dropzone-hint {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
}

.adm-dropzone-compact {
  padding: 0.85rem 0.75rem;
}

.adm-dropzone-compact .adm-dropzone-title {
  font-size: 0.85rem;
}

.adm-gallery-panel-head {
  align-items: flex-start;
}

.adm-gallery-panel-head .adm-panel-sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 36rem;
}

/* Hidden POST stubs for per-photo actions (cover / reorder / delete) — keeps layout out of the caption form */
.adm-gallery-remote-forms {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.adm-gallery-remote-form {
  margin: 0;
}

.adm-gallery-panel {
  position: relative;
}

.adm-gallery-batch-form {
  margin: 0;
}

.adm-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0;
}

.adm-gallery-card {
  flex: 1 1 100%;
  max-width: 100%;
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--adm-surface);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  isolation: isolate;
}

@media (min-width: 640px) {
  .adm-gallery-card {
    flex: 1 1 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }
}

@media (min-width: 1100px) {
  .adm-gallery-card {
    flex: 1 1 calc(33.333% - 0.85rem);
    max-width: calc(33.333% - 0.85rem);
  }
}

.adm-gallery-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 140px;
  max-height: 220px;
  background: linear-gradient(145deg, #0a0e14, #151b24);
  flex-shrink: 0;
}

@supports not (aspect-ratio: 16 / 9) {
  .adm-gallery-card-media {
    height: 0;
    padding-bottom: 56.25%;
    min-height: 140px;
  }
  .adm-gallery-card-media .adm-gallery-thumb {
    position: absolute;
    inset: 0;
  }
}

.adm-gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.adm-gallery-card-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  background: rgba(201, 169, 98, 0.96);
  color: #1a1520;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.adm-gallery-card-body {
  padding: 1rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  background: var(--adm-elevated);
}

.adm-gallery-field-row {
  display: grid;
  grid-template-columns: 1fr 5.5rem;
  gap: 0.65rem;
  align-items: end;
}

@media (max-width: 400px) {
  .adm-gallery-field-row {
    grid-template-columns: 1fr;
  }
}

.adm-gallery-field-sort {
  min-width: 0;
}

.adm-label-compact {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--adm-muted);
  margin-bottom: 0.28rem;
}

.adm-input-compact {
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

.adm-gallery-card-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.15rem;
  margin-top: auto;
}

.adm-gallery-move-group {
  display: inline-flex;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  overflow: hidden;
}

.adm-gallery-move-group .adm-btn-icon {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--adm-border);
}

.adm-gallery-move-group .adm-btn-icon:last-child {
  border-right: none;
}

.adm-btn-icon {
  min-width: 2.25rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  line-height: 1;
}

.adm-gallery-del {
  margin-left: auto;
}

.adm-gallery-save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--adm-border);
  background: rgba(0, 0, 0, 0.18);
}

.adm-gallery-footnote {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}

.adm-gallery-empty-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.adm-gallery-quick-upload {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--adm-border);
  max-width: 440px;
}

.adm-media-upload-section {
  margin-bottom: 0.25rem;
}

.adm-room-editor-actions {
  padding-top: 0.35rem;
}

.adm-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.adm-status-ok {
  color: var(--adm-success);
  font-weight: 600;
}

.adm-status-warn {
  color: #facc15;
  font-weight: 600;
}

.adm-status-bad {
  color: var(--adm-danger);
  font-weight: 600;
}

.adm-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.adm-panel-header h2 {
  margin: 0;
}

.adm-link-quiet {
  color: var(--adm-muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.adm-link-quiet:hover {
  color: var(--adm-text);
  text-decoration: underline;
}

.adm-intro {
  font-size: 0.9rem;
  color: var(--adm-muted);
  margin: 0 0 1.25rem;
  max-width: 48rem;
  line-height: 1.55;
}
