/* ============================================================
   Agrobiz — Public Site Stylesheet
   Brand: #198754 (green) · #F4C430 (yellow)
   ============================================================ */

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  --ag-primary: #198754;
  --ag-primary-dark: #146c43;
  --ag-primary-light: #d1e7dd;
  --ag-secondary: #F4C430;
  --ag-secondary-dark: #d9ab1f;
  --ag-dark: #212529;
  --ag-light: #F8F9FA;
  --ag-border: #DEE2E6;
  --ag-text: #212529;
  --ag-text-muted: #6c757d;
  --ag-radius: 10px;
  --ag-radius-sm: 8px;
  --ag-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --ag-shadow: 0 4px 14px rgba(0,0,0,0.06);
  --ag-shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --ag-transition: 0.2s ease;
}

/* ─── Base ───────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ag-text);
  background: #fff;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ag-primary); text-decoration: none; transition: color var(--ag-transition); }
a:hover { color: var(--ag-primary-dark); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ag-text); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-ag-primary {
  background: var(--ag-primary);
  color: #fff;
  border: 1px solid var(--ag-primary);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--ag-radius-sm);
  transition: all var(--ag-transition);
}
.btn-ag-primary:hover,
.btn-ag-primary:focus {
  background: var(--ag-primary-dark);
  border-color: var(--ag-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(25,135,84,0.28);
}

.btn-ag-yellow {
  background: var(--ag-secondary);
  color: var(--ag-dark);
  border: 1px solid var(--ag-secondary);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--ag-radius-sm);
  transition: all var(--ag-transition);
}
.btn-ag-yellow:hover,
.btn-ag-yellow:focus {
  background: var(--ag-secondary-dark);
  border-color: var(--ag-secondary-dark);
  color: var(--ag-dark);
  box-shadow: 0 4px 12px rgba(244,196,48,0.4);
}

.btn-ag-outline {
  background: transparent;
  color: var(--ag-primary);
  border: 1px solid var(--ag-primary);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--ag-radius-sm);
  transition: all var(--ag-transition);
}
.btn-ag-outline:hover,
.btn-ag-outline:focus {
  background: var(--ag-primary);
  color: #fff;
  border-color: var(--ag-primary);
}

.btn-ag-outline-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--ag-radius-sm);
  transition: all var(--ag-transition);
}
.btn-ag-outline-light:hover,
.btn-ag-outline-light:focus {
  background: #fff;
  color: var(--ag-primary);
  border-color: #fff;
}

.btn-lg { padding: 12px 26px; font-size: 1rem; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

/* ─── Header ─────────────────────────────────────────────── */
.ag-header {
  background: #fff;
  border-bottom: 1px solid var(--ag-border);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--ag-shadow-sm);
}

.ag-navbar { padding: 10px 0; }

.ag-brand {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ag-dark) !important;
  letter-spacing: -0.3px;
}
.ag-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--ag-primary);
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}
.ag-brand-text { color: var(--ag-dark); }

.ag-navbar .nav-link {
  font-weight: 500;
  color: #495057;
  padding: 8px 14px;
  border-radius: var(--ag-radius-sm);
  transition: all var(--ag-transition);
}
.ag-navbar .nav-link:hover {
  color: var(--ag-primary);
  background: var(--ag-primary-light);
}
.ag-navbar .nav-link.active {
  color: var(--ag-primary);
  font-weight: 600;
}

.ag-nav-actions .btn {
  padding: 7px 16px;
  font-size: 0.9rem;
}

/* ─── Hero ───────────────────────────────────────────────── */
.ag-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  color: #fff;
  overflow: hidden;
  padding: 60px 0;
}
.ag-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(20,53,42,0.85) 0%, rgba(25,135,84,0.72) 55%, rgba(20,53,42,0.88) 100%),
              radial-gradient(circle at 20% 40%, rgba(244,196,48,0.15) 0%, transparent 60%),
              #14352a;
  z-index: 1;
}
.ag-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 30%, rgba(255,255,255,0.03) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(244,196,48,0.08) 0, transparent 50%);
}
.ag-hero .container { position: relative; z-index: 2; }
.ag-hero-inner { max-width: 780px; }

.ag-hero-badge {
  display: inline-block;
  background: rgba(244,196,48,0.15);
  color: var(--ag-secondary);
  border: 1px solid rgba(244,196,48,0.4);
  padding: 6px 14px;
  border-radius: 40px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}
