/* =======================================================
   SAYONARA V2 — ADMIN PANEL STYLES
   ======================================================= */

/* ── ADMIN LAYOUT ────────────────────────────────────── */

body.admin-body {
  background: #F0F2F5;
  overflow-x: hidden;
}

#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--clr-navy) 0%, #1a3a5c 100%);
  padding: var(--space-6);
}

.login-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.login-box .login-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-5);
  border: 3px solid var(--clr-border);
}

.login-box h1 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.login-box .login-sub { color: var(--clr-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.login-box .form-group { text-align: left; }
.login-box .form-label { color: var(--clr-text); }

.login-submit {
  width: 100%;
  padding: var(--space-4);
  background: var(--clr-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  transition: background var(--duration-base);
  margin-top: var(--space-6);
}
.login-submit:hover { background: var(--clr-navy-light); }
.login-submit.loading { pointer-events: none; opacity: 0.75; }
.login-submit .spinner { display: none; }
.login-submit.loading .spinner { display: block; }
.login-submit.loading .btn-text { display: none; }

.login-error {
  color: var(--clr-error);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  display: none;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: rgba(198,40,40,0.08);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--clr-error);
}
.login-error.visible { display: block; }

/* ── DASHBOARD LAYOUT ────────────────────────────────── */

#dashboard-view {
  display: none;
  min-height: 100vh;
}

#dashboard-view.visible {
  display: flex;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--clr-navy);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: var(--z-sticky);
  transition: transform 0.3s var(--ease-out);
}

.sidebar-header {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-header img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(229,161,45,0.4);
  flex-shrink: 0;
}

.sidebar-header-text h2 {
  font-size: var(--text-base);
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

.sidebar-header-text p {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.45);
  margin: 0;
}

.sidebar-section-label {
  padding: var(--space-4) var(--space-5) var(--space-2);
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.sidebar-nav { flex: 1; padding: var(--space-3) 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: var(--text-sm);
  border-left: 3px solid transparent;
  transition: all var(--duration-base);
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.sidebar-nav a.active {
  color: #fff;
  background: rgba(229,161,45,0.12);
  border-left-color: var(--clr-gold);
}

.sidebar-nav hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: var(--space-3) var(--space-5);
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: var(--space-4) var(--space-5);
}

.sidebar-footer a,
.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: rgba(255,255,255,0.55);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  transition: color var(--duration-base);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
}
.sidebar-footer a:hover,
.sidebar-footer button:hover { color: var(--clr-error); }

/* ── MAIN CONTENT AREA ───────────────────────────────── */

.admin-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 65px;
  background: #fff;
  border-bottom: 1px solid #E9ECEF;
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  gap: var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.admin-topbar-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--clr-text);
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--clr-text-mid);
}

.admin-topbar-user span {
  font-weight: var(--weight-semibold);
  color: var(--clr-text);
}

.admin-content {
  flex: 1;
  padding: var(--space-8);
  max-width: 1400px;
}

/* ── CONTENT PANELS ──────────────────────────────────── */

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
  animation: fade-in-up 0.35s var(--ease-out) both;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.panel-header h1 {
  font-size: var(--text-2xl);
  margin: 0;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ── ADMIN CARDS ─────────────────────────────────────── */

.admin-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid #E9ECEF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.admin-card__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid #E9ECEF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card__header h2 {
  font-size: var(--text-lg);
  margin: 0;
}

.admin-card__body {
  padding: var(--space-6);
}

/* ── DATA TABLE ──────────────────────────────────────── */

.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  background: #F8F9FA;
  border-bottom: 1px solid #E9ECEF;
}

.data-table td {
  padding: var(--space-4);
  border-bottom: 1px solid #F1F3F5;
  font-size: var(--text-sm);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: #FAFBFC; }

.data-table .col-thumb { width: 60px; }
.data-table .col-thumb img {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.data-table .col-title { max-width: 280px; }
.data-table .col-title strong {
  display: block;
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}
.data-table .col-title span { color: var(--clr-text-muted); font-size: var(--text-xs); }

.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table .col-actions .btn { margin-left: var(--space-2); }

.featured-star { color: var(--clr-gold); }
.status-badge { }

/* ── STAT CARDS (Dashboard) ──────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid #E9ECEF;
  padding: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.stat-card__icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card__icon--red   { background: rgba(201,93,74,0.1);  color: var(--clr-red); }
.stat-card__icon--gold  { background: rgba(229,161,45,0.1); color: var(--clr-gold-dark); }
.stat-card__icon--navy  { background: rgba(29,45,68,0.08);  color: var(--clr-navy); }
.stat-card__icon--green { background: rgba(46,125,50,0.1);  color: var(--clr-success); }

.stat-card__value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  color: var(--clr-text);
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-1);
}

/* ── ADMIN MODAL ─────────────────────────────────────── */

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
}

.admin-modal-backdrop.is-open { display: flex; }

.admin-modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  margin: auto;
  position: relative;
  animation: scale-in 0.3s var(--ease-spring);
}

