:root {
  --black: #0a0a0a;
  --black2: #111111;
  --black3: #1a1a1a;
  --card-bg: #161616;
  --red: #e8142a;
  --red-dark: #b80f20;
  --white: #ffffff;
  --white70: rgba(255, 255, 255, 0.7);
  --white40: rgba(255, 255, 255, 0.4);
  --white10: rgba(255, 255, 255, 0.08);
  --gold: #d4a847;
  --green: #22c55e;
  --orange: #f97316;
  --blue: #3b82f6;
  --purple: #a855f7;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.admin-layout {
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR NAV */
.admin-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--black2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.nav-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.nav-logo span {
  color: var(--red);
}

.nav-logo small {
  display: block;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  color: var(--white40);
  letter-spacing: 0;
  font-weight: 400;
  margin-top: 2px;
}

.nav-section {
  padding: 12px 12px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--white40);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--white70);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 8px;
  font-size: 13px;
}

.nav-item:hover {
  background: var(--white10);
  color: var(--white);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(232, 20, 42, 0.15);
  color: var(--red);
}

.nav-item .icon {
  font-size: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
}

.nav-spacer {
  flex: 1;
}

.nav-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-user-info {
  flex: 1;
  min-width: 0;
}

.nav-user-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-role {
  font-size: 10px;
  color: var(--white40);
}

/* MAIN CONTENT */
.admin-main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOP BAR */
.topbar {
  background: var(--black2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  flex: 1;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.form-action {
  padding: 10px 0px;
}
.btn {
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  justify-content: center;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-secondary {
  background: var(--white10);
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-icon {
  padding: 7px 10px;
  font-size: 14px;
}

.btn-green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-orange {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.btn-red {
  background: rgba(232, 20, 42, 0.15);
  color: var(--red);
  border: 1px solid rgba(232, 20, 42, 0.3);
}

/* CONTENT */
.content {
  padding: 24px;
}

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--white40);
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
}

.stat-up {
  color: var(--green);
}

.stat-down {
  color: var(--red);
}

/* SECTION */
.admin-section {
  margin-bottom: 24px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section-title .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* TABLE */
.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white10);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  flex: 1;
  max-width: 300px;
}

.table-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  flex: 1;
}

.table-search input::placeholder {
  color: var(--white40);
}

.table-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 4px 10px;
  background: var(--white10);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  color: var(--white70);
}

.filter-chip.active {
  background: rgba(232, 20, 42, 0.2);
  border-color: var(--red);
  color: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white40);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

tr:hover td {
  background: var(--white10);
}

.td-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.td-name .emoji {
  font-size: 18px;
}

.td-city {
  font-size: 12px;
  color: var(--white70);
}

.td-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-sponsored {
  background: rgba(212, 168, 71, 0.2);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 71, 0.3);
}

.badge-featured {
  background: rgba(232, 20, 42, 0.2);
  color: var(--red);
  border: 1px solid rgba(232, 20, 42, 0.3);
}

.badge-deal {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-new {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white40);
  border: 1px solid var(--border);
}

.td-rating {
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}

.td-actions {
  display: flex;
  gap: 10px;
}

.td-toggle {
  cursor: pointer;
  font-size: 18px;
}

/* TOGGLE SWITCH */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: 0.2s;
}

.toggle input:checked+.toggle-slider {
  background: var(--green);
}

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

/* AD BANNERS */
.ads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ad-manage-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-preview {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.ad-preview-1 {
  background: linear-gradient(135deg, #1a0008, #6b0015);
}

.ad-preview-2 {
  background: linear-gradient(135deg, #0a1628, #1a3a6b);
}

.ad-preview-3 {
  background: linear-gradient(135deg, #1a1200, #6b4a00);
}

.ad-preview-empty {
  background: var(--black3);
  border: 2px dashed var(--border);
  justify-content: center;
  color: var(--white40);
  flex-direction: column;
  text-align: center;
}

.ad-preview-name {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
}

.ad-preview-sub {
  font-size: 10px;
  color: var(--white70);
}

.ad-manage-body {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-manage-info {
  flex: 1;
  font-size: 12px;
}

.ad-manage-info strong {
  display: block;
  font-size: 13px;
  margin-bottom: 1px;
}

.ad-manage-info span {
  color: var(--white40);
  font-size: 11px;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--black2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  /* max-width: 560px; */
  /* max-height: 90vh; */
  overflow-y: auto;
}
.modal .modal-content {
    background: var(--black2);
  border: 1px solid var(--border);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.modal-close {
  background: var(--white10);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: var(--white);
  cursor: pointer;
  font-size: 16px;
}

.modal-body {
  padding: 20px 24px;
}
.form-group {
  margin-bottom: 10px;
  margin-top: 10px;
}

.form-row {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white40);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--white10);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--red);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select option {
  background: #1a1a1a;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0px;
}


.form-checkboxes li {
  padding: 10px 0px;
  list-style-type: none;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
    padding: 10px 0px;

}

.form-checkbox input {
  accent-color: var(--red);
  width: 14px;
  height: 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* DEALS GRID */
.deals-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.deal-admin-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 10px;
}

.deal-emoji {
  font-size: 28px;
}

.deal-info {
  flex: 1;
}

.deal-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.deal-meta {
  font-size: 11px;
  color: var(--white40);
  margin-bottom: 6px;
}

.deal-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deal-tag-badge {
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
}

.deal-discount {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--green);
}

.deal-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

/* RESPONSIVE */
@media (max-width:900px) {
  .admin-nav {
    display: none;
  }
  .admin-nav.open {
    display: block;
  }
  .admin-main {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ads-grid,
  .deals-admin-grid {
    grid-template-columns: 1fr;
  }
}

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

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 8px 10px;
  }
}

/* TABS */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--white40);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-tab:hover {
  color: var(--white);
}

.admin-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #000;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  display: none;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.logo-img {
  height: 28px;
  display: block;
}

/* PAGINATION */
nav.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

nav.pagination ul {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

nav.pagination .page-item {
  display: inline-block;
}

nav.pagination .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: var(--white10);
  border: 1px solid var(--border);
  color: var(--white70);
  transition: all 0.2s ease;
}

nav.pagination .page-link:hover {
  background: var(--white10);
  border-color: var(--red);
  color: var(--white);
  transform: translateY(-1px);
}

nav.pagination .page-item.active .page-link,
nav.pagination .page-link.current-page {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(232, 20, 42, 0.2);
}

nav.pagination .page-item.disabled .page-link {
  opacity: 0.3;
  pointer-events: none;
}

nav.pagination .gap .page-link {
  border: none;
  background: transparent;
  color: var(--white40);
  pointer-events: none;
}
.modal-body .nav {
  display: flex;
}
.modal-body .tab-content {
  border: 1px solid #ccc;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}
.tab-pane .gallery-thumb{ opacity:1;}

/* FORM WRAPPERS FOR EDIT/NEW */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form-header {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.form-header h4 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* MISC */
.pull-right { float: right; }
.margin-top-0 { margin-top: 0 !important; }
.margin-top-25 { margin-top: 25px !important; }
.margin-top-20 { margin-top: 20px !important; }
.margin-bottom-0 { margin-bottom: 0 !important; }
.gray { color: var(--white40) !important; }

/* QUICK EDIT PREVIEW */
.quick-edit {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--red);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(232, 20, 42, 0.3);
  z-index: 100;
  transition: transform 0.2s;
}

.quick-edit:hover {
  transform: scale(1.1);
}

.quick-edit a {
  color: inherit;
  font-size: 20px;
}



.admin-main .sp-card {
  max-width: 300px;
}