.ag-hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.1;
  letter-spacing: -1px;
}
.ag-hero-tagline {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--ag-secondary);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.4px;
}
.ag-hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: rgba(255,255,255,0.9);
  max-width: 560px;
  margin-bottom: 30px;
}
.ag-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── Search box ─────────────────────────────────────────── */
.ag-search-wrap {
  margin-top: -60px;
  position: relative;
  z-index: 5;
  padding-bottom: 20px;
}
.ag-search-box {
  background: #fff;
  border-radius: var(--ag-radius);
  padding: 18px;
  box-shadow: var(--ag-shadow-lg);
  border: 1px solid var(--ag-border);
}
.ag-search-box .form-control,
.ag-search-box .form-select {
  height: 48px;
  border-radius: var(--ag-radius-sm);
  border: 1px solid var(--ag-border);
  font-size: 0.95rem;
}
.ag-search-box .form-control:focus,
.ag-search-box .form-select:focus {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 3px rgba(25,135,84,0.12);
}
.ag-search-box .btn { height: 48px; }

.ag-input-icon { position: relative; }
.ag-input-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ag-text-muted);
  font-size: 1rem;
  z-index: 2;
}
.ag-input-icon .form-control { padding-left: 40px; }

/* ─── Stats ──────────────────────────────────────────────── */
.ag-stats { margin-top: 20px; }
.ag-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--ag-shadow-sm);
}
.ag-stat i {
  font-size: 1.6rem;
  color: var(--ag-primary);
}
.ag-stat strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}
.ag-stat span {
  display: block;
  font-size: 0.78rem;
  color: var(--ag-text-muted);
}

/* ─── Sections ───────────────────────────────────────────── */
.ag-section { padding: 56px 0; }
.ag-section-alt { background: var(--ag-light); }

.ag-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.ag-section-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.4px;
}
.ag-section-link {
  color: var(--ag-primary);
  font-weight: 600;
  font-size: 0.92rem;
}
.ag-section-link:hover { color: var(--ag-primary-dark); }
.ag-section-link i { transition: transform var(--ag-transition); display: inline-block; }
.ag-section-link:hover i { transform: translateX(3px); }

/* ─── Category cards ─────────────────────────────────────── */
.ag-cat-card {
  display: block;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 20px 14px;
  text-align: center;
  color: var(--ag-text);
  transition: all var(--ag-transition);
  height: 100%;
}
.ag-cat-card:hover {
  border-color: var(--ag-primary);
  transform: translateY(-3px);
  box-shadow: var(--ag-shadow);
  color: var(--ag-primary);
}
.ag-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ag-primary-light);
  color: var(--ag-primary);
  font-size: 24px;
  margin-bottom: 12px;
  transition: all var(--ag-transition);
}
.ag-cat-card:hover .ag-cat-icon {
  background: var(--ag-primary);
  color: #fff;
}
.ag-cat-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.ag-cat-count {
  display: block;
  font-size: 0.78rem;
  color: var(--ag-text-muted);
}

/* ─── Country cards ──────────────────────────────────────── */
.ag-country-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  color: var(--ag-text);
  transition: all var(--ag-transition);
}
.ag-country-card:hover {
  border-color: var(--ag-primary);
  box-shadow: var(--ag-shadow-sm);
  color: var(--ag-primary);
}
.ag-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 28px;
  border-radius: 5px;
  background: var(--ag-primary-light);
  color: var(--ag-primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ag-country-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-country-count {
  font-size: 0.75rem;
  color: var(--ag-text-muted);
  flex-shrink: 0;
}

/* ─── Ad cards ───────────────────────────────────────────── */
.ag-ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
  transition: all var(--ag-transition);
  height: 100%;
}
.ag-ad-card:hover {
  border-color: var(--ag-primary);
  box-shadow: var(--ag-shadow);
  transform: translateY(-2px);
}
.ag-ad-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  background: #f1f3f5;
  background-size: cover;
  background-position: center;
  position: relative;
}

.ag-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.ag-badge-sell { background: var(--ag-primary); color: #fff; }
.ag-badge-buy  { background: #0d6efd; color: #fff; }
.ag-badge-featured { background: var(--ag-secondary); color: var(--ag-dark); }

.ag-badge-float {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}
.ag-badge-float-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.ag-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.92);
  color: #6c757d;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ag-transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ag-fav-btn:hover { background: #fff; color: #dc3545; transform: scale(1.05); }
.ag-fav-btn.is-active { background: #dc3545; color: #fff; }
.ag-badge-float-right + .ag-fav-btn { top: 10px; right: 10px; }

.ag-ad-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ag-ad-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ag-ad-title a { color: var(--ag-text); }
.ag-ad-title a:hover { color: var(--ag-primary); }

.ag-ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--ag-text-muted);
  margin-bottom: 10px;
}
.ag-ad-meta i { margin-right: 3px; }

