:root {
  --bg: #eef4f2;
  --ink: #14302c;
  --muted: #5b736f;
  --line: #d5e3df;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-deep: #115e59;
  --chip: #f0faf7;
  --danger: #9f1239;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background:
    radial-gradient(1200px 420px at 100% -10%, #cde8e1 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.85rem;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.kpis {
  display: flex;
  gap: 12px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 140px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(20, 48, 44, 0.05);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.kpi strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(20, 48, 44, 0.06);
  overflow: hidden;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: var(--chip);
  border-bottom: 1px solid var(--line);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.status {
  margin: 16px 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-cell strong {
  font-weight: 700;
}

.user-cell span {
  color: var(--muted);
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
  text-align: center;
}

.phone {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ccfbf1;
  color: var(--teal-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

button {
  height: 40px;
  min-width: 104px;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--teal-deep);
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

#page-label {
  margin: 0;
  color: var(--muted);
}

/* ----- پنل ارسال پیام ----- */
.send-panel {
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
}

.panel-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--chip);
  color: var(--teal);
  border: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0 0 2px;
  font-size: 1.15rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.send-form {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px 20px;
  align-items: start;
  padding: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field-label em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.field-label em.warn {
  color: #b45309;
  font-weight: 700;
}

.send-form input,
.send-form textarea {
  width: 100%;
}

textarea {
  font: inherit;
  min-height: 112px;
  line-height: 1.9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.lookup {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  background: var(--chip);
  color: var(--muted);
}

.lookup.found {
  background: #ecfdf5;
  color: var(--teal-deep);
  font-weight: 600;
}

.lookup.missing {
  background: #fffbeb;
  color: #92400e;
}

.send-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.send-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.status.ok {
  background: #ecfdf5;
  color: var(--teal-deep);
}

.send-panel .status {
  margin: 0 20px 20px;
}

.btn-ghost {
  height: 32px;
  min-width: 0;
  padding: 0 12px;
  background: var(--chip);
  color: var(--teal-deep);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.btn-ghost:hover:not(:disabled) {
  background: #ccfbf1;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (hover: none) {
  .hint {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero,
  .toolbar {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .hero {
    align-items: stretch;
  }
}

@media (max-width: 860px) {
  .send-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .toolbar,
  .hero {
    grid-template-columns: 1fr;
  }
}

/* ----- صفحه‌ی ورود ----- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--chip);
  color: var(--teal);
  border: 1px solid var(--line);
}

.login-card h1 {
  font-size: 1.6rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  text-align: right;
}

.login-form input {
  width: 100%;
}

.pw-field {
  position: relative;
}

.pw-field input {
  padding-left: 76px;
}

.pw-toggle {
  position: absolute;
  top: 5px;
  left: 5px;
  height: 32px;
  min-width: 0;
  padding: 0 12px;
  background: var(--chip);
  color: var(--teal-deep);
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.pw-toggle:hover:not(:disabled) {
  background: #ccfbf1;
}

.login-status {
  margin: 0;
  text-align: right;
}

.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 4px;
}

/* ----- نوار بالای پنل (خروج) ----- */
.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
