/* ============================================================
   سیستم پیامکی باشگاه کشتی — هویت بصری
   پالت: زمینه‌ی تیره‌ی گرم (رنگ تشک کشتی)، قرمز تشک، طلایی طناب
   فونت: وزیرمتن (فارسی)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  /* رنگ‌ها */
  --bg:            #1B1815;
  --surface:       #252019;
  --surface-2:     #2F2820;
  --border:        #3A3128;
  --accent:        #B23A2E;   /* قرمز تشک */
  --accent-hover:  #C74534;
  --gold:          #C79A3D;   /* طلایی طناب */
  --text:          #F1EAE0;
  --text-muted:    #A89A87;
  --success:       #5B8C5A;
  --success-bg:    rgba(91, 140, 90, 0.15);
  --danger:        #B23A2E;
  --danger-bg:     rgba(178, 58, 46, 0.15);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  text-align: right;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(178,58,46,0.08), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(199,154,61,0.06), transparent 40%);
}

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

/* ---------- عنصر امضادار: حلقه‌ی تشک ---------- */
.mat-ring {
  position: relative;
  width: 1px; height: 1px;
}
.mat-ring::before, .mat-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.35;
}
.mat-ring::before { width: 340px; height: 340px; top: -170px; right: -170px; }
.mat-ring::after   { width: 220px; height: 220px; top: -110px; right: -110px; border-color: var(--gold); opacity: 0.25; }

/* ---------- صفحه‌ی ورود ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 2;
}
.auth-emblem {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: var(--gold);
  margin: 0 auto 18px;
}
.auth-card h1 {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
}
.auth-card p.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 28px;
}

/* ---------- فرم‌ها ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}
.field input[type="text"],
.field input[type="password"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 100px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); }
.btn.gold { background: var(--gold); color: #1B1815; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-bg); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.error-msg {
  background: var(--danger-bg);
  color: #E88A80;
  border: 1px solid rgba(178,58,46,0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}
.success-msg {
  background: var(--success-bg);
  color: #9FCB9E;
  border: 1px solid rgba(91,140,90,0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ---------- چیدمان اصلی داشبورد ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  padding: 0 6px;
}
.sidebar-brand .emblem {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: var(--gold);
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-brand span {
  font-weight: 700;
  font-size: 14.5px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent); color: #fff; }
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.sidebar-footer .user-name { color: var(--text); font-weight: 600; margin-bottom: 8px; }

.main {
  flex: 1;
  padding: 30px 36px;
  max-width: 1100px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 4px;
}
.page-header p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

/* ---------- کارت‌های آمار ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-card .value { font-size: 26px; font-weight: 800; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.stat-card.accent-gold .value { color: var(--gold); }
.stat-card.accent-danger .value { color: var(--accent); }
.stat-card.accent-success .value { color: var(--success); }

/* ---------- کارت عمومی ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- جدول ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: right;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.paid { background: var(--success-bg); color: #9FCB9E; }
.badge.unpaid { background: var(--danger-bg); color: #E88A80; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.actions-cell { display: flex; gap: 6px; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state .mat-ring { margin: 0 auto 20px; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input[type="text"] {
  flex: 1;
  min-width: 180px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}

.send-mode-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.send-mode-toggle label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.send-mode-toggle label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(178,58,46,0.08);
}
.send-mode-toggle input { display: none; }
.send-mode-toggle .mode-title { font-weight: 700; font-size: 14px; }
.send-mode-toggle .mode-desc { font-size: 12px; color: var(--text-muted); }

.char-counter { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-align: left; }

.recipient-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}
.recipient-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
}
.recipient-list label:hover { background: var(--surface-2); }

@media (max-width: 780px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-left: none; border-bottom: 1px solid var(--border); }
  .sidebar-brand { margin-bottom: 0; }
  .sidebar-footer { display: none; }
  .main { padding: 20px; }
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
