/* ===================================================================
   ADMIN DASHBOARD
   =================================================================== */

.admin-body {
  background: #fafafa;
  min-height: 100vh;
}

/* Login page */
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--page-pad);
}
.admin-login__box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  padding: 40px;
  border: 1px solid var(--line);
}
.admin-login__brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  text-align: center;
  margin-bottom: 4px;
}
.admin-login__sub {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 40px;
}

/* Dashboard layout */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform 0.3s var(--ease); z-index: 600; background: #fff; }
  .admin-sidebar.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.15); }
}

.admin-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.admin-sidebar__brand {
  padding: 0 24px 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.admin-sidebar__brand b {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  margin-bottom: 2px;
}
.admin-sidebar__brand span {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  border-left: 2px solid transparent;
}
.admin-nav a:hover { background: var(--line-soft); }
.admin-nav a.is-active {
  background: var(--line-soft);
  color: var(--ink);
  border-left-color: var(--ink);
  font-weight: 500;
}
.admin-nav a svg { width: 16px; height: 16px; }

.admin-sidebar__footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
}
.admin-sidebar__footer b { display: block; color: var(--ink); margin-bottom: 4px; font-weight: 500; }

.admin-main {
  padding: 40px;
  max-width: 1400px;
  width: 100%;
}
@media (max-width: 900px) { .admin-main { padding: 20px; } }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.admin-topbar__title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}
.admin-topbar__title em { font-style: italic; font-weight: 300; }
.admin-mobile-menu {
  display: none;
}
@media (max-width: 900px) {
  .admin-mobile-menu { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); }
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
}
.stat-card__label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.stat-card__value {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}
.stat-card__hint {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 6px;
}

/* Table */
.table {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.table th {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  background: var(--line-soft);
}
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { border-bottom: 1px solid currentColor; }
.table__mobile-hide {}
@media (max-width: 720px) {
  .table__mobile-hide { display: none; }
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--tech);
}
.status-pill--paid { background: #dcfce7; color: #166534; }
.status-pill--pending { background: #fef9c3; color: #713f12; }
.status-pill--failed { background: #fee2e2; color: #991b1b; }
.status-pill--fulfilled { background: #e0e7ff; color: #3730a3; }
.status-pill--active { background: #dcfce7; color: #166534; }
.status-pill--expired { background: #fee2e2; color: #991b1b; }
.status-pill--warning { background: #fef3c7; color: #78350f; }

/* Gallery cards grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gallery-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
  display: block;
}
.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
}
.gallery-card__cover {
  aspect-ratio: 16/10;
  background: var(--tech);
  overflow: hidden;
  position: relative;
}
.gallery-card__cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.gallery-card__body { padding: 16px 20px 20px; }
.gallery-card__title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.gallery-card__sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.gallery-card__meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.gallery-card__meta b {
  color: var(--ink);
  font-weight: 600;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  background: #fff;
}
.dropzone.is-drag { border-color: var(--ink); background: var(--tech); }
.dropzone svg { width: 40px; height: 40px; stroke-width: 1; color: var(--ink-muted); margin-bottom: 14px; }
.dropzone__title {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 4px;
}
.dropzone__hint {
  font-size: 12px;
  color: var(--ink-muted);
}

.upload-progress {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #fff;
}
.upload-progress__label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.upload-progress__bar {
  height: 4px;
  background: var(--tech);
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress__bar-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.3s var(--ease);
  width: 0;
}
.upload-progress__count {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Form sections */
.form-section {
  background: #fff;
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 16px;
}
.form-section__title {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Photo grid (admin) */
.admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.admin-photos__item {
  position: relative;
  aspect-ratio: 1;
  background: var(--tech);
  overflow: hidden;
}
.admin-photos__item img { width: 100%; height: 100%; object-fit: cover; }
.admin-photos__item-delete {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.admin-photos__item:hover .admin-photos__item-delete { opacity: 1; }
.admin-photos__item-delete svg { width: 12px; height: 12px; }

/* Toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle__track {
  width: 38px;
  height: 22px;
  background: var(--line);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s var(--ease);
}
.toggle__track::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle__track { background: var(--ink); }
.toggle input:checked + .toggle__track::before { transform: translateX(16px); }

/* Section titles */
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  margin: 24px 0 12px;
  font-weight: 400;
}

/* Empty states */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-muted);
  background: #fff;
  border: 1px solid var(--line);
}
.empty em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  display: block;
  margin-bottom: 12px;
}