.ag-ad-stats {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--ag-border);
  border-bottom: 1px dashed var(--ag-border);
  margin-bottom: 10px;
}
.ag-ad-qty,
.ag-ad-price { flex: 1; min-width: 0; }
.ag-ad-qty .ag-label,
.ag-ad-price .ag-label {
  display: block;
  font-size: 0.68rem;
  color: var(--ag-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.ag-ad-qty strong,
.ag-ad-price strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ag-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ag-ad-price strong { color: var(--ag-primary); }

.ag-ad-seller {
  font-size: 0.8rem;
  color: var(--ag-text-muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-ad-seller i { margin-right: 4px; }

.ag-ad-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.ag-ad-actions .btn { font-size: 0.8rem; padding: 6px 10px; }

/* ─── Split list (Sell / Buy) ────────────────────────────── */
.ag-split-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ag-split-head h3 {
  font-size: 1.1rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ag-split-head a {
  font-size: 0.85rem;
  font-weight: 600;
}

.ag-mini-list {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
}
.ag-mini-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ag-border);
  color: var(--ag-text);
  transition: background var(--ag-transition);
}
.ag-mini-item:last-child { border-bottom: 0; }
.ag-mini-item:hover { background: var(--ag-light); color: var(--ag-primary); }
.ag-mini-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #f1f3f5;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.ag-mini-body { flex: 1; min-width: 0; }
.ag-mini-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-mini-meta {
  display: block;
  font-size: 0.76rem;
  color: var(--ag-text-muted);
}
.ag-mini-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ag-primary);
  flex-shrink: 0;
}

/* ─── How it works ───────────────────────────────────────── */
.ag-hiw-panel {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 26px;
  height: 100%;
  box-shadow: var(--ag-shadow-sm);
}
.ag-hiw-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.ag-hiw-title i { color: var(--ag-primary); }
.ag-hiw-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.ag-hiw-steps li {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  font-size: 0.95rem;
  align-items: flex-start;
}
.ag-hiw-steps span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ag-primary-light);
  color: var(--ag-primary-dark);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ─── Benefits ───────────────────────────────────────────── */
.ag-benefit {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 22px;
  height: 100%;
  transition: all var(--ag-transition);
}
.ag-benefit:hover {
  border-color: var(--ag-primary);
  box-shadow: var(--ag-shadow);
}
.ag-benefit i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--ag-primary-light);
  color: var(--ag-primary);
  font-size: 22px;
  margin-bottom: 14px;
}
.ag-benefit h4 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.ag-benefit p {
  color: var(--ag-text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.5;
}

/* ─── CTA band ───────────────────────────────────────────── */
.ag-cta-band {
  background: linear-gradient(135deg, var(--ag-primary) 0%, var(--ag-primary-dark) 100%);
  color: #fff;
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.ag-cta-band::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(244,196,48,0.12);
}
.ag-cta-band .container { position: relative; z-index: 1; }
.ag-cta-band h2 {
  color: #fff;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin-bottom: 8px;
}
.ag-cta-band p {
  color: rgba(255,255,255,0.9);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

/* ─── Page head ──────────────────────────────────────────── */
.ag-page-title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.ag-page-head { margin-bottom: 20px; }

.ag-breadcrumb {
  font-size: 0.85rem;
}
.ag-breadcrumb .breadcrumb-item a { color: var(--ag-text-muted); }
.ag-breadcrumb .breadcrumb-item a:hover { color: var(--ag-primary); }
.ag-breadcrumb .breadcrumb-item.active { color: var(--ag-text); }

/* ─── Filter panel ───────────────────────────────────────── */
.ag-filter-panel {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 18px;
}
.ag-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ag-border);
  font-size: 1rem;
}
.ag-filter-head a { font-size: 0.8rem; }

.ag-filter-group { margin-bottom: 16px; }
.ag-filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ag-filter-panel .form-control,
.ag-filter-panel .form-select {
  font-size: 0.88rem;
  border-radius: var(--ag-radius-sm);
}

/* ─── Toolbar ────────────────────────────────────────────── */
.ag-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ag-light);
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  margin-bottom: 16px;
}

