/* =====================================================
   Pjoor.ir - Main Stylesheet
   Brand: #0B3D91 (navy) | #FF7A00 (orange) | #F5F7FA (bg)
   ===================================================== */

:root {
  --primary: #0B3D91;
  --primary-dark: #082d6b;
  --primary-light: #1a4fa8;
  --secondary: #FF7A00;
  --secondary-dark: #e66e00;
  --white: #FFFFFF;
  --bg: #F5F7FA;
  --text: #1a1a2e;
  --muted: #6c757d;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(11, 61, 145, 0.08);
  --shadow-lg: 0 10px 40px rgba(11, 61, 145, 0.12);
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  direction: rtl;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary); }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-sm { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.header {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 12px;
  position: relative;
}
.header-inner .logo { flex-shrink: 0; }
.header-inner .nav { flex: 1; justify-content: center; }
.header-inner .header-actions { flex-shrink: 0; margin-right: 0; margin-left: 0; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.logo img { height: 40px; width: auto; }
.logo .dot { color: var(--secondary); }

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

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  background: rgba(11, 61, 145, 0.08);
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(11, 61, 145, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(11, 61, 145, 0.35);
  color: var(--white);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.25);
}
.btn-secondary:hover {
  transform: translateY(-1px);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none; border: none;
  cursor: pointer; padding: 8px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--primary); margin: 5px 0;
  border-radius: 2px; transition: var(--transition);
}

/* ---------- Cards & Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(11, 61, 145, 0.1);
}

.stat-card .icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(11, 61, 145, 0.08);
  color: var(--primary);
}
.stat-card.orange .icon { background: rgba(255, 122, 0, 0.12); color: var(--secondary); }
.stat-card.green .icon { background: rgba(16, 185, 129, 0.12); color: var(--success); }

.stat-card .number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.stat-card.orange .number { color: var(--secondary); }
.stat-card .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0a2f6e 100%);
  color: var(--white);
  padding: 48px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 200px; height: 200px;
  background: var(--secondary);
  border-radius: 50%;
  opacity: 0.15;
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}
.hero p { opacity: 0.9; font-size: 1rem; max-width: 520px; margin-bottom: 24px; }
.hero .btn-secondary { margin-top: 8px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  margin: 24px auto;
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}
.form-group label .req { color: var(--secondary); }

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border var(--transition), box-shadow var(--transition);
  background: var(--white);
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.12);
}
textarea.form-control { min-height: 120px; resize: vertical; }

.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.input-group {
  display: flex;
  gap: 0;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ---------- Ad Cards ---------- */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.ad-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}
.ad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ad-card .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  background: linear-gradient(145deg, #e8eef6 0%, #f5f7fa 100%);
  position: relative;
  overflow: hidden;
}
.ad-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.35s ease;
}
.ad-card:hover .thumb img {
  transform: scale(1.04);
}
.ad-card .thumb.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #c5cdd8;
}
.ad-card .thumb .badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--secondary);
  color: var(--white);
}

.ad-card .body { padding: 16px; }
.ad-card .title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-card .price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.ad-card .meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Status badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
th, td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th {
  background: rgba(11, 61, 145, 0.04);
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(11, 61, 145, 0.02); }

/* ---------- Dashboard Sidebar ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin: 24px 0;
  min-height: 60vh;
}

.sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 0;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border-right: 3px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(11, 61, 145, 0.06);
  color: var(--primary);
  border-right-color: var(--primary);
}

.dash-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Share buttons ---------- */
.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  color: var(--white);
  transition: transform var(--transition);
}
.share-btn:hover { transform: scale(1.03); color: var(--white); }
.share-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.share-btn.wa { background: #25D366; }
.share-btn.bale { background: #00ADEF; }
.share-btn.tg { background: #0088cc; }
.share-btn.copy { background: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 32px 0 20px;
  margin-top: 48px;
  font-size: 13px;
}
.footer a { color: rgba(255,255,255,0.9); }
.footer a:hover { color: var(--secondary); }
.footer-bottom {
  text-align: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  opacity: 0.7;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
}
.tab.active, .tab:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px; right: 0; left: 0;
    background: var(--white);
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    gap: 4px;
  }
  .nav.open { display: flex; }
  .nav-link { width: 100%; text-align: right; }

  .dash-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
  }
  .sidebar-link {
    white-space: nowrap;
    border-right: none;
    border-bottom: 3px solid transparent;
    padding: 10px 14px;
    font-size: 13px;
  }
  .sidebar-link.active { border-bottom-color: var(--primary); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 10px; }
  .stat-card .number { font-size: 1.4rem; }

  .ads-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 16px; }
  .dash-content { padding: 16px; }
  .page-title { font-size: 1.15rem; }
  .hero { padding: 36px 0 44px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .btn { padding: 9px 14px; font-size: 13px; }
}

