@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/Estedad-Arabic-400.woff2") format("woff2");
}

@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/Estedad-Arabic-500.woff2") format("woff2");
}

@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/Estedad-Arabic-600.woff2") format("woff2");
}

@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/Estedad-Arabic-700.woff2") format("woff2");
}

@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url("/fonts/Estedad-Arabic-800.woff2") format("woff2");
}

@font-face {
  font-family: "HexaPersian";
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url("/fonts/Estedad-Arabic-900.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page: #ffffff;
  --page-soft: #f5f8fc;
  --surface: #ffffff;
  --surface-tint: #f9fbff;
  --border: #e2e9f2;
  --border-strong: #cbd7e5;
  --text: #122033;
  --muted: #64748b;
  --faint: #93a3b8;
  --blue: #2f8ee8;
  --blue-soft: #e8f4ff;
  --green: #26b66f;
  --green-soft: #e7f8ef;
  --cyan: #20b8c8;
  --amber: #f4aa24;
  --amber-soft: #fff4d7;
  --coral: #ee6f57;
  --coral-soft: #fff0ed;
  --violet: #7a69e8;
  --violet-soft: #f0edff;
  --ink: #101828;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(26, 45, 73, 0.09);
  --shadow-soft: 0 6px 18px rgba(26, 45, 73, 0.06);
  font-family:
    "HexaPersian",
    "Estedad",
    "Yekan Bakh",
    "IRANSansX",
    "IRANSans",
    "Dana",
    Vazirmatn,
    Tahoma,
    Arial,
    sans-serif;
  font-synthesis-weight: none;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: inherit;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 58%, #f3f7fc 100%),
    radial-gradient(circle at 16% 8%, rgba(47, 142, 232, 0.09), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(38, 182, 111, 0.08), transparent 24%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(47, 142, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 142, 232, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 68%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 142, 232, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px 104px;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: -2px -2px 12px;
  padding: 8px 2px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 233, 242, 0.75);
  backdrop-filter: blur(16px);
}

.brand-mark,
.brand-orb {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: #25d17f;
  box-shadow: var(--shadow-soft);
  color: #083122;
  font-weight: 950;
}

.brand-icon {
  width: 25px;
  height: 25px;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.identity {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  padding: 4px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon,
.btn svg,
.tab svg,
.row small svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-entry {
  border-color: transparent;
  background: var(--blue);
  color: #ffffff;
}

.hero {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(47, 142, 232, 0.1), rgba(38, 182, 111, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy-block,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1769b8;
  font-size: 12px;
  font-weight: 900;
}

.hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.25;
}

.hero p {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.9;
}

.hero-panel,
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.metric {
  grid-column: span 12;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-panel .metric {
  grid-column: auto;
}

.metric b {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  gap: 7px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  overflow-x: auto;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -12px 30px rgba(26, 45, 73, 0.08);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: grid;
  flex: 0 0 74px;
  min-height: 54px;
  place-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
}

.tab.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.tab svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.25;
}

.section {
  display: none;
  margin-top: 14px;
}

.section.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 10px;
}

.section-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.section-head span:not(.head-icon) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.head-icon,
.icon-badge,
.feature-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue);
}

.head-icon,
.icon-badge {
  width: 38px;
  height: 38px;
}

.feature-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.feature-icon svg {
  width: 29px;
  height: 29px;
}

.quick-grid,
.grid,
.info-grid {
  display: grid;
  gap: 10px;
}

.grid {
  grid-template-columns: repeat(12, 1fr);
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-card,
.card,
.notice-card,
.feature-card,
.composer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.quick-card {
  display: grid;
  min-height: 118px;
  justify-items: start;
  gap: 8px;
  padding: 13px;
  color: var(--text);
  text-align: right;
}

.quick-card strong {
  color: var(--ink);
  font-size: 15px;
}

.quick-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.card {
  grid-column: span 12;
  min-width: 0;
  padding: 14px;
}

.notice-card,
.feature-card,
.composer-card {
  display: grid;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
  padding: 14px;
}

.notice-card {
  grid-template-columns: auto 1fr;
  background: var(--amber-soft);
}

.notice-card .btn,
.feature-card .btn {
  grid-column: 1 / -1;
}

.notice-card strong,
.feature-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.notice-card p,
.feature-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.9;
}

.feature-card {
  grid-template-columns: auto 1fr;
}

.feature-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.composer-card {
  grid-template-columns: auto 1fr;
}

.composer-card .actions,
.composer-card .split {
  grid-column: 2;
}

.card-title,
.modal-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.card-title strong,
.modal-head strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title small,
.modal-head small,
.row small,
.muted,
.inline-note {
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
}

.row small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.row b {
  color: var(--ink);
  text-align: left;
}

.mono {
  direction: ltr;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-family: Vazirmatn, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.status {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status.active,
.status.paid,
.status.open {
  background: var(--green-soft);
  color: #168753;
}

.status.pending,
.status.high,
.status.urgent {
  background: var(--amber-soft);
  color: #a96d08;
}

.status.rejected,
.status.disabled,
.status.expired,
.status.limited {
  background: var(--coral-soft);
  color: #c14d38;
}

.status.closed,
.status.normal,
.status.low {
  background: var(--blue-soft);
  color: #1769b8;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.service-tools {
  justify-content: space-between;
  margin-bottom: 10px;
}

.list-meta,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-meta {
  margin: 0 2px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pagination {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.btn,
.copy-pill,
.copy-line,
.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.btn {
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  background: #f4f7fb;
}

.btn.primary {
  border-color: transparent;
  background: var(--blue);
  color: #ffffff;
}

.btn.success {
  border-color: transparent;
  background: var(--green);
  color: #ffffff;
}

.btn.danger {
  border-color: transparent;
  background: var(--coral-soft);
  color: #b94632;
}

.btn.warn {
  border-color: transparent;
  background: var(--amber-soft);
  color: #97640c;
}

.btn.glass {
  background: #ffffff;
  color: var(--text);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.copy-pill {
  min-height: 34px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--surface-tint);
  color: #1769b8;
}

.copy-pill svg,
.copy-line svg {
  width: 16px;
  height: 16px;
}

.round-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: #f4f7fb;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
}

textarea {
  min-height: 106px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a4b1c2;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.search-box input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border-radius: 13px;
  background: var(--page-soft);
}

.info-grid svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.info-grid small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
}

.info-grid b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
}

.empty,
.error {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty strong,
.error strong {
  color: var(--ink);
}

.empty-icon {
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.error {
  color: #b94632;
}

.boot {
  display: grid;
  min-height: 80vh;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--ink);
  text-align: center;
}

.boot h1,
.boot p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 92px;
  z-index: 40;
  max-width: calc(100vw - 28px);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  transition: 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.setting-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  background: #ffffff;
  text-align: right;
}

.setting-toggle svg {
  width: 18px;
  height: 18px;
}

.setting-toggle span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-toggle b {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
}

.setting-toggle.on b {
  background: var(--green-soft);
  color: #168753;
}

.setting-toggle.off b {
  background: var(--coral-soft);
  color: #b94632;
}

.copy-box {
  direction: ltr;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #f8fbff;
  color: #12305a;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
}

.modal-card {
  position: fixed;
  right: 12px;
  bottom: 94px;
  left: 12px;
  z-index: 35;
  max-height: calc(100vh - 124px);
  overflow: auto;
  background: #ffffff;
}

.pay-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--blue-soft);
}