/* ─── Empty states ───────────────────────────────────────── */
.ag-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--ag-light);
  border: 1px dashed var(--ag-border);
  border-radius: var(--ag-radius);
  color: var(--ag-text-muted);
}
.ag-empty i {
  font-size: 3rem;
  color: var(--ag-border);
  display: block;
  margin-bottom: 14px;
}
.ag-empty h4 {
  color: var(--ag-text);
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.ag-empty-sm {
  text-align: center;
  padding: 32px 16px;
  color: var(--ag-text-muted);
}
.ag-empty-sm i {
  font-size: 2rem;
  color: var(--ag-border);
  display: block;
  margin-bottom: 10px;
}

/* ─── Advertisement detail ───────────────────────────────── */
.ag-detail-head { margin-bottom: 18px; }
.ag-detail-title {
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 800;
  margin: 8px 0 10px;
  line-height: 1.2;
}
.ag-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--ag-text-muted);
}
.ag-detail-meta i { margin-right: 4px; }

.ag-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  background: var(--ag-light);
  color: var(--ag-text);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--ag-border);
}
.ag-chip:hover { color: var(--ag-primary); border-color: var(--ag-primary); }
.ag-chip-success { background: var(--ag-primary-light); color: var(--ag-primary-dark); border-color: transparent; }

/* ─── Gallery ────────────────────────────────────────────── */
.ag-gallery { margin-bottom: 8px; }
.ag-gallery-main {
  width: 100%;
  aspect-ratio: 16/10;
  background: #f1f3f5;
  border-radius: var(--ag-radius);
  overflow: hidden;
  border: 1px solid var(--ag-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ag-gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.ag-thumb {
  flex: 0 0 80px;
  height: 80px;
  border-radius: 6px;
  border: 2px solid transparent;
  overflow: hidden;
  background: #f1f3f5;
  padding: 0;
  cursor: pointer;
  transition: border-color var(--ag-transition);
}
.ag-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ag-thumb:hover { border-color: var(--ag-primary-light); }
.ag-thumb.active { border-color: var(--ag-primary); }

/* ─── Facts grid ─────────────────────────────────────────── */
.ag-facts { margin-top: 16px; }
.ag-fact {
  background: var(--ag-light);
  border-radius: var(--ag-radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--ag-border);
  height: 100%;
}
.ag-fact-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ag-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ag-fact strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  word-break: break-word;
}

/* ─── Panels ─────────────────────────────────────────────── */
.ag-panel {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 22px;
}
.ag-panel-title {
  font-size: 1.1rem;
  margin-bottom: 14px;
  font-weight: 700;
}
.ag-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ag-panel-link {
  font-size: 0.85rem;
  color: var(--ag-primary);
  font-weight: 600;
}

.ag-description {
  color: #343a40;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ─── Seller panel ───────────────────────────────────────── */
.ag-seller-panel {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 22px;
  box-shadow: var(--ag-shadow-sm);
  top: 90px;
}
.ag-seller-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ag-border);
  margin-bottom: 16px;
}
.ag-seller-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f1f3f5;
  object-fit: cover;
  flex-shrink: 0;
}
.ag-seller-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ag-primary-light);
  color: var(--ag-primary);
  font-size: 24px;
}
.ag-seller-name { font-weight: 700; font-size: 1.05rem; }
.ag-seller-type { color: var(--ag-text-muted); font-size: 0.82rem; }

.ag-seller-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #495057;
}
.ag-seller-info i { color: var(--ag-text-muted); margin-right: 6px; width: 16px; text-align: center; }

.ag-seller-contact { border-top: 1px dashed var(--ag-border); padding-top: 14px; margin-bottom: 12px; }
.ag-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  color: var(--ag-text);
  font-weight: 500;
  font-size: 0.92rem;
}
.ag-contact-row:hover { color: var(--ag-primary); }
.ag-contact-row i { color: var(--ag-primary); font-size: 1.05rem; width: 20px; text-align: center; }