/* ---------- Form helpers ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---------- Ad detail ---------- */
.ad-detail-image-wrap {
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #e8eef6 0%, #f5f7fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: min(70vh, 520px);
}
.ad-detail-image {
  width: 100%;
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
  object-position: center;
  display: block;
}
.ad-detail-card > .ad-detail-image-wrap img.ad-detail-image {
  width: 100%;
  max-height: min(70vh, 520px);
  object-fit: contain;
}
@media (max-width: 768px) {
  .ad-detail-image-wrap {
    max-height: min(55vh, 360px);
    min-height: 140px;
  }
  .ad-detail-image,
  .ad-detail-card > .ad-detail-image-wrap img.ad-detail-image {
    max-height: min(55vh, 360px);
  }
  .ad-card .thumb {
    aspect-ratio: 16 / 11;
  }
  .ads-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .ad-card .body { padding: 10px 12px; }
  .ad-card .title { font-size: 13px; }
  .ad-card .price { font-size: 14px; }

}
@media (min-width: 992px) {
  .ad-detail-image-wrap {
    max-height: 480px;
  }
  .ad-detail-image,
  .ad-detail-card > .ad-detail-image-wrap img.ad-detail-image {
    max-height: 480px;
  }
}
.ad-detail-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}
.ad-detail-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 12px;
}
.ad-detail-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.ad-detail-desc {
  line-height: 1.9;
  margin-bottom: 24px;
  white-space: pre-wrap;
}
.ad-contact-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.ad-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ad-contact-icon {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 10px;
  flex-shrink: 0;
}
.ad-contact-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.ad-contact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.ad-custom-fields {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 16px;
}
.ad-custom-item {
  font-size: 14px;
  margin-bottom: 6px;
}
.ad-custom-label {
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Admin Sidebar ---------- */
.admin-sidebar {
  padding: 0;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.sidebar-brand-icon { font-size: 1.2rem; }
.sidebar-nav { padding: 12px 0; }
.admin-sidebar .sidebar-link {
  border-right: 3px solid transparent;
  position: relative;
}
.admin-sidebar .sidebar-link .si { width: 22px; text-align: center; }
.sidebar-badge {
  background: var(--secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-right: auto;
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

/* ---------- Admin Dashboard ---------- */
.admin-dash { background: transparent; box-shadow: none; padding: 0; }
.dash-date { font-size: 13px; font-weight: 400; color: var(--muted); }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.admin-stat-card.highlight {
  border-color: rgba(255, 122, 0, 0.3);
  background: linear-gradient(135deg, #fff 60%, rgba(255,122,0,0.06));
}
.admin-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.admin-stat-icon.users { background: rgba(11,61,145,0.1); }
.admin-stat-icon.pending { background: rgba(255,122,0,0.12); }
.admin-stat-icon.published { background: rgba(16,185,129,0.12); }
.admin-stat-icon.total { background: rgba(11,61,145,0.08); }
.admin-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.admin-stat-label {
  font-size: 13px;
  color: var(--muted);
}
.admin-stat-sub {
  font-size: 11px;
  color: var(--success);
  margin-top: 2px;
}
.admin-stat-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  display: inline-block;
  margin-top: 2px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.admin-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.admin-card-body { padding: 20px; }

.pending-list { display: flex; flex-direction: column; }
.pending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.pending-item:last-child { border-bottom: none; }
.pending-item:hover { background: rgba(11,61,145,0.02); }
.pending-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.pending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.pending-info { flex: 1; min-width: 0; }
.pending-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pending-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  text-align: center;
}
.quick-action span { font-size: 1.5rem; }
.quick-action:hover {
  background: rgba(11,61,145,0.08);
  color: var(--primary);
  transform: translateY(-2px);
}

/* ---------- Responsive admin ---------- */
@media (max-width: 992px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-stat-card { padding: 14px; gap: 10px; }
  .admin-stat-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .admin-stat-num { font-size: 1.3rem; }
  .admin-sidebar .sidebar-brand { display: none; }
  .admin-sidebar .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
  }
  .admin-sidebar .sidebar-link {
    white-space: nowrap;
    border-right: none;
    border-bottom: 3px solid transparent;
    padding: 10px 12px;
    font-size: 12px;
  }
  .admin-sidebar .sidebar-link.active { border-bottom-color: var(--primary); }
  .sidebar-divider { display: none; }
  .sidebar-badge { margin-right: 4px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-2 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }


/* ---------- Header actions & Notification Bell ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.notif-wrap { position: relative; z-index: 1100; }
.notif-bell {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  outline: none;
  box-shadow: 0 1px 4px rgba(11,61,145,0.06);
}
.notif-bell svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.notif-bell:hover,
.notif-bell.has-unread,
.notif-bell[aria-expanded="true"] {
  background: rgba(11, 61, 145, 0.12);
  color: var(--primary);
}
.notif-bell.ring { animation: notif-ring 0.65s ease; }
@keyframes notif-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
}
.notif-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--secondary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(255,122,0,0.4);
  pointer-events: none;
}
.notif-badge.show { display: flex; }

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 360px;
  max-width: min(360px, calc(100vw - 16px));
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(11, 61, 145, 0.18);
  border: 1px solid var(--border);
  z-index: 2000;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown[hidden] { display: none !important; }

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,61,145,0.04);
  gap: 8px;
}
.notif-dropdown-header strong {
  font-size: 14px;
  color: var(--primary);
  white-space: nowrap;
}
.notif-header-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notif-read-all,
.notif-see-all {
  border: none;
  background: none;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-decoration: none;
}
.notif-read-all:hover,
.notif-see-all:hover { text-decoration: underline; color: var(--secondary-dark); }

.notif-list {
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(11,61,145,0.04); }
.notif-item.unread {
  background: rgba(255,122,0,0.05);
  border-right: 3px solid var(--secondary);
}
.notif-item.read { opacity: 0.72; }
.notif-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  line-height: 1.5;
}
.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.notif-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}
.notif-msg {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.notif-empty,
.notif-loading {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* صفحه کامل اعلان‌ها */
.notif-page-list { display: flex; flex-direction: column; gap: 0; }
.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.notif-page-item.unread { background: rgba(255,122,0,0.04); margin: 0 -16px; padding: 14px 16px; border-radius: 8px; }
.notif-page-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* موبایل: دراپ‌داون تمام‌عرض زیر هدر */
@media (max-width: 768px) {
  .header-inner .nav {
    /* handled by existing absolute menu */
  }
  .header-actions { margin-right: auto; }
  .notif-dropdown {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: calc(100vh - 64px);
    display: none;
    flex-direction: column;
  }
  .notif-dropdown.open {
    display: flex;
  }
  .notif-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }
  .notif-page-item {
    flex-wrap: wrap;
  }
  .notif-page-actions {
    width: 100%;
    margin-top: 8px;
    padding-right: 40px;
  }
}

@media (max-width: 600px) {
  .notif-bell { width: 38px; height: 38px; }
  .notif-dropdown-header { padding: 10px 14px; }
}

/* ---------- Fix dash forms & layout ---------- */

.dash-content .form-group { margin-bottom: 18px; }
.dash-content .form-control {
  width: 100%;
  max-width: 100%;
}
.dash-content form .btn { margin-top: 4px; }
.ad-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .ad-form .form-row { grid-template-columns: 1fr; }
}

/* اطمینان از نمایش صحیح سایدبار و محتوا */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin: 24px 0;
  min-height: 60vh;
  align-items: start;
}
.dash-content {
  min-width: 0;
  overflow: hidden;
}
.admin-dash {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; }
}