.pay-card > span svg {
  width: 28px;
  height: 28px;
  color: var(--blue);
}

.pay-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.copy-line {
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.mini-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tone-green .icon-badge,
.icon-badge.tone-green {
  background: var(--green-soft);
  color: var(--green);
}

.tone-blue .icon-badge,
.icon-badge.tone-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.tone-amber .icon-badge,
.icon-badge.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tone-violet .icon-badge,
.icon-badge.tone-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.quick-card.tone-green,
.feature-card.tone-green {
  background: var(--green-soft);
}

.quick-card.tone-blue,
.feature-card.tone-blue {
  background: var(--blue-soft);
}

.quick-card.tone-amber,
.feature-card.tone-amber {
  background: var(--amber-soft);
}

.quick-card.tone-violet,
.feature-card.tone-violet {
  background: var(--violet-soft);
}

.plan-card:nth-child(4n + 1),
.service-card:nth-child(4n + 1) {
  border-top: 4px solid var(--blue);
}

.plan-card:nth-child(4n + 2),
.service-card:nth-child(4n + 2) {
  border-top: 4px solid var(--green);
}

.plan-card:nth-child(4n + 3),
.service-card:nth-child(4n + 3) {
  border-top: 4px solid var(--amber);
}

.plan-card:nth-child(4n + 4),
.service-card:nth-child(4n + 4) {
  border-top: 4px solid var(--coral);
}

@media (max-width: 420px) {
  .icon-action span {
    display: none;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel .metric {
    padding: 9px;
  }

  .hero-panel .metric .icon-badge {
    width: 32px;
    height: 32px;
  }

  .hero-panel .metric b {
    font-size: 12.5px;
    white-space: normal;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .notice-card,
  .feature-card,
  .composer-card {
    grid-template-columns: 1fr;
  }

  .composer-card .actions,
  .composer-card .split {
    grid-column: 1;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 560px) {
  .metric {
    grid-column: span 4;
  }

  .tab {
    flex-basis: 86px;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding: 22px 22px 116px;
  }

  .hero {
    grid-template-columns: 1.08fr 0.92fr;
    align-items: end;
  }

  .hero-panel {
    align-items: stretch;
  }

  .card.half {
    grid-column: span 6;
  }

  .card.third {
    grid-column: span 4;
  }

  .notice-card {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .notice-card .btn,
  .feature-card .btn {
    grid-column: auto;
  }

  .feature-card {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .split {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-card {
    right: max(22px, calc((100vw - 760px) / 2));
    left: max(22px, calc((100vw - 760px) / 2));
  }

  .tabs {
    right: 18px;
    bottom: 16px;
    left: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
  }
}
