@font-face {
  font-family: "Yekan Bakh FaNum";
  src: url("fonts/YekanBakhFaNum-Light400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh FaNum";
  src: url("fonts/YekanBakhFaNum-Regular500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh FaNum";
  src: url("fonts/YekanBakhFaNum-Bold600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Yekan Bakh FaNum";
  src: url("fonts/YekanBakhFaNum-Black700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --app-bg: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --surface-strong: #edf4f2;
  --ink: #15383d;
  --deep: #09292e;
  --muted: #70868a;
  --subtle: #9aabad;
  --teal: #168b7d;
  --teal-strong: #0b7167;
  --mint: #e5f4ef;
  --coral: #e87556;
  --peach: #fff0e9;
  --sky: #4e8193;
  --sky-soft: #eaf2f6;
  --line: #dfe9e6;
  --line-strong: #ccddd8;
  --shadow-sm: 0 5px 16px rgba(18, 56, 61, .055);
  --shadow-card: 0 14px 42px rgba(18, 56, 61, .075);
  --shadow-float: 0 24px 64px rgba(18, 56, 61, .14);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: "Yekan Bakh FaNum", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(22, 139, 125, .11), transparent 24rem),
    radial-gradient(circle at 92% 90%, rgba(78, 129, 147, .09), transparent 28rem),
    var(--app-bg);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .26;
  background-image: radial-gradient(rgba(21, 56, 61, .12) .55px, transparent .55px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
button, a, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(22, 139, 125, .2);
  outline-offset: 2px;
}

/* App shell */
.app-layout {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin-inline: auto;
}
.app-sidebar {
  display: none;
}
.app-main {
  min-width: 0;
  padding: 20px 16px calc(98px + env(safe-area-inset-bottom));
}
.app-main-inner {
  width: min(1120px, 100%);
  margin-inline: auto;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.app-header-context { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.app-header-kicker { color: var(--sky); font-size: 9px; font-weight: 900; }
.app-header-context strong { overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 900; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.app-header-actions { display: flex; min-width: 0; flex: 0 0 auto; align-items: center; gap: 8px; }
.pwa-connection-status { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid rgba(232,117,86,.25); border-radius: 999px; color: var(--coral); background: var(--peach); font-size: 9px; font-weight: 900; }
.pwa-connection-status i { width: 14px; height: 14px; }
.pwa-connection-status[hidden], .pwa-dashboard-action[hidden] { display: none !important; }
.pwa-dashboard-action { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 0 10px 0 7px; border: 1px solid rgba(22,139,125,.2); border-radius: 13px; color: var(--teal-strong); background: var(--mint); cursor: pointer; font-size: 9px; font-weight: 900; transition: .2s ease; }
.pwa-dashboard-action:hover, .pwa-dashboard-action:focus-visible { border-color: rgba(22,139,125,.42); box-shadow: 0 8px 18px rgba(22,139,125,.12); outline: none; transform: translateY(-1px); }
.pwa-dashboard-action[data-pwa-mode="open"] { color: var(--sky); border-color: rgba(78,129,147,.22); background: var(--sky-soft); }
.pwa-dashboard-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 8px; color: #fff; background: var(--teal); }
.pwa-dashboard-action[data-pwa-mode="open"] .pwa-dashboard-icon { background: var(--sky); }
.pwa-dashboard-icon svg { width: 13px; height: 13px; }
.header-icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.header-icon-button:hover { border-color: rgba(22,139,125,.38); color: var(--teal); transform: translateY(-2px); }
.header-icon-button i { width: 17px; height: 17px; }
.header-notification-badge { position: absolute; top: -5px; left: -5px; display: grid; min-width: 18px; height: 18px; place-items: center; padding: 0 4px; border: 2px solid var(--app-bg); border-radius: 999px; color: #fff; background: var(--coral); font-size: 8px; font-weight: 900; line-height: 1; }
.profile-menu { position: relative; flex: 0 0 auto; }
.profile-trigger { display: flex; width: 154px; height: 44px; align-items: center; justify-content: flex-start; gap: 8px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: .2s ease; }
.profile-trigger:hover { border-color: rgba(22,139,125,.38); color: var(--teal); transform: translateY(-2px); }
.profile-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 10px; color: #d8fff8; background: linear-gradient(145deg, var(--teal), var(--teal-strong)); font-size: 10px; font-weight: 900; direction: ltr; }
.profile-avatar.is-large { width: 38px; height: 38px; flex-basis: 38px; border-radius: 13px; }
.profile-trigger-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; overflow: hidden; text-align: right; }
.profile-trigger-copy strong, .profile-trigger-copy small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-trigger-copy strong { color: var(--ink); font-size: 10px; font-weight: 900; }
.profile-trigger-copy small { color: var(--muted); font-size: 8px; font-weight: 700; }
.profile-trigger-chevron { width: 12px; height: 12px; color: var(--muted); }
.profile-dropdown { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 20; width: 228px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-float); }
.profile-dropdown-head { display: flex; align-items: center; gap: 9px; padding: 3px 4px 7px; }
.profile-dropdown-copy { min-width: 0; flex: 1; }
.profile-dropdown-copy strong, .profile-dropdown-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown-copy strong { color: var(--ink); font-size: 11px; font-weight: 900; }
.profile-dropdown-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-status { display: flex; min-width: 0; align-items: center; gap: 6px; margin: 0 4px 7px; padding: 7px 8px; border-radius: 11px; color: var(--teal); background: var(--mint); font-size: 8px; font-weight: 800; }
.profile-status > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-status.is-inactive { color: var(--coral); background: var(--peach); }
.profile-status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 999px; background: var(--teal); box-shadow: 0 0 0 3px rgba(22,139,125,.12); }
.profile-status.is-inactive .profile-status-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(232,117,86,.12); }
.profile-dropdown-divider { height: 1px; margin: 4px 0; background: var(--line); }
.profile-menu-item { display: flex; width: 100%; min-height: 39px; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; text-align: right; transition: .2s ease; }
.profile-menu-item:hover { color: var(--teal); background: var(--mint); }
.profile-menu-item i { width: 16px; height: 16px; color: var(--teal); }
.profile-menu-item small { margin-inline-start: auto; color: var(--muted); font-size: 8px; font-weight: 700; }
.profile-menu-item.is-danger, .profile-menu-item.is-danger i { color: var(--coral); }
.profile-menu-item.is-danger:hover { color: var(--coral); background: var(--peach); }
.profile-dropdown form { margin: 0; }
.wallet-summary {
  display: flex;
  width: fit-content;
  min-width: 0;
  max-width: min(100%, 230px);
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(22,139,125,.16);
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--surface), var(--mint));
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.wallet-summary:hover { border-color: rgba(22,139,125,.38); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18,56,61,.1); }
.wallet-summary.is-empty { border-color: rgba(232,117,86,.24); background: linear-gradient(135deg, var(--surface), var(--peach)); }
.wallet-summary.is-empty .wallet-summary-icon { background: linear-gradient(145deg, var(--coral), #c9533d); box-shadow: 0 7px 15px rgba(232,117,86,.2); }
.wallet-summary.is-empty .wallet-summary-copy b, .wallet-summary.is-empty .wallet-summary-arrow { color: var(--coral); }
.wallet-summary-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), var(--teal-strong));
  box-shadow: 0 7px 15px rgba(22,139,125,.2);
}
.wallet-summary-icon i { width: 18px; height: 18px; }
.wallet-summary-copy { min-width: 0; flex: 0 1 auto; }
.wallet-summary-copy small { display: block; color: var(--muted); font-size: 8px; font-weight: 800; }
.wallet-summary-copy strong { display: block; margin-top: 2px; overflow: hidden; font-size: 12px; font-weight: 900; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.wallet-summary-copy b { color: var(--teal-strong); font-size: 8px; font-weight: 900; }
.wallet-summary-arrow { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 8px; color: var(--teal-strong); background: rgba(255,255,255,.7); }
.wallet-summary-arrow i { width: 13px; height: 13px; }
.sms-hub-nav { margin-bottom: 22px; padding: 12px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sms-hub-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sms-hub-nav-brand { display: flex; min-width: 0; align-items: center; gap: 9px; }
.sms-hub-nav-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--teal), var(--teal-strong)); box-shadow: 0 7px 15px rgba(22,139,125,.18); }
.sms-hub-nav-icon i { width: 18px; height: 18px; }
.sms-hub-nav-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sms-hub-nav-brand-copy strong { color: var(--ink); font-size: 11px; font-weight: 900; }
.sms-hub-nav-brand-copy small { color: var(--muted); font-size: 8px; font-weight: 700; }
.sms-hub-nav-actions { display: flex; align-items: center; gap: 7px; }
.sms-hub-payment-link { display: inline-flex; min-height: 38px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); font-size: 9px; font-weight: 900; transition: .2s ease; }
.sms-hub-payment-link:hover { border-color: rgba(22,139,125,.38); color: var(--teal); background: var(--mint); }
.sms-hub-payment-link i { width: 15px; height: 15px; }
.sms-hub-purchase { min-height: 38px; padding: 0 12px; border-radius: 12px; font-size: 9px; }
.sms-hub-purchase i { width: 15px; height: 15px; }
.sms-hub-tabs { display: flex; gap: 6px; margin-top: 12px; padding: 3px 1px 1px; overflow-x: auto; scrollbar-width: none; }
.sms-hub-tabs::-webkit-scrollbar { display: none; }
.sms-hub-tab { display: inline-flex; min-height: 36px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-size: 9px; font-weight: 900; white-space: nowrap; transition: .2s ease; }
.sms-hub-tab i { width: 14px; height: 14px; }
.sms-hub-tab:hover { color: var(--teal); background: var(--mint); }
.sms-hub-tab.is-active { border-color: rgba(22,139,125,.16); color: var(--teal-strong); background: var(--mint); box-shadow: inset 0 -2px 0 var(--teal); }
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-emblem {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, #20a391, #0c665f);
  box-shadow: 0 12px 28px rgba(7, 55, 58, .28);
}
.brand-emblem::after {
  position: absolute;
  top: -18px;
  left: -14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  content: "";
  background: rgba(255,255,255,.18);
}
.brand-emblem img { position: relative; z-index: 1; width: 100%; height: 100%; padding: 2px; object-fit: contain; }
.brand-name { font-size: 17px; font-weight: 900; letter-spacing: -.035em; }
.brand-tagline { margin-top: 3px; color: rgba(224, 244, 239, .62); font-size: 10px; font-weight: 700; }
.sidebar-nav { display: grid; gap: 8px; margin-top: 40px; }
.sidebar-link {
  position: relative;
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: rgba(222, 240, 237, .62);
  font-size: 12px;
  font-weight: 800;
  transition: .22s ease;
}
.sidebar-link i { width: 19px; height: 19px; }
.sidebar-link:hover { color: white; background: rgba(255,255,255,.07); transform: translateX(-2px); }
.sidebar-link.is-active {
  border-color: rgba(255,255,255,.1);
  color: white;
  background: linear-gradient(115deg, rgba(31, 162, 145, .32), rgba(255,255,255,.06));
  box-shadow: inset -3px 0 0 #61d2c2;
}
.sidebar-account {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-account-row { display: flex; align-items: center; gap: 10px; }
.account-avatar {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 13px;
  color: #c9fff5;
  background: rgba(255,255,255,.09);
  font-size: 12px;
  font-weight: 900;
}
.account-copy { min-width: 0; flex: 1; }
.account-copy strong { display: block; overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { display: block; margin-top: 4px; color: rgba(222,240,237,.5); font-size: 9px; }
.logout-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: rgba(255,255,255,.62);
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}
.logout-button:hover { color: white; background: rgba(232,117,86,.2); }
.mobile-nav {
  position: fixed;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 10px;
  z-index: 50;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 50px rgba(12,45,49,.18);
  backdrop-filter: blur(22px) saturate(1.3);
}
.mobile-nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.mobile-link {
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 15px;
  color: #829498;
  font-size: 8px;
  font-weight: 900;
  transition: .2s ease;
}
.mobile-link i { width: 18px; height: 18px; }
.mobile-link.is-active { color: var(--teal-strong); background: var(--mint); }
.floating-insemination-action {
  position: fixed;
  bottom: 20px;
  left: 18px;
  z-index: 45;
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  padding: 0 13px 0 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), #c9533d);
  box-shadow: 0 18px 36px rgba(184,76,54,.28), inset 0 1px 0 rgba(255,255,255,.2);
  font-size: 10px;
  font-weight: 900;
  transition: .22s ease;
}
.floating-insemination-action:hover { transform: translateY(-3px); filter: saturate(1.08); box-shadow: 0 22px 42px rgba(184,76,54,.34), inset 0 1px 0 rgba(255,255,255,.2); }
.floating-insemination-icon { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 10px; background: rgba(255,255,255,.16); }
.floating-insemination-icon i { width: 15px; height: 15px; }

