:root {
  --bg: #07111f;
  --bg-2: #1d4ed8;
  --accent: #2563eb;
  --accent-2: #22c55e;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.25);
  --card: rgba(255, 255, 255, 0.95);
  --danger: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 45%, #38bdf8 100%);
  color: var(--text);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hero-card,
.panel-card,
.form-card,
.list-card,
.auth-card,
.dashboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(2, 8, 23, 0.16);
  backdrop-filter: blur(12px);
}

.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-card h1,
.hero-card h2,
.auth-card h2,
.form-card h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.hero-card p,
.auth-card p,
.form-card p,
.list-card p,
.dashboard-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(34, 197, 94, 0.16));
  color: var(--accent);
  font-weight: 700;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.select-control,
input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: var(--text);
  font: inherit;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn.secondary {
  background: linear-gradient(90deg, #7c3aed, #8b5cf6);
}

.btn.danger {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.panel-card {
  padding: 20px;
  margin-bottom: 20px;
}

.info-box {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(34, 197, 94, 0.08));
  color: #1e3a8a;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.flash-box,
.error-box {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.flash-box {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-box {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.15), rgba(248, 113, 113, 0.14));
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.24);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.map-card,
.form-card,
.list-card,
.dashboard-card,
.auth-card {
  padding: 24px;
}

.map-shell {
  position: relative;
}

#map {
  height: 60vh;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  overflow: hidden;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(7, 17, 31, 0.55);
  color: #fff;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.map-loading.active {
  opacity: 1;
}

form label {
  display: block;
  margin-top: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.card-list {
  display: grid;
  gap: 14px;
}

.entry-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.entry-card h3,
.entry-card h2 {
  margin: 0 0 8px;
}

.entry-card.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), #ffffff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-size: 0.95rem;
  font-weight: 700;
}

.entry-card.unread {
  border-color: rgba(220, 38, 38, 0.35);
}

.entry-card.viewed {
  opacity: 0.9;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.report-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-state-badge.unread {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.report-state-badge.viewed {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.media img,
.media video {
  max-width: 100%;
  border-radius: 16px;
  margin-top: 12px;
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.12);
}

.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.link-row a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.captcha-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.captcha-question {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1d4ed8;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
