/* ==========================================================================
   FAZI — Artist CMS & Admin Dashboard Stylesheet
   Vercel / Stripe / Linear — Light, Minimal, Precise
   RTL Persian Admin
   ========================================================================== */

:root {
  --admin-bg: #F9FAFB;
  --admin-surface: #FFFFFF;
  --admin-sidebar-bg: #FFFFFF;
  --admin-sidebar-text: #374151;
  --admin-sidebar-hover: #F3F4F6;
  --admin-sidebar-active: #F3F4F6;
  --admin-sidebar-active-bg: #F3F4F6;
  --admin-sidebar-active-text: #111827;
  --admin-primary: #111827;
  --admin-accent: #7C3AED;
  --admin-text: #111827;
  --admin-text-muted: #6B7280;
  --admin-border: #E5E7EB;
  --admin-success: #059669;
  --admin-danger: #DC2626;
  --admin-warning: #D97706;
  --admin-font: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body.admin-body {
  font-family: var(--admin-font);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--admin-text);
  background-color: var(--admin-bg);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================= ADMIN LAYOUT ================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ================= SIDEBAR ================= */
.admin-sidebar {
  width: 260px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--admin-sidebar-text);
  border-left: 1px solid rgba(229, 231, 235, 0.5); /* subtle border */
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: transform 0.3s ease;
}

.sidebar-brand:hover {
  transform: scale(1.02);
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--admin-accent), #9333ea);
  color: #FFFFFF;
  border-radius: 10px; /* softer rounded */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.sidebar-brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-text {
  font-weight: 800;
  font-size: 1rem;
  color: var(--admin-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.sidebar-nav {
  padding: 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
  max-height: calc(100vh - 74px);
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9CA3AF;
  padding: 1rem 0.75rem 0.3rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--admin-sidebar-text);
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.nav-item:hover {
  background-color: var(--admin-sidebar-hover);
  color: var(--admin-sidebar-active-text);
}

.nav-item.active {
  background-color: var(--admin-sidebar-active-bg);
  color: var(--admin-sidebar-active-text);
  font-weight: 600;
  border-right: 2px solid var(--admin-accent);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--admin-text-muted);
}

.nav-item.active .nav-icon {
  color: var(--admin-accent);
}

.nav-logout {
  color: #EF4444;
  margin-top: 0.5rem;
}

.nav-logout .nav-icon {
  color: #EF4444;
}

.nav-logout:hover {
  background-color: #FEF2F2;
  color: #EF4444;
}

.badge-count {
  margin-right: auto;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  line-height: 1.4;
}

.sidebar-spacer {
  flex-grow: 1;
  min-height: 1rem;
}

/* ================= MAIN CONTENT ================= */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ================= TOPBAR ================= */
.admin-topbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 80;
  transition: all 0.3s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--admin-text-muted);
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.topbar-menu-btn:hover {
  background-color: var(--admin-bg);
  color: var(--admin-text);
}

.topbar-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-view-site {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--admin-text-muted);
  border: 1px solid var(--admin-border);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.topbar-view-site:hover {
  color: var(--admin-primary);
  background: var(--admin-sidebar-hover);
  border-color: transparent;
  transform: translateY(-1px);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-user:hover {
  background: var(--admin-sidebar-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #111827, #374151);
  color: #FFFFFF;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border: none;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-primary);
  padding-left: 0.5rem;
}

/* ================= CONTENT WRAP ================= */
.admin-content-wrap {
  padding: 2rem;
  flex-grow: 1;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: var(--admin-font);
}

.btn-primary {
  background-color: var(--admin-primary);
  color: #FFFFFF;
  border-color: var(--admin-primary);
}

.btn-primary:hover {
  background-color: #1F2937;
  border-color: #1F2937;
}

.btn-outline {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.btn-outline:hover {
  border-color: #9CA3AF;
  background-color: #F9FAFB;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 5px;
}

.btn-block {
  width: 100%;
}

/* ================= ADMIN CARDS ================= */
.admin-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: 12px; /* rounded-xl */
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.admin-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 0.75rem;
}

.card-box-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--admin-text);
}