/* ─── Contact list (sidebar) ─────────────────────────────── */
.ag-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ag-contact-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--ag-border);
  font-size: 0.9rem;
}
.ag-contact-list li:last-child { border-bottom: 0; }
.ag-contact-list i {
  color: var(--ag-primary);
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.ag-contact-list strong {
  display: block;
  font-size: 0.75rem;
  color: var(--ag-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

/* ─── Category panel (categories.php) ────────────────────── */
.ag-cat-panel {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
  height: 100%;
}
.ag-cat-panel-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--ag-border);
}
.ag-cat-panel-head .ag-cat-icon { margin-bottom: 0; width: 48px; height: 48px; font-size: 22px; }
.ag-cat-panel-title {
  font-size: 1.1rem;
  margin: 0 0 2px;
}
.ag-cat-panel-title a { color: var(--ag-text); }
.ag-cat-panel-title a:hover { color: var(--ag-primary); }
.ag-cat-panel-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ag-subchip {
  display: inline-block;
  padding: 5px 12px;
  background: var(--ag-light);
  border: 1px solid var(--ag-border);
  border-radius: 18px;
  font-size: 0.8rem;
  color: #495057;
  transition: all var(--ag-transition);
}
.ag-subchip:hover {
  background: var(--ag-primary);
  color: #fff;
  border-color: var(--ag-primary);
}

/* ─── Country search ─────────────────────────────────────── */
.ag-search-inline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  padding: 0 14px;
  transition: border-color var(--ag-transition), box-shadow var(--ag-transition);
}
.ag-search-inline:focus-within {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 3px rgba(25,135,84,0.12);
}
.ag-search-inline i { color: var(--ag-text-muted); font-size: 1rem; }
.ag-search-inline .form-control {
  border: 0;
  box-shadow: none !important;
  padding: 12px 0;
  background: transparent;
}
.ag-search-inline .form-control:focus { box-shadow: none; }

/* ─── About page ─────────────────────────────────────────── */
.ag-about-hero { padding: 20px 0 30px; max-width: 780px; }
.ag-about-hero h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 8px; }
.ag-about-hero .lead { color: var(--ag-primary); font-weight: 600; }

.ag-stat-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 24px;
  text-align: center;
  height: 100%;
  box-shadow: var(--ag-shadow-sm);
}
.ag-stat-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ag-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.ag-stat-card span {
  color: var(--ag-text-muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Legal pages ────────────────────────────────────────── */
.ag-legal { line-height: 1.75; }
.ag-legal h2 {
  font-size: 1.15rem;
  margin: 26px 0 10px;
}
.ag-legal p, .ag-legal li { color: #343a40; font-size: 0.95rem; }
.ag-legal ul { padding-left: 20px; }

/* ─── Error page ─────────────────────────────────────────── */
.ag-error-page { padding: 60px 20px; }
.ag-error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  color: var(--ag-primary);
  line-height: 1;
  letter-spacing: -3px;
}
.ag-error-title {
  font-size: 1.5rem;
  margin: 16px 0 8px;
}

/* ─── Auth pages ─────────────────────────────────────────── */
.ag-auth-wrap {
  padding: 40px 0 60px;
  min-height: calc(100vh - 200px);
  background: var(--ag-light);
}
.ag-auth-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 14px;
  padding: 34px 30px;
  box-shadow: var(--ag-shadow);
  max-width: 640px;
  margin: 0 auto;
}
.ag-auth-head { text-align: center; margin-bottom: 26px; }
.ag-auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.ag-auth-brand .ag-brand-mark { width: 44px; height: 44px; font-size: 22px; }
.ag-auth-brand .ag-brand-text { font-size: 1.3rem; font-weight: 800; }
.ag-auth-title {
  font-size: 1.5rem;
  margin-bottom: 6px;
  font-weight: 800;
}
.ag-auth-sub {
  color: var(--ag-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.ag-form-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--ag-border);
}
.ag-form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.ag-form-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ag-primary);
  margin-bottom: 14px;
  font-weight: 700;
}
.ag-form-actions { padding-top: 22px; }

.ag-radio-tile {
  text-align: center;
  font-size: 0.88rem;
  padding: 10px 8px;
  transition: all var(--ag-transition);
}
.btn-check:checked + .ag-radio-tile {
  background: var(--ag-primary);
  color: #fff;
  border-color: var(--ag-primary);
}

.ag-big-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 14px;
  text-align: center;
}
.ag-big-tile i { font-size: 1.8rem; margin-bottom: 4px; }
.ag-big-tile strong { font-size: 1rem; }
.ag-big-tile span { font-size: 0.78rem; opacity: 0.7; }
.btn-check:checked + .ag-big-tile {
  background: var(--ag-primary);
  color: #fff;
  border-color: var(--ag-primary);
}

.ag-password-field { position: relative; }
.ag-password-field .form-control { padding-right: 44px; }
.ag-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--ag-text-muted);
  font-size: 1rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}
.ag-password-toggle:hover { color: var(--ag-primary); background: var(--ag-light); }