.admin-modal-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid #E9ECEF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-header h2 { font-size: var(--text-xl); margin: 0; }

.admin-modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #F1F3F5;
  color: var(--clr-text-mid);
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  transition: background var(--duration-base), color var(--duration-base);
}
.admin-modal-close:hover { background: var(--clr-error); color: #fff; }

.admin-modal-body {
  padding: var(--space-8);
  max-height: 70vh;
  overflow-y: auto;
}

.admin-modal-footer {
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid #E9ECEF;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ── MEDIA MANAGER ───────────────────────────────────── */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
}

.media-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  aspect-ratio: 1;
  cursor: pointer;
  transition: border-color var(--duration-base);
}
.media-item.is-main { border-color: var(--clr-red); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }

.media-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity var(--duration-base);
}
.media-item:hover .media-item__overlay { opacity: 1; }

.media-item__overlay button {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-base);
}
.media-item__overlay button:hover { background: var(--clr-red); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-base), background var(--duration-base);
}
.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--clr-gold);
  background: rgba(229,161,45,0.04);
}
.upload-zone i { font-size: 2rem; color: var(--clr-text-muted); margin-bottom: var(--space-3); }
.upload-zone p { font-size: var(--text-sm); color: var(--clr-text-muted); margin: 0; }

/* Progress bar */
.upload-progress {
  display: none;
  height: 4px;
  background: var(--clr-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-3);
}
.upload-progress.visible { display: block; }
.upload-progress__bar {
  height: 100%;
  background: var(--clr-gold);
  border-radius: var(--radius-full);
  transition: width 0.2s linear;
  width: 0%;
}

/* ── REPEATABLE GROUP ────────────────────────────────── */

.repeatable-group { margin-bottom: var(--space-5); }

.repeatable-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  background: #F8F9FA;
  border-radius: var(--radius-md);
  border: 1px solid #E9ECEF;
}

.repeatable-item input,
.repeatable-item select { flex: 1; }

.repeatable-item .btn-remove {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(198,40,40,0.1);
  color: var(--clr-error);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: background var(--duration-base), color var(--duration-base);
}
.repeatable-item .btn-remove:hover { background: var(--clr-error); color: #fff; }

/* ── COMMENT MODERATION ──────────────────────────────── */

.comment-mod-item {
  padding: var(--space-5);
  border: 1px solid #E9ECEF;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  background: #fff;
}

.comment-mod-item.is-pending {
  border-color: #FFE58F;
  background: #FFFBE6;
}

.comment-mod-item.is-reported {
  border-color: var(--clr-error);
  background: rgba(198,40,40,0.04);
}

.comment-mod-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.comment-mod-author { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.comment-mod-meta   { font-size: var(--text-xs); color: var(--clr-text-muted); }
.comment-mod-text   { font-size: var(--text-sm); color: var(--clr-text-mid); line-height: var(--leading-base); margin-bottom: var(--space-4); }

.comment-mod-actions { display: flex; gap: var(--space-3); }

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: var(--z-modal);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

@media (max-width: 768px) {
  .admin-content { padding: var(--space-5); }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .admin-modal-body { max-height: 80vh; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ── SECTION VISIBILITY TOGGLES ──────────────────────── */

.section-vis-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}

.section-vis-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.section-vis-group-label {
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--space-1);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: #F8F9FA;
  border: 1px solid #E9ECEF;
  transition: background var(--duration-base);
}

.toggle-row:hover { background: #F1F3F5; }

.toggle-row.is-hidden {
  opacity: 0.55;
}

.toggle-label {
  font-size: var(--text-sm);
  color: var(--clr-text);
  user-select: none;
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 23px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E0;
  border-radius: 23px;
  transition: background 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-slider {
  background: #2E7D32;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(19px);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--clr-gold);
  outline-offset: 2px;
}

/* Drag and Drop Sorting Styles */
.is-dragging {
  opacity: 0.45;
  background: rgba(229,161,45,0.06) !important;
  outline: 1px dashed var(--clr-gold) !important;
}

tr[draggable="true"], .admin-card[draggable="true"] {
  user-select: none;
}

.drag-handle {
  color: var(--clr-text-muted);
  opacity: 0.35;
  cursor: grab;
  padding: 0 4px;
  display: inline-block;
  transition: opacity 0.2s, color 0.2s;
}

.drag-handle:hover {
  opacity: 0.85;
  color: var(--clr-gold);
}

/* Sidebar Count Badges */
.sidebar-nav a .nav-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--clr-gold);
  font-weight: 600;
  transition: background 0.25s, color 0.25s;
}

.sidebar-nav a:hover .nav-count {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