.card-action-link {
  font-size: 0.8125rem;
  color: var(--admin-accent);
  font-weight: 600;
}

/* ================= TOP ACTION BAR ================= */
.page-top-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.subpage-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--admin-text);
}

.count-pill {
  background: #F3F4F6;
  border: 1px solid var(--admin-border);
  padding: 0.1rem 0.55rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-right: 0.5rem;
}

.action-bar-right {
  display: flex;
  gap: 0.6rem;
}

.header-desc {
  color: var(--admin-text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* ================= STATS GRID ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  flex-shrink: 0;
}

.bg-blue { background: var(--admin-bg); }
.bg-green { background: var(--admin-bg); }
.bg-purple { background: var(--admin-bg); }
.bg-amber { background: var(--admin-bg); }

.stat-label {
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
  font-weight: 500;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--admin-text);
  font-family: 'Inter', var(--admin-font);
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
}

/* ================= DASHBOARD SPLIT ================= */
.dashboard-columns {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.25rem;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-accent);
  margin-top: 7px;
  flex-shrink: 0;
}

.timeline-action {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--admin-text);
  background: #F3F4F6;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.timeline-detail {
  font-size: 0.8125rem;
  color: var(--admin-text);
  margin: 0.15rem 0;
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--admin-text-muted);
}

/* ================= TABLES ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  background-color: var(--admin-bg);
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--admin-border);
  text-align: right;
  font-weight: 600;
  color: var(--admin-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
  color: var(--admin-text);
}

.table-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--admin-border);
}

.thumb-empty {
  width: 44px;
  height: 44px;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--admin-text-muted);
  border-radius: 4px;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.status-badge.published {
  background: #D1FAE5;
  color: #065F46;
}

.status-badge.draft {
  background: #FEF3C7;
  color: #92400E;
}

.badge-toggle {
  background: none;
  border: 1px solid var(--admin-border);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--admin-font);
}

.badge-toggle.active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  font-weight: 700;
}

.table-action-group {
  display: flex;
  gap: 0.35rem;
}

.action-btn {
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  cursor: pointer;
  color: var(--admin-text);
  font-family: var(--admin-font);
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: #9CA3AF;
  background: var(--admin-bg);
}

.action-btn.trash {
  color: var(--admin-danger);
}

.action-btn.trash:hover {
  background: #FEE2E2;
  border-color: #FECACA;
}

/* ================= TOOLBAR & FILTERS ================= */
.admin-toolbar-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.form-control-sm {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.8125rem;
  outline: none;
  background: var(--admin-surface);
  color: var(--admin-text);
  font-family: var(--admin-font);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control-sm:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.filter-actions {
  display: flex;
  gap: 0.45rem;
  margin-right: auto;
}

/* ================= FORMS ================= */
.form-container-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 2rem;
}

.form-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
}

.admin-grid-form {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 2.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.form-row {
  display: flex;
  gap: 1.1rem;
}

.col-6 { flex: 1; }
.col-4 { flex: 1; }

.form-label {
  font-size: 0.8375rem;
  font-weight: 600;
  color: var(--admin-text);
}

.req { color: var(--admin-danger); }

.form-control {
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--admin-surface);
  color: var(--admin-text);
  outline: none;
  font-family: var(--admin-font);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.side-box {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}

.side-box-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 0.5rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8375rem;
  cursor: pointer;
  color: var(--admin-text);
}

.form-submit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ================= DROPZONE ================= */
.image-dropzone {
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  background: var(--admin-bg);
  position: relative;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background-color 0.2s;
}

.image-dropzone:hover, .image-dropzone.dragover {
  border-color: var(--admin-accent);
  background: #FAF5FF;
}

.dropzone-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.upload-icon {
  color: var(--admin-text-muted);
  margin-bottom: 0.6rem;
}

.upload-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-text);
}

.upload-sub {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
}

.dropzone-preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* ================= SECTIONS BUILDER ================= */
.section-builder-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.section-builder-card.disabled-section {
  opacity: 0.55;
  background: var(--admin-bg);
}

.builder-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  background: var(--admin-bg);
  border-bottom: 1px solid var(--admin-border);
}