/* ---------- تذکر امنیتی آگهی ---------- */
.ad-detail-card .ad-disclaimer,
.form-card .ad-disclaimer,
div.ad-disclaimer {
  display: flex !important;
  gap: 14px;
  align-items: flex-start;
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: 16px;
  background-color: #0B3D91;
  background-image: linear-gradient(135deg, #0B3D91 0%, #1557b0 40%, #FF7A00 100%);
  color: #ffffff !important;
  box-shadow: 0 10px 28px rgba(11, 61, 145, 0.28), 0 2px 8px rgba(255, 122, 0, 0.15);
  position: relative;
  overflow: hidden;
  border: none;
}
.ad-detail-card .ad-disclaimer::before,
div.ad-disclaimer::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 70%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.ad-disclaimer-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.ad-disclaimer-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  color: #ffffff !important;
}
.ad-disclaimer-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff !important;
}
.ad-disclaimer-text {
  font-size: 13.5px;
  line-height: 1.8;
  font-weight: 500;
  color: rgba(255,255,255,0.95) !important;
}
.ad-disclaimer-text br { display: block; content: ''; margin-top: 4px; }

/* ---------- چک‌باکس قوانین ---------- */
.terms-box {
  background: rgba(11, 61, 145, 0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.terms-label {
  align-items: flex-start !important;
  gap: 10px !important;
  font-size: 13px;
  line-height: 1.7;
  cursor: pointer;
}
.terms-label input { margin-top: 4px; flex-shrink: 0; }

.share-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}
.share-btn.eitaa {
  background: #f57c00;
  color: #fff;
}
.share-btn.eitaa:hover { filter: brightness(1.08); color: #fff; }

@media (max-width: 600px) {
  .ad-disclaimer { padding: 14px; gap: 10px; }
  .ad-disclaimer-title { font-size: 14px; }
  .ad-disclaimer-text { font-size: 12.5px; }
}


/* ---------- سهمیه آگهی ---------- */
.quota-box {
  margin: 0 0 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11,61,145,0.08) 0%, rgba(255,122,0,0.1) 100%);
  border: 1px solid rgba(11,61,145,0.12);
  overflow: hidden;
}
.quota-box-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.quota-icon { font-size: 1.6rem; line-height: 1; }
.quota-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.6;
}
.quota-ok { color: #059669; font-weight: 800; }
.quota-end { color: #dc2626; font-weight: 800; }
@media (max-width: 600px) {
  .quota-box-inner { padding: 12px 14px; gap: 10px; }
  .quota-meta { font-size: 12px; }
}

.sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar-version {
  margin-top: auto;
  padding: 12px 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-version {
  opacity: 0.85;
  font-size: 12px;
}