/* ─── Dashboard ──────────────────────────────────────────── */
.ag-dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.ag-dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ag-stat-tile {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 14px;
  height: 100%;
  transition: all var(--ag-transition);
}
.ag-stat-tile:hover { box-shadow: var(--ag-shadow-sm); }
.ag-stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--ag-primary-light);
  color: var(--ag-primary);
  flex-shrink: 0;
}
.ag-stat-tile-success .ag-stat-icon { background: #d1e7dd; color: #0f5132; }
.ag-stat-tile-warning .ag-stat-icon { background: #fff3cd; color: #997404; }
.ag-stat-tile-danger  .ag-stat-icon { background: #f8d7da; color: #842029; }

.ag-stat-body strong { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.ag-stat-body span   { display: block; color: var(--ag-text-muted); font-size: 0.82rem; }

.ag-quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--ag-light);
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius-sm);
  color: var(--ag-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--ag-transition);
}
.ag-quick-btn:hover {
  background: #fff;
  border-color: var(--ag-primary);
  color: var(--ag-primary);
  box-shadow: var(--ag-shadow-sm);
}
.ag-quick-btn i { color: var(--ag-primary); font-size: 1.05rem; width: 20px; text-align: center; }

.ag-recent-list { display: flex; flex-direction: column; }
.ag-recent-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ag-border);
  align-items: center;
}
.ag-recent-item:last-child { border-bottom: 0; }
.ag-recent-thumb {
  width: 48px; height: 48px;
  border-radius: 6px;
  background: #f1f3f5;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.ag-recent-body { flex: 1; min-width: 0; }
.ag-recent-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ag-text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-recent-title:hover { color: var(--ag-primary); }
.ag-recent-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.72rem;
}
.ag-recent-actions { flex-shrink: 0; }

.ag-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ag-activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ag-border);
}
.ag-activity-item:last-child { border-bottom: 0; }
.ag-activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ag-border);
  margin-top: 8px;
  flex-shrink: 0;
}
.ag-activity-item.is-unread .ag-activity-dot { background: var(--ag-primary); }
.ag-activity-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.ag-activity-title a { color: var(--ag-text); }
.ag-activity-title a:hover { color: var(--ag-primary); }
.ag-activity-msg { font-size: 0.8rem; color: var(--ag-text-muted); margin-bottom: 2px; }
.ag-activity-time { font-size: 0.72rem; color: var(--ag-text-muted); }

/* ─── Tabs (my advertisements) ───────────────────────────── */
.ag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--ag-border);
  padding-bottom: 0;
}
.ag-tab {
  padding: 10px 16px;
  color: #495057;
  font-weight: 600;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  transition: all var(--ag-transition);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.ag-tab:hover { color: var(--ag-primary); }
.ag-tab.is-active { color: var(--ag-primary); border-color: var(--ag-primary); }
.ag-tab-count {
  background: var(--ag-light);
  color: var(--ag-text-muted);
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.ag-tab.is-active .ag-tab-count { background: var(--ag-primary-light); color: var(--ag-primary-dark); }

/* ─── Tables ─────────────────────────────────────────────── */
.ag-table-wrap {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
}
.ag-table {
  margin: 0;
  font-size: 0.9rem;
}
.ag-table thead th {
  background: var(--ag-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #495057;
  font-weight: 700;
  padding: 12px;
  border-bottom: 1px solid var(--ag-border);
  white-space: nowrap;
}
.ag-table tbody td { padding: 12px; vertical-align: middle; }
.ag-table-thumb {
  width: 46px; height: 46px;
  border-radius: 6px;
  background: #f1f3f5;
  background-size: cover;
  background-position: center;
}
.ag-table-title { font-weight: 600; color: var(--ag-text); }
.ag-table-title:hover { color: var(--ag-primary); }

/* ─── Mobile ad card ─────────────────────────────────────── */
.ag-mob-ad {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 12px;
}
.ag-mob-ad-thumb {
  width: 88px; height: 88px;
  border-radius: 6px;
  background: #f1f3f5;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.ag-mob-ad-body { flex: 1; min-width: 0; }
.ag-mob-ad-title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ag-text);
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-mob-ad-title:hover { color: var(--ag-primary); }
.ag-mob-ad-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.ag-mob-ad-actions { display: flex; gap: 6px; }

/* ─── Upload drop zone ───────────────────────────────────── */
.ag-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 20px;
  border: 2px dashed var(--ag-border);
  border-radius: var(--ag-radius);
  cursor: pointer;
  background: var(--ag-light);
  text-align: center;
  transition: all var(--ag-transition);
}
.ag-upload-drop:hover { border-color: var(--ag-primary); background: var(--ag-primary-light); }
.ag-upload-drop i { font-size: 2.2rem; color: var(--ag-primary); }
.ag-upload-drop strong { font-size: 0.95rem; color: var(--ag-text); }
.ag-upload-drop span { font-size: 0.8rem; color: var(--ag-text-muted); }

.ag-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ag-image-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f3f5;
  border: 1px solid var(--ag-border);
}
.ag-image-item img { width: 100%; height: 100%; object-fit: cover; }
.ag-image-primary-badge {
  position: absolute;
  top: 4px; left: 4px;
  background: var(--ag-secondary);
  color: var(--ag-dark);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.ag-image-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ag-image-remove:hover { background: #dc3545; }

/* ─── Tips panel ─────────────────────────────────────────── */
.ag-tips-panel { top: 90px; }
.ag-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ag-tips-list li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: #495057;
  line-height: 1.5;
}
.ag-tips-list i { color: var(--ag-primary); flex-shrink: 0; margin-top: 3px; }

/* ─── Profile page ───────────────────────────────────────── */
.ag-profile-head {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 24px;
  margin-bottom: 20px;
}
.ag-profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ag-primary-light);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ag-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ag-profile-avatar-fallback {
  font-size: 36px;
  font-weight: 700;
  color: var(--ag-primary-dark);
}
.ag-profile-avatar-sm { width: 72px; height: 72px; }
.ag-profile-avatar-sm .ag-profile-avatar-fallback { font-size: 28px; }

.ag-profile-info { flex: 1; min-width: 220px; }
.ag-profile-name { font-size: 1.5rem; margin: 0 0 8px; font-weight: 800; }
.ag-profile-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-profile-bio { color: #343a40; font-size: 0.95rem; margin: 0; }

.ag-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-profile-image-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ag-border);
}

