/**
 * PROMPT 208 — Offers & Campaigns admin + homepage banner polish
 * Apple/SaaS marketing — not cheap ads. No payment logic.
 */
:root {
  --oc-green: #059669;
  --oc-amber: #d97706;
  --oc-red: #dc2626;
  --oc-purple: #7c3aed;
  --oc-orange: #ea580c;
  --oc-blue: #2563eb;
  --oc-radius: 18px;
  --oc-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  --oc-shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.oc-page {
  max-width: 1200px;
  font-family: 'Vazirmatn', Vazir, Tahoma, system-ui, sans-serif;
  color: #0f172a;
}
.oc-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f172a 0%, #4c1d95 45%, #7c3aed 100%);
  color: #f8fafc;
  box-shadow: 0 16px 40px rgba(76, 29, 149, 0.28);
  margin-bottom: 16px;
}
.oc-hero__main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}
.oc-hero__ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.oc-hero h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 800;
}
.oc-hero p {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.92;
  line-height: 1.55;
  max-width: 36rem;
}
.oc-hero__note {
  margin-top: 8px !important;
  font-size: 0.72rem !important;
  opacity: 0.75 !important;
}
.oc-hero__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.oc-chip {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.oc-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 800px) {
  .oc-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.oc-kpi {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: var(--oc-radius);
  padding: 14px;
  text-align: right;
  cursor: pointer;
  box-shadow: var(--oc-shadow);
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.oc-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--oc-shadow-lg);
}
.oc-kpi span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
}
.oc-kpi b {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}
.oc-kpi--ok {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #ecfdf5, #fff);
}
.oc-kpi--warn {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb, #fff);
}
.oc-kpi--muted {
  border-color: #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.oc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 1000px) {
  .oc-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  }
}
.oc-list__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.oc-list__bar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.oc-list__bar select {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  min-height: 40px;
  background: #fff;
}

.oc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 700px) {
  .oc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.oc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--oc-radius);
  padding: 16px;
  box-shadow: var(--oc-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.oc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--oc-shadow-lg);
}
.oc-card--premium {
  background: linear-gradient(160deg, #faf5ff 0%, #fff 55%);
  border-color: #ddd6fe;
}
.oc-card--urgent {
  background: linear-gradient(160deg, #fff7ed 0%, #fff 55%);
  border-color: #fed7aa;
}
.oc-card--educational {
  background: linear-gradient(160deg, #eff6ff 0%, #fff 55%);
  border-color: #bfdbfe;
}
.oc-card--minimal {
  background: #fff;
}
.oc-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.oc-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}
.oc-card__title {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}
.oc-card__desc {
  margin: 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.55;
}
.oc-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.oc-card__metrics > div {
  flex: 1 1 30%;
  min-width: 5rem;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  text-align: center;
}
.oc-card__metrics b {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
}
.oc-card__metrics span {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
}
.oc-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.oc-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.oc-badge--ok {
  background: #dcfce7;
  color: #166534;
}
.oc-badge--warn {
  background: #fef3c7;
  color: #92400e;
}
.oc-badge--muted {
  background: #f1f5f9;
  color: #475569;
}
.oc-badge--bad {
  background: #fee2e2;
  color: #991b1b;
}

.oc-btn {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: #334155;
}
.oc-btn:hover {
  border-color: #c4b5fd;
  color: #5b21b6;
}
.oc-btn--primary {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-color: transparent;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}
.oc-btn--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.oc-btn--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.oc-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--oc-radius);
  padding: 16px;
  box-shadow: var(--oc-shadow);
  margin-bottom: 12px;
}
.oc-panel h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}
.oc-muted {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0 0 10px;
}
.oc-analytics-empty {
  text-align: center;
  padding: 20px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}
.oc-analytics-empty strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}
.oc-analytics-empty p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.55;
}

.oc-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oc-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}
.oc-form input,
.oc-form select,
.oc-form textarea {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 11px;
  font: inherit;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
}
.oc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 600px) {
  .oc-form-row {
    grid-template-columns: 1fr;
  }
}
.oc-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.oc-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.oc-tech {
  font-size: 0.72rem;
  color: #64748b;
}
.oc-tech summary {
  cursor: pointer;
  font-weight: 800;
}
.oc-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}
.oc-empty {
  text-align: center;
  padding: 36px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--oc-radius);
  background: #fff;
  grid-column: 1 / -1;
}
.oc-empty .ico {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

/* ========== Homepage announcement bar (above hero, below nav) ========== */
.pe208-announcement {
  position: relative;
  z-index: 40;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}
.pe208-announcement[hidden],
.pe208-announcement.is-dismissed {
  display: none !important;
}
.pe208-announcement__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  direction: rtl;
}
.pe208-announcement__text {
  flex: 1 1 220px;
  min-width: 0;
}
.pe208-announcement__kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.pe208-announcement__sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  opacity: 0.92;
  line-height: 1.45;
}
.pe208-announcement__meta {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
}
.pe208-announcement__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pe208-announcement__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.pe208-announcement__cta:hover {
  transform: translateY(-1px);
}
.pe208-announcement__close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pe208-announcement__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Styles */
.pe208-announcement--premium {
  background: linear-gradient(90deg, #4c1d95 0%, #6d28d9 40%, #2563eb 100%);
  color: #f8fafc;
}
.pe208-announcement--premium .pe208-announcement__cta {
  background: #fff;
  color: #5b21b6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.pe208-announcement--urgent {
  background: linear-gradient(90deg, #9a3412 0%, #ea580c 45%, #dc2626 100%);
  color: #fff7ed;
}
.pe208-announcement--urgent .pe208-announcement__cta {
  background: #fff;
  color: #c2410c;
}
.pe208-announcement--educational {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
  color: #eff6ff;
}
.pe208-announcement--educational .pe208-announcement__cta {
  background: #fff;
  color: #1d4ed8;
}
.pe208-announcement--minimal {
  background: #0f172a;
  color: #f1f5f9;
}
.pe208-announcement--minimal .pe208-announcement__cta {
  background: #22c55e;
  color: #052e16;
}

/* Body offset optional — banner is in-flow, not fixed, so hero is not covered */
body.pe208-has-announcement {
  /* in-flow bar: no padding needed */
}

@media (max-width: 640px) {
  .pe208-announcement__inner {
    padding: 12px 14px;
  }
  .pe208-announcement__actions {
    width: 100%;
    justify-content: space-between;
  }
  .pe208-announcement__cta {
    flex: 1;
  }
}

/* Upgrade legacy pe-offer-banner (after-hero) if still used */
.pe-offer-banner {
  margin: 0;
  border-radius: 0;
}