.header-drag-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.drag-handle {
  color: var(--admin-text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
}

.sec-key-badge {
  font-size: 0.7rem;
  background: #F3F4F6;
  border: 1px solid var(--admin-border);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.sec-display-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--admin-text);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.order-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--admin-text-muted);
}

.order-input {
  width: 50px;
  padding: 0.25rem 0.4rem;
  text-align: center;
  border: 1px solid var(--admin-border);
  border-radius: 5px;
  font-family: var(--admin-font);
}

/* Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: 0.25s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--admin-success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.builder-card-body {
  padding: 1.25rem;
}

.sticky-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--admin-primary);
  color: #FFFFFF;
  padding: 0.875rem 1.5rem;
  margin-top: 2rem;
  border-radius: 8px 8px 0 0;
  z-index: 50;
}

.save-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

/* ================= MEDIA GRID VIEW ================= */
.media-grid-view {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.media-item-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}

.media-item-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.media-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--admin-bg);
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-badge-folder {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(17, 24, 39, 0.7);
  color: #FFFFFF;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.media-card-details {
  padding: 0.7rem;
  flex-grow: 1;
}

.media-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--admin-text);
}

.media-card-actions {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-bg);
}

.media-folder-filters {
  display: flex;
  gap: 0.45rem;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.folder-chip {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-size: 0.8125rem;
  background: var(--admin-surface);
  cursor: pointer;
  color: var(--admin-text);
  transition: all 0.15s;
}

.folder-chip.active {
  background: var(--admin-primary);
  color: #FFFFFF;
  border-color: var(--admin-primary);
}

/* ================= THEME PRESETS SELECTOR ================= */
.presets-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.preset-card-option {
  position: relative;
  cursor: pointer;
}

.preset-card-option input {
  position: absolute;
  opacity: 0;
}

.preset-card-content {
  border: 2px solid var(--admin-border);
  border-radius: 8px;
  padding: 1.1rem;
  transition: all 0.2s;
  height: 100%;
}

.preset-card-option input:checked + .preset-card-content {
  border-color: var(--admin-accent);
  background: #FAF5FF;
}

.preset-palette-preview {
  display: flex;
  gap: 4px;
  height: 18px;
  margin-bottom: 0.8rem;
}

.preset-palette-preview span {
  flex: 1;
  border-radius: 3px;
}

.minimal-white-preview span:nth-child(1) { background: #F9FAFB; border: 1px solid #D1D5DB; }
.minimal-white-preview span:nth-child(2) { background: #111827; }
.minimal-white-preview span:nth-child(3) { background: #7C3AED; }

.warm-gallery-preview span:nth-child(1) { background: #F5F2EB; border: 1px solid #E5E7EB; }
.warm-gallery-preview span:nth-child(2) { background: #44403C; }
.warm-gallery-preview span:nth-child(3) { background: #C2410C; }

.dark-exhibition-preview span:nth-child(1) { background: #0D0D0E; }
.dark-exhibition-preview span:nth-child(2) { background: #E5E7EB; }
.dark-exhibition-preview span:nth-child(3) { background: #7C3AED; }

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8125rem;
}

.picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.picker-input-wrap input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
}

.hex-input {
  width: 100px;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.toast {
  background: #111827;
  color: #FFFFFF;
  padding: 0.8rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.25s ease;
  min-width: 280px;
  max-width: 380px;
}

.toast.success {
  border-right: 3px solid var(--admin-success);
}

.toast.error {
  border-right: 3px solid var(--admin-danger);
}

.toast.warning {
  border-right: 3px solid var(--admin-warning);
}

@keyframes slideIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ================= LOGIN PAGE ================= */
.login-body {
  background-color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background-color: #1E293B;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 2.5rem;
  box-shadow: 0 20px 48px rgba(0,0,0,0.45);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-title {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: #FFFFFF;
}

.brand-sub {
  font-size: 0.8125rem;
  color: #94A3B8;
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 0.8375rem;
  margin-bottom: 1.5rem;
}

.alert-danger {
  background: #450A0A;
  border: 1px solid #7F1D1D;
  color: #FCA5A5;
}

.alert-success {
  background: #064E3B;
  border: 1px solid #065F46;
  color: #A7F3D0;
}

.login-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.8125rem;
}

.back-link {
  color: #94A3B8;
  transition: color 0.15s;
}

.back-link:hover {
  color: #FFFFFF;
}

/* Login page form controls get dark theme */
.login-body .form-control {
  background: #0F172A;
  border-color: #334155;
  color: #E2E8F0;
}

.login-body .form-control:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.login-body .form-label {
  color: #CBD5E1;
}

.login-body .btn-primary {
  background-color: var(--admin-accent);
  border-color: var(--admin-accent);
}

.login-body .btn-primary:hover {
  background-color: #6D28D9;
  border-color: #6D28D9;
}

/* ================= RESPONSIVE ADMIN (The Overhaul) ================= */

/* Sidebar Backdrop */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90; /* Just below sidebar (100) */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-sidebar-backdrop.visible {
  display: block;
  opacity: 1;
}

/* Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px; /* soft rounded corners */
  margin-bottom: 1rem;
}
.admin-table {
  min-width: 600px; /* Force minimum width to enable horizontal scroll on small screens */
}

/* Actionable Elements Polish */
.btn, .nav-item, .sidebar-logo-mark {
  transition: all 0.3s ease;
}
.btn {
  border-radius: 8px; /* soft rounded corners */
}
.btn:active {
  transform: scale(0.97);
}

/* Base Grids */
.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1280px) {
  .stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* TABLET & MOBILE (< 1024px) */
@media (max-width: 1024px) {
  /* Smart Sidebar (Off-Canvas Drawer) */
  .admin-sidebar {
    position: fixed;
    top: 0;
    right: -280px; /* hidden by default */
    height: 100vh;
    width: 280px;
    box-shadow: none;
    z-index: 100;
  }
  .admin-sidebar.open {
    right: 0;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15); /* subtle shadow for premium feel */
  }
  .sidebar-close-btn {
    display: flex;
    padding: 0.5rem; /* Touch friendly */
  }
  .topbar-menu-btn {
    display: flex;
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--admin-bg);
  }
  .topbar-menu-btn:active {
    background: var(--admin-sidebar-hover);
  }

  /* Fluid Main Workspace */
  .admin-main {
    width: 100%;
    margin-right: 0; /* No sidebar offset */
  }
  
  .stats-grid, .stats-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .admin-grid-form {
    grid-template-columns: 1fr;
  }
  .media-grid-view {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* gap-6 */
  }
}

/* MOBILE (< 768px) */
@media (max-width: 768px) {
  .admin-content-wrap {
    padding: 1rem;
  }
  .dashboard-hero-bar {
    flex-direction: column;
    padding: 1.25rem;
  }
  .stats-grid, .stats-grid-5 {
    grid-template-columns: 1fr;
  }
  
  /* Dynamic Grid System for Media / Images */
  .media-grid-view {
    grid-template-columns: repeat(2, 1fr); /* grid-cols-2 on mobile */
    gap: 1rem; /* gap-4 */
  }
  .media-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  .media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  /* Contact & Form layouts */
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  /* Touch-friendly buttons */
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
  .btn-sm {
    padding: 0.5rem 0.75rem;
  }
  
  /* Topbar title adjustment */
  .topbar-page-title {
    font-size: 1.1rem;
  }
}

/* SMALL MOBILE (< 480px) */
@media (max-width: 480px) {
  .media-grid-view {
    /* Even on smallest mobile, keep 2 columns if requested, or stack if too tight.
       The prompt asked for "grid-cols-2 on mobile", so we stick to it for images. */
    grid-template-columns: repeat(2, 1fr);
  }
}

.dashboard-hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
}

.welcome-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 0.3rem;
}

.welcome-text p {
  font-size: 0.875rem;
  color: var(--admin-text-muted);
  max-width: 560px;
  line-height: 1.6;
}

.quick-action-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bg-teal { background: var(--admin-bg); }

.mb-4 { margin-bottom: 1.5rem; }
.mb-2 { margin-bottom: 0.75rem; }

.text-danger { color: var(--admin-danger); }
.font-semibold { font-weight: 600; }