.ag-profile-stats {
  display: flex;
  gap: 24px;
}
.ag-profile-stats > div { text-align: center; flex: 1; }
.ag-profile-stats strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ag-primary);
  line-height: 1;
}
.ag-profile-stats span { font-size: 0.8rem; color: var(--ag-text-muted); }

/* ─── Settings ───────────────────────────────────────────── */
.ag-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  padding: 8px;
  position: sticky;
  top: 90px;
}
.ag-settings-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--ag-radius-sm);
  color: #495057;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--ag-transition);
}
.ag-settings-link:hover { background: var(--ag-light); color: var(--ag-primary); }
.ag-settings-link.active { background: var(--ag-primary-light); color: var(--ag-primary-dark); font-weight: 600; }

/* ─── Thread list (messages) ─────────────────────────────── */
.ag-thread-list {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
}
.ag-thread-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--ag-border);
  position: relative;
}
.ag-thread-item:last-child { border-bottom: 0; }
.ag-thread-item.is-unread { background: #f0f9f4; }
.ag-thread-item:hover { background: var(--ag-light); }

.ag-thread-main {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  flex: 1;
  color: var(--ag-text);
  min-width: 0;
}
.ag-thread-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ag-primary-light);
  color: var(--ag-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.ag-thread-avatar img { width: 100%; height: 100%; object-fit: cover; }

.ag-thread-body { flex: 1; min-width: 0; }
.ag-thread-name { font-weight: 700; font-size: 0.95rem; }
.ag-thread-time { color: var(--ag-text-muted); font-size: 0.75rem; flex-shrink: 0; }
.ag-thread-ad {
  font-size: 0.78rem;
  color: var(--ag-primary);
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-thread-ad a { color: var(--ag-primary); }
.ag-thread-preview {
  color: var(--ag-text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-thread-badge {
  background: var(--ag-primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 700;
  margin-right: 12px;
  align-self: center;
}
.ag-thread-delete {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-left: 1px solid var(--ag-border);
}
.ag-thread-delete button {
  background: transparent;
  border: 0;
  color: var(--ag-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 8px;
  border-radius: 6px;
}
.ag-thread-delete button:hover { color: #dc3545; background: rgba(220,53,69,0.08); }

/* ─── Conversation ───────────────────────────────────────── */
.ag-conv-wrap {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}
.ag-conv-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ag-border);
  background: #fff;
}
.ag-conv-back {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ag-light);
  color: var(--ag-text);
}
.ag-conv-back:hover { background: var(--ag-primary-light); color: var(--ag-primary); }

.ag-conv-ad {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ag-light);
  color: var(--ag-text);
  border-bottom: 1px solid var(--ag-border);
  font-size: 0.85rem;
}
.ag-conv-ad:hover { background: var(--ag-primary-light); color: var(--ag-primary-dark); }

.ag-conv-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: var(--ag-light);
  min-height: 300px;
}
.ag-conv-empty {
  text-align: center;
  color: var(--ag-text-muted);
  padding: 40px 20px;
}
.ag-conv-empty i { font-size: 2.5rem; color: var(--ag-border); display: block; margin-bottom: 8px; }

.ag-conv-date {
  text-align: center;
  margin: 14px 0;
}
.ag-conv-date span {
  background: rgba(0,0,0,0.05);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--ag-text-muted);
  font-weight: 600;
}
.ag-conv-msg { display: flex; margin-bottom: 10px; }
.ag-conv-msg.is-mine { justify-content: flex-end; }
.ag-conv-msg.is-theirs { justify-content: flex-start; }
.ag-conv-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.ag-conv-msg.is-mine .ag-conv-bubble {
  background: var(--ag-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ag-conv-msg.is-theirs .ag-conv-bubble {
  background: #fff;
  color: var(--ag-text);
  border: 1px solid var(--ag-border);
  border-bottom-left-radius: 4px;
}
.ag-conv-time {
  font-size: 0.68rem;
  opacity: 0.7;
  text-align: right;
  margin-top: 3px;
}

.ag-conv-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--ag-border);
  background: #fff;
}
.ag-conv-compose .form-control {
  resize: none;
  border-radius: var(--ag-radius-sm);
  font-size: 0.92rem;
}
.ag-conv-compose .btn { height: 44px; flex-shrink: 0; }

/* ─── Notifications ──────────────────────────────────────── */
.ag-noti-list {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: var(--ag-radius);
  overflow: hidden;
}
.ag-noti-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ag-border);
  align-items: flex-start;
}
.ag-noti-item:last-child { border-bottom: 0; }
.ag-noti-item.is-unread { background: #f0f9f4; }
.ag-noti-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ag-primary-light);
  color: var(--ag-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ag-noti-body { flex: 1; min-width: 0; }
.ag-noti-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.ag-noti-title a { color: var(--ag-text); }
.ag-noti-title a:hover { color: var(--ag-primary); }
.ag-noti-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--ag-primary);
  border-radius: 50%;
  margin-left: 6px;
}
.ag-noti-msg { font-size: 0.85rem; color: var(--ag-text-muted); margin-bottom: 4px; }
.ag-noti-time { font-size: 0.75rem; color: var(--ag-text-muted); }
.ag-noti-del button {
  background: transparent;
  border: 0;
  color: var(--ag-text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.ag-noti-del button:hover { color: #dc3545; background: rgba(220,53,69,0.08); }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--ag-radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 0.88rem; color: #343a40; margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: var(--ag-radius-sm);
  border: 1px solid var(--ag-border);
  font-size: 0.92rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 3px rgba(25,135,84,0.12);
}
.form-text { font-size: 0.78rem; color: var(--ag-text-muted); }

/* ─── Footer ─────────────────────────────────────────────── */
.ag-footer {
  background: #14352a;
  color: #bcd6ca;
  margin-top: 40px;
}
.ag-footer-top { padding: 50px 0 30px; }
.ag-footer-brand {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
}
.ag-footer-tagline {
  color: var(--ag-secondary);
  font-weight: 600;
  margin: 10px 0 12px;
}
.ag-footer-about {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #9dbcae;
  margin-bottom: 16px;
}
.ag-social {
  display: flex;
  gap: 8px;
}
.ag-social a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ag-transition);
}
.ag-social a:hover { background: var(--ag-primary); color: #fff; }

.ag-footer-title {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.ag-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ag-footer-links li { margin-bottom: 8px; }
.ag-footer-links a {
  color: #9dbcae;
  font-size: 0.85rem;
  transition: color var(--ag-transition);
}
.ag-footer-links a:hover { color: #fff; }

.ag-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
  font-size: 0.82rem;
  color: #9dbcae;
}
.ag-footer-meta { color: #9dbcae; }

/* ─── Modal ──────────────────────────────────────────────── */
.ag-modal {
  border-radius: 14px;
  border: 0;
  box-shadow: var(--ag-shadow-lg);
}

/* ─── Utility ────────────────────────────────────────────── */
.sticky-lg-top { z-index: 10; }

.form-feedback { font-size: 0.82rem; }
.ag-form-feedback.is-error { color: #dc3545; }
.ag-form-feedback.is-success { color: var(--ag-primary); }