/* Shared components */
.page-enter { animation: page-enter .42s cubic-bezier(.2,.75,.25,1) both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.animate-rise { animation: page-enter .5s ease-out both; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.modal-backdrop { backdrop-filter: blur(12px); }
.soft-grid {
  background-image:
    linear-gradient(rgba(22,139,125,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,139,125,.055) 1px, transparent 1px);
  background-size: 25px 25px;
}
.surface-card {
  border: 1px solid var(--line);
  border-radius: 27px;
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow-card);
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.page-kicker { margin: 0 0 5px; color: var(--sky); font-size: 10px; font-weight: 900; letter-spacing: .02em; }
.page-title { margin: 0; overflow: hidden; color: var(--ink); font-size: clamp(20px, 3vw, 28px); font-weight: 900; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.8; }
.head-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.icon-button, .back-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.icon-button:hover, .back-button:hover { border-color: rgba(22,139,125,.38); color: var(--teal); transform: translateY(-2px); }
.primary-action, .secondary-action, .danger-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  transition: .2s ease;
}
.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-strong));
  box-shadow: 0 11px 24px rgba(22,139,125,.22);
}
.primary-action:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(22,139,125,.27); }
.secondary-action { border: 1px solid var(--line); color: var(--ink); background: var(--surface-soft); }
.secondary-action:hover { border-color: var(--line-strong); color: var(--teal); background: var(--mint); }
.danger-action { color: #c54d38; background: var(--peach); }
.detail-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 0%, rgba(96,211,194,.27), transparent 17rem),
    linear-gradient(130deg, #0a3035, #145b5d 62%, #177c70);
  box-shadow: 0 24px 55px rgba(10,48,53,.2);
}
.detail-hero::after {
  position: absolute;
  top: -68px;
  left: -58px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  content: "";
  box-shadow: 0 0 0 28px rgba(255,255,255,.03), 0 0 0 58px rgba(255,255,255,.018);
}
.hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 17px; }
.hero-icon {
  display: grid;
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  color: #d8fff8;
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
}
.hero-icon i { width: 29px; height: 29px; }
.hero-label { margin: 0 0 6px; color: rgba(224,255,249,.66); font-size: 10px; font-weight: 800; }
.hero-title { margin: 0; color: #fff; font-size: clamp(21px, 4vw, 31px); font-weight: 900; letter-spacing: -.045em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; color: rgba(235,255,251,.72); font-size: 10px; font-weight: 700; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta i { width: 13px; height: 13px; }
.hero-status {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #e8fff9;
  background: rgba(255,255,255,.1);
  font-size: 9px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.hero-status::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: #72e4ba; box-shadow: 0 0 0 4px rgba(114,228,186,.13); }
.hero-status.is-warning::before { background: #ffc09d; box-shadow: 0 0 0 4px rgba(255,192,157,.14); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.metric-tile {
  position: relative;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.metric-tile::before { position: absolute; inset: 0 0 auto; height: 3px; content: ""; background: linear-gradient(90deg, var(--teal), transparent 72%); opacity: .72; }
.metric-label { display: block; color: var(--muted); font-size: 9px; font-weight: 800; }
.metric-value { display: block; margin-top: 7px; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.metric-icon { position: absolute; top: 13px; left: 13px; color: var(--subtle); opacity: .58; }
.metric-icon i { width: 17px; height: 17px; }
.detail-layout { display: grid; gap: 14px; margin-top: 14px; }
.content-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow-card);
}
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-heading-main { display: flex; min-width: 0; align-items: center; gap: 11px; }
.card-heading-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 15px; color: var(--teal); background: var(--mint); }
.card-heading-icon.is-coral { color: var(--coral); background: var(--peach); }
.card-heading-icon.is-sky { color: var(--sky); background: var(--sky-soft); }
.card-heading h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 900; }
.card-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.info-grid { display: grid; gap: 10px; }
.info-item {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-soft);
}
.info-item.is-wide { grid-column: 1 / -1; }
.info-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.info-label i { width: 13px; height: 13px; color: var(--teal); }
.info-value { display: block; margin-top: 7px; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 900; line-height: 1.9; }
.record-list { display: grid; gap: 9px; }
.record-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--surface-soft);
  transition: .2s ease;
}
.record-row:hover { border-color: var(--line-strong); background: var(--mint); transform: translateX(-2px); }
.record-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 14px; color: var(--teal); background: var(--mint); }
.record-copy { min-width: 0; flex: 1; }
.record-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.record-copy small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.record-tail { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--teal); font-size: 9px; font-weight: 900; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; color: var(--teal-strong); background: var(--mint); font-size: 9px; font-weight: 900; white-space: nowrap; }
.status-chip.is-warning { color: #c45439; background: var(--peach); }
.status-chip.is-info { color: var(--sky); background: var(--sky-soft); }
.status-chip.is-danger { color: #c54d38; background: var(--peach); }
.empty-panel { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty-panel-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 12px; place-items: center; border-radius: 18px; color: var(--teal); background: var(--mint); }
.empty-panel p { margin: 0; font-size: 10px; font-weight: 800; line-height: 1.9; }

/* Upgrade legacy utility-based pages globally */
.bg-white { background-color: var(--surface) !important; }
.bg-white\/95 { background-color: rgba(255,255,255,.9) !important; }
.bg-cloud { background-color: var(--surface-soft) !important; }
.bg-ink { background-color: var(--deep) !important; }
.bg-deep { background-color: #061e22 !important; }
.bg-teal { background-color: var(--teal) !important; }
.bg-mint { background-color: var(--mint) !important; }
.bg-coral { background-color: var(--coral) !important; }
.bg-peach { background-color: var(--peach) !important; }
.bg-sky-soft { background-color: var(--sky-soft) !important; }
.text-ink { color: var(--ink) !important; }
.text-teal { color: var(--teal) !important; }
.text-coral { color: var(--coral) !important; }
.text-sky { color: var(--sky) !important; }
.text-white { color: #fff !important; }
.border-line { border-color: var(--line) !important; }
.shadow-card { box-shadow: var(--shadow-card) !important; }
.shadow-float { box-shadow: var(--shadow-float) !important; }
.hover\:bg-deep:hover { background-color: #061e22 !important; }
.hover\:bg-teal:hover { background-color: var(--teal) !important; }
.hover\:bg-coral\/90:hover { background-color: #dc6649 !important; }
.hover\:bg-mint:hover { background-color: var(--mint) !important; }
.hover\:bg-cloud:hover { background-color: var(--surface-soft) !important; }
.hover\:text-white:hover { color: #fff !important; }
.hover\:text-teal:hover { color: var(--teal) !important; }
.hover\:border-teal\/40:hover { border-color: rgba(22,139,125,.4) !important; }
main article.rounded-\[24px\].bg-white,
main article.rounded-\[26px\].bg-white,
main section.rounded-\[26px\].bg-white,
main section.rounded-\[28px\].bg-white {
  border-color: var(--line) !important;
  background: linear-gradient(145deg, var(--surface), var(--surface-soft)) !important;
  box-shadow: var(--shadow-card) !important;
}
main article.rounded-\[26px\].bg-white {
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
main article.rounded-\[26px\].bg-white::after {
  position: absolute;
  right: 20px;
  bottom: -2px;
  left: 20px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(22,139,125,.48), transparent);
  opacity: 0;
  transition: opacity .2s ease;
}
main article.rounded-\[26px\].bg-white:hover { border-color: var(--line-strong) !important; box-shadow: var(--shadow-float) !important; transform: translateY(-3px); }
main article.rounded-\[26px\].bg-white:hover::after { opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea,
.site-form-input {
  border-color: var(--line) !important;
  color: var(--ink) !important;
  background-color: var(--surface-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
select:hover,
textarea:hover { border-color: var(--line-strong) !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus,
.site-form-input:focus {
  border-color: var(--teal) !important;
  background-color: var(--surface) !important;
  box-shadow: 0 0 0 4px rgba(22,139,125,.11) !important;
  outline: none;
}
.site-form-error { display: block; margin-top: 8px; color: var(--coral); font-size: 10px; font-weight: 800; }
.site-form-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 11px; font-weight: 900; }
.password-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 14px; }
.password-form { display: grid; gap: 18px; }
.password-field-wrap { position: relative; }
.password-field-wrap .site-form-input { padding-inline-end: 48px; }
.password-toggle { position: absolute; inset-inline-end: 9px; top: 50%; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; transform: translateY(-50%); transition: .2s ease; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--teal); background: var(--mint); outline: none; }
.password-toggle svg { width: 16px; height: 16px; }
.password-help { margin: 7px 2px 0; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.8; }
.password-form-error { padding: 11px 13px; border: 1px solid rgba(232,117,86,.25); border-radius: 15px; color: #c54d38; background: var(--peach); font-size: 10px; font-weight: 800; line-height: 1.8; }
.password-form-error p { margin: 0; }
.password-form-actions { display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding-top: 3px; }
.password-form-actions .primary-action svg { width: 16px; height: 16px; }
.password-side-panel { display: grid; align-content: start; gap: 14px; }
.password-security-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.password-security-list li { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.8; }
.password-security-list svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; color: var(--teal); }
.password-success { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid rgba(22,139,125,.22); border-radius: 19px; color: var(--teal-strong); background: var(--mint); box-shadow: var(--shadow-sm); }
.password-success-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 12px; color: #fff; background: var(--teal); }
.password-success-icon svg { width: 18px; height: 18px; }
.password-success strong { display: block; font-size: 11px; font-weight: 900; }
.password-success p { margin: 4px 0 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.password-session-note { display: flex; align-items: flex-start; gap: 11px; padding: 17px; border: 1px solid rgba(78,129,147,.2); border-radius: 23px; background: var(--sky-soft); }
.password-session-note-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 13px; color: var(--sky); background: var(--surface); }
.password-session-note-icon svg { width: 17px; height: 17px; }
.password-session-note strong { display: block; color: var(--ink); font-size: 11px; font-weight: 900; }
.password-session-note p { margin: 5px 0 0; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.9; }
.persian-amount-words { margin: 8px 2px 0; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.8; }
.persian-amount-words.is-empty { color: var(--subtle); }
.form-error { display: block; margin-top: 8px; color: var(--coral); font-size: 10px; font-weight: 800; }
.jalali-picker { position: relative; display: block; width: 100%; }
.jalali-picker-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; width: min(320px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-float); }
.jalali-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.jalali-picker-title { flex: 1; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 900; cursor: pointer; }
.jalali-picker-nav, .jalali-picker-today { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink); font-weight: 900; cursor: pointer; }
.jalali-picker-nav { width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.jalali-picker-today { width: 100%; margin-top: 12px; padding: 8px 12px; color: var(--teal-strong); font-size: 10px; }
.jalali-picker-weekdays, .jalali-picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.jalali-picker-weekdays { margin-bottom: 5px; color: var(--subtle); font-size: 9px; font-weight: 900; }
.jalali-picker-day, .jalali-picker-empty { min-height: 32px; }
.jalali-picker-day { border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.jalali-picker-day:hover, .jalali-picker-day.is-today { background: var(--mint); color: var(--teal-strong); }
.jalali-picker-day.is-selected { background: var(--teal); color: #fff; }
.bar-grow { transform-origin: right; animation: bar-grow .8s ease-out both; }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Theme */
.theme-sun { display: none; }
html.dark-mode {
  --app-bg: #071619;
  --surface: #102529;
  --surface-soft: #142d31;
  --surface-strong: #19363a;
  --ink: #edf9f6;
  --deep: #061b1e;
  --muted: #98adaf;
  --subtle: #708a8c;
  --teal: #56c4b5;
  --teal-strong: #36ab9d;
  --mint: #173c3a;
  --coral: #ff9071;
  --peach: #492c29;
  --sky: #86b9c8;
  --sky-soft: #19343c;
  --line: rgba(200,230,224,.11);
  --line-strong: rgba(200,230,224,.2);
  --shadow-sm: 0 7px 20px rgba(0,0,0,.15);
  --shadow-card: 0 17px 46px rgba(0,0,0,.2);
  --shadow-float: 0 26px 70px rgba(0,0,0,.32);
  color-scheme: dark;
}
html.dark-mode .theme-moon { display: none !important; }
html.dark-mode .theme-sun { display: block !important; }
html.dark-mode body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(39,155,142,.14), transparent 25rem),
    radial-gradient(circle at 90% 88%, rgba(71,118,140,.12), transparent 28rem),
    var(--app-bg);
}
html.dark-mode body::before { opacity: .16; background-image: radial-gradient(rgba(224,249,244,.16) .55px, transparent .55px); }
html.dark-mode .bg-white\/95 { background-color: rgba(16,37,41,.9) !important; }
html.dark-mode .text-slate-300 { color: #6f898c !important; }
html.dark-mode .text-slate-400 { color: var(--muted) !important; }
html.dark-mode .text-slate-500 { color: #a5b8b9 !important; }
html.dark-mode .text-slate-600 { color: #c7d6d4 !important; }
html.dark-mode .bg-\[\#edf3f2\] { background-color: var(--sky-soft) !important; }
html.dark-mode .bg-\[\#eef1ef\] { background-color: var(--surface-strong) !important; }
html.dark-mode .border-white { border-color: rgba(255,255,255,.07) !important; }
html.dark-mode .mobile-nav { border-color: rgba(255,255,255,.08); background: rgba(14,34,38,.9); }
html.dark-mode option { color: var(--ink); background: var(--surface); }
html.dark-mode .soft-grid {
  background-image:
    linear-gradient(rgba(86,196,181,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86,196,181,.07) 1px, transparent 1px);
}
html.dark-mode .wallet-summary-arrow { background: rgba(255,255,255,.09); }

@media (min-width: 640px) {
  .app-main { padding: 26px 28px 110px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 0; padding: 18px; }
  .app-sidebar {
    position: sticky;
    top: 18px;
    display: flex;
    height: calc(100vh - 36px);
    flex-direction: column;
    padding: 25px 18px 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 29px;
    color: white;
    background:
      radial-gradient(circle at 20% 0%, rgba(61,178,164,.24), transparent 18rem),
      linear-gradient(160deg, #092c31, #0c2429 58%, #071d21);
    box-shadow: 0 25px 65px rgba(7,35,39,.2);
  }
  .app-main { padding: 34px 34px 104px; }
  .mobile-nav { display: none; }
  .detail-layout { grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 16px; }
}
@media (max-width: 639px) {
  .app-header { margin-bottom: 20px; }
  .app-header-context { display: none; }
  .app-header-actions { width: 100%; justify-content: flex-start; }
  .pwa-connection-status { width: 32px; min-height: 32px; justify-content: center; padding: 0; }
  .pwa-connection-status span { display: none; }
  .wallet-summary { max-width: 145px; padding-left: 7px; }
  .wallet-summary-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .wallet-summary-copy strong { font-size: 11px; }
  .wallet-summary-arrow { display: none; }
  .profile-trigger { width: 40px; height: 40px; justify-content: center; padding: 3px 5px; }
  .profile-trigger-copy { display: none; }
  .sms-hub-nav { margin-bottom: 18px; padding: 9px; border-radius: 19px; }
  .sms-hub-nav-head { align-items: flex-start; }
  .sms-hub-nav-brand-copy small { display: none; }
  .sms-hub-nav-actions { gap: 5px; }
  .sms-hub-payment-link { width: 38px; min-height: 36px; justify-content: center; padding: 0; }
  .sms-hub-payment-link span, .sms-hub-action-label { display: none; }
  .sms-hub-purchase { width: 38px; min-height: 36px; justify-content: center; padding: 0; }
  .sms-hub-tabs { margin-top: 9px; }
  .sms-hub-tab { min-height: 34px; padding: 0 9px; }
  .floating-insemination-action { right: auto; bottom: calc(82px + env(safe-area-inset-bottom)); left: 12px; min-height: 43px; gap: 6px; padding: 0 11px 0 7px; border-radius: 14px; }
  .floating-insemination-icon { width: 27px; height: 27px; flex-basis: 27px; border-radius: 9px; }
  .floating-insemination-icon i { width: 14px; height: 14px; }
  .floating-insemination-label { font-size: 9px; }
  .page-head { align-items: flex-start; margin-bottom: 20px; }
  .page-head .page-subtitle { display: none; }
  .primary-action span.optional-label { display: none; }
  .hero-content { align-items: flex-start; }
  .hero-icon { width: 56px; height: 56px; flex-basis: 56px; border-radius: 19px; }
  .detail-hero { border-radius: 25px; }
  .hero-status { position: static; width: fit-content; margin-top: 18px; }
  .content-card { border-radius: 23px; }
  .password-layout { grid-template-columns: 1fr; }
  .password-form-actions { flex-direction: column-reverse; align-items: stretch; }
  .password-form-actions > * { width: 100%; }
  .record-row { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
