:root {
  --bg: #ecf0f3;
  --surface: #ecf0f3;
  --text: #273244;
  --muted: #718096;
  --line: #dbe2ec;
  --blue: #0bb4b8;
  --blue-dark: #07898d;
  --green: #38a169;
  --amber: #d69e2e;
  --red: #e53e3e;
  --violet: #805ad5;
  --cyan: #0bb4b8;
  --shadow-light: #ffffff;
  --shadow-dark: #d1d9e6;
  --radius: 20px;
  --radius-sm: 12px;
}

body.dark-mode {
  --bg: #111827;
  --surface: #182233;
  --text: #e8eef8;
  --muted: #9aa8bc;
  --line: #29364a;
  --blue: #21d2d6;
  --blue-dark: #73f0f2;
  --green: #5bd28b;
  --amber: #f0bd55;
  --red: #ff6b6b;
  --violet: #a78bfa;
  --cyan: #42e0e3;
  --shadow-light: #243149;
  --shadow-dark: #0a101b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  direction: rtl;
  transition: background-color .25s ease, color .25s ease;
}

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

input,
select,
textarea {
  font-size: 16px;
}

button {
  border: 0;
}

.hidden {
  display: none !important;
}

.neu-out {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 9px 9px 16px var(--shadow-dark), -9px -9px 16px var(--shadow-light);
}

.neu-in {
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 6px 6px 10px var(--shadow-dark), inset -6px -6px 10px var(--shadow-light);
}

.neu-button {
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.neu-button:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 20px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, .62), transparent 30%),
    radial-gradient(circle at 78% 72%, rgba(196, 207, 222, .45), transparent 34%),
    linear-gradient(145deg, #d7d9dc, #bfc3c7);
}

body.dark-mode .auth-screen {
  background:
    radial-gradient(circle at 18% 20%, rgba(33, 210, 214, .18), transparent 32%),
    radial-gradient(circle at 78% 72%, rgba(66, 224, 227, .12), transparent 34%),
    linear-gradient(145deg, #0c111c, #151d2c);
}

.login-panel {
  width: min(980px, 100%);
  min-height: 520px;
  padding: 38px 58px;
  display: grid;
  grid-template-columns: minmax(340px, .95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: 30px;
  direction: ltr;
  text-align: left;
  border-radius: 8px;
  background: rgba(236, 241, 245, .92);
  box-shadow:
    0 34px 46px rgba(84, 94, 108, .28),
    10px 10px 24px rgba(180, 188, 198, .66),
    -10px -10px 24px rgba(255, 255, 255, .62);
  overflow: hidden;
}

body.dark-mode .login-panel {
  background: rgba(24, 34, 51, .94);
  box-shadow:
    0 34px 46px rgba(0, 0, 0, .36),
    10px 10px 24px rgba(7, 12, 21, .72),
    -10px -10px 24px rgba(40, 52, 74, .58);
}

.brand-mark,
.logo-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 0 34px;
  border-radius: 11px;
  font-size: 21px;
  background:
    radial-gradient(circle at 52% 64%, rgba(46, 224, 218, .9), transparent 36%),
    linear-gradient(145deg, #f8fbfd, #dce5ec);
  box-shadow:
    12px 12px 24px rgba(202, 211, 222, .9),
    -12px -12px 24px rgba(255, 255, 255, .96);
}

.login-panel h1 {
  margin: 0;
  color: var(--blue-dark);
  font-family: Arial, "Vazirmatn", sans-serif;
  font-size: clamp(38px, 5vw, 56px);
  line-height: .9;
  font-weight: 900;
  letter-spacing: -1px;
  direction: ltr;
}

.login-panel p {
  margin: 12px 0 30px;
  color: #91a0b4;
  font-size: 17px;
  font-weight: 700;
  direction: ltr;
}

.login-copy {
  display: grid;
  justify-items: start;
  max-width: 430px;
  align-content: center;
  min-height: 330px;
}

.login-form {
  width: 100%;
  display: grid;
  gap: 14px;
}

.login-field {
  width: 100%;
  height: 44px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #91a0b4;
  border-radius: 18px;
  background: #edf2f6;
  box-shadow:
    inset 8px 8px 13px rgba(202, 211, 222, .85),
    inset -8px -8px 13px rgba(255, 255, 255, .9);
}

body.dark-mode .login-field {
  background: var(--surface);
  box-shadow: inset 8px 8px 13px var(--shadow-dark), inset -8px -8px 13px var(--shadow-light);
}

.login-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #263449;
  direction: rtl;
  text-align: right;
  font-size: 16px;
}

body.dark-mode .login-field input {
  color: var(--text);
}

.login-field input::placeholder {
  color: #9aa8ba;
}

.forgot-link {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  justify-self: end;
  direction: rtl;
}

.login-error {
  min-height: 22px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  direction: rtl;
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 38px;
  border-radius: 22px;
  color: var(--blue-dark);
  background: #edf2f6;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  box-shadow:
    10px 10px 20px rgba(202, 211, 222, .92),
    -10px -10px 20px rgba(255, 255, 255, .96);
}

body.dark-mode .login-submit {
  color: var(--blue-dark);
  background: var(--surface);
  box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
}

.login-submit:active {
  box-shadow:
    inset 7px 7px 12px rgba(202, 211, 222, .86),
    inset -7px -7px 12px rgba(255, 255, 255, .92);
}

.login-alt {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #91a0b4;
  font-size: 14px;
  direction: rtl;
}

.login-alt button {
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-decoration: underline;
}

.login-hint {
  margin-top: 18px;
  color: #91a0b4;
  font-size: 12px;
  direction: rtl;
  text-align: right;
}

.login-visual {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 14px;
  position: relative;
  text-decoration: none;
  cursor: pointer;
}

.login-glasses-logo {
  width: min(360px, 92%);
  max-height: 235px;
  object-fit: contain;
  filter:
    drop-shadow(18px 22px 24px rgba(11, 180, 184, .16))
    drop-shadow(-10px -10px 18px rgba(255, 255, 255, .7));
  opacity: .96;
  transition: transform .25s ease, filter .25s ease;
}

.login-visual:hover .login-glasses-logo {
  transform: translateY(-4px) scale(1.025);
  filter:
    drop-shadow(18px 22px 26px rgba(11, 180, 184, .22))
    drop-shadow(-10px -10px 18px rgba(255, 255, 255, .78));
}

.login-home-link,
.login-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  direction: rtl;
}

.login-home-link {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
}

.login-back-link {
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
}

body.dark-mode .login-glasses-logo {
  filter:
    drop-shadow(18px 22px 24px rgba(0, 0, 0, .28))
    drop-shadow(-8px -8px 18px rgba(55, 72, 101, .38));
}

.glass-object {
  width: min(340px, 100%);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  filter: drop-shadow(30px 30px 34px rgba(122, 136, 154, .18));
}

.glass-core {
  width: 185px;
  height: 185px;
  display: grid;
  place-items: center;
  border-radius: 42% 58% 48% 52%;
  color: rgba(255, 255, 255, .78);
  font-size: 66px;
  background:
    radial-gradient(circle at 34% 32%, rgba(255, 255, 255, .75), transparent 11%),
    radial-gradient(circle at 66% 28%, rgba(255, 255, 255, .58), transparent 10%),
    radial-gradient(circle at 42% 70%, rgba(255, 255, 255, .48), transparent 12%),
    linear-gradient(135deg, rgba(35, 150, 235, .92), rgba(61, 236, 221, .88));
  box-shadow:
    inset 24px 24px 42px rgba(255, 255, 255, .28),
    inset -24px -24px 46px rgba(12, 105, 172, .34),
    0 0 44px rgba(62, 221, 231, .54);
  z-index: 3;
}

.glass-ring {
  position: absolute;
  border-radius: 50%;
  background: rgba(72, 196, 232, .22);
  filter: blur(12px);
}

.ring-one {
  width: 215px;
  height: 215px;
}

.ring-two {
  width: 168px;
  height: 168px;
  background: rgba(66, 153, 225, .24);
  transform: translate(34px, -18px);
}

.glass-plane {
  position: absolute;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(7px);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7);
}

.plane-one {
  width: 205px;
  height: 122px;
  top: 58px;
  right: 25px;
  clip-path: polygon(10% 0, 92% 0, 100% 78%, 42% 100%);
  transform: rotate(1deg);
  z-index: 2;
}

.plane-two {
  width: 170px;
  height: 142px;
  bottom: 56px;
  right: 34px;
  clip-path: polygon(0 0, 100% 42%, 88% 100%, 8% 72%);
  background: rgba(238, 244, 249, .52);
  z-index: 4;
}

.plane-three {
  width: 138px;
  height: 128px;
  left: 28px;
  top: 124px;
  clip-path: polygon(0 50%, 74% 0, 100% 70%, 34% 100%);
  background: rgba(255, 255, 255, .48);
  z-index: 2;
}

.app-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 28px;
}

.sidebar {
  height: calc(100vh - 48px);
  position: sticky;
  top: 24px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.sidebar-close {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 8px;
}

.app-logo-wordmark {
  width: 132px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(6px 8px 10px rgba(11, 180, 184, .08));
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(145deg, #f7fafc, #e3e9f0);
  box-shadow: 7px 7px 14px rgba(209, 217, 230, .9), -7px -7px 14px rgba(255, 255, 255, .96);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.logo span,
.profile span,
.panel-header span,
.stat-card p {
  color: var(--muted);
  font-size: 13px;
}

.menu-group {
  margin-bottom: 24px;
}

.menu-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 0 12px 10px;
}

.menu-link {
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-align: right;
  font-weight: 700;
  box-shadow: none;
  position: relative;
  transition: color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.menu-link:hover,
.menu-link.active {
  color: var(--text);
}

.menu-link:hover,
.menu-link.active {
  transform: translateY(-1px);
  box-shadow: 6px 8px 14px rgba(209, 217, 230, .95), -5px -5px 12px rgba(255, 255, 255, .92);
}

.menu-link.active::after {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 99px;
  background: var(--blue);
  box-shadow: 0 6px 12px rgba(66, 153, 225, .28);
}

.menu-link i {
  width: 22px;
  text-align: center;
  color: var(--blue);
}

.badge {
  margin-right: auto;
  min-width: 25px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #dcebf8;
  color: var(--blue-dark);
  font-size: 12px;
  text-align: center;
}

.profile {
  margin-top: auto;
  padding: 18px;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
}

.shop-logo-uploader {
  cursor: pointer;
  color: inherit;
}

.shop-logo-uploader input {
  display: none;
}

.avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #0bb4b8, #7ff0f2);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-plan {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, .18);
}

.upgrade-popover {
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 108px;
  z-index: 45;
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: right;
}

.upgrade-options {
  display: grid;
  gap: 8px;
}

.upgrade-option {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.profile-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr);
  align-items: start;
}

.profile-logo-box {
  cursor: pointer;
}

.profile-logo-box input {
  display: none;
}

.profile-logo-preview {
  width: 116px;
  height: 116px;
  margin-top: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--blue);
  font-size: 36px;
  font-weight: 900;
}

.profile-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-subscription-card {
  min-height: 138px;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-subscription-card span,
.profile-subscription-card small {
  color: var(--muted);
  font-weight: 800;
}

.profile-subscription-card strong {
  font-size: 30px;
}

.page-upgrade-options {
  gap: 12px;
}

.page-upgrade-options .upgrade-option {
  min-height: 54px;
  padding: 12px 14px;
}

.upgrade-option.active-plan {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 18px rgba(66, 153, 225, .28);
}

.sms-preview,
.ai-output {
  min-height: 118px;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.check-row {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.sms-preview strong {
  color: var(--text);
}

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

.ai-card {
  min-height: 116px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.ai-card span,
.ai-card small {
  color: var(--muted);
  font-weight: 800;
}

.ai-card strong {
  font-size: 22px;
}

.ai-coming-soon {
  min-height: min(620px, calc(100vh - 150px));
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(260px, 1fr);
  align-items: center;
  gap: 26px;
  overflow: hidden;
}

.ai-coming-soon img {
  width: min(440px, 100%);
  justify-self: center;
  filter: drop-shadow(22px 28px 26px rgba(66, 153, 225, .18));
}

.ai-coming-copy {
  display: grid;
  gap: 14px;
  justify-items: start;
  direction: ltr;
}

.ai-coming-copy h2 {
  margin: 0;
  color: var(--blue-dark);
  font-family: Arial, "Vazirmatn", sans-serif;
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 900;
  letter-spacing: 0;
}

.ai-coming-copy p {
  margin: 0;
  direction: rtl;
  color: var(--muted);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
}

.main-content {
  min-width: 0;
  display: grid;
  gap: 24px;
  align-content: start;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box,
.search-wide {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.search-box {
  width: 260px;
  height: 44px;
  padding: 0 15px;
}

.search-wide {
  min-height: 54px;
  margin-bottom: 18px;
  padding: 0 18px;
}

.search-box input,
.search-wide input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.notification-wrap {
  position: relative;
}

.notification-button {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  position: relative;
  color: var(--muted);
  cursor: pointer;
}

.notification-button i {
  font-size: 20px;
}

.notification-button span {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.notification-panel {
  position: absolute;
  top: 60px;
  left: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 30px));
  padding: 16px;
  display: grid;
  gap: 12px;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-head span,
.notification-item span,
.notification-item small,
.notification-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.notification-permission {
  min-height: 38px;
  border-radius: 12px;
  color: var(--blue-dark);
  background: rgba(66, 153, 225, .10);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

#notificationList {
  display: grid;
  gap: 10px;
}

.notification-item {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  position: relative;
  display: grid;
  gap: 5px;
  text-align: right;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  box-shadow: inset 5px 5px 9px var(--shadow-dark), inset -5px -5px 9px var(--shadow-light);
}

.notification-item.has-image {
  grid-template-columns: 74px 1fr;
}

.notification-item.has-image img {
  grid-row: 1 / span 3;
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 12px;
}

.notification-item strong,
.notification-item span,
.notification-item small {
  padding-left: 30px;
}

.notification-dismiss {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.notification-dismiss:hover {
  color: var(--red);
  background: rgba(229, 62, 62, .08);
}

.admin-notification-list {
  display: grid;
  gap: 12px;
}

.admin-notification-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: start;
}

.admin-notification-card > img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
}

.admin-notification-card:not(:has(> img)) {
  grid-template-columns: 1fr;
}

.notification-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-card-head span,
.admin-notification-card p,
.admin-notification-card small {
  color: var(--muted);
  font-weight: 800;
}

.admin-notification-card p {
  margin: 8px 0;
  line-height: 1.9;
}

.date-chip,
.icon-button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.theme-toggle {
  width: 92px;
  height: 34px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #edf2f6;
  color: #657184;
  cursor: pointer;
  direction: ltr;
  box-shadow:
    7px 7px 14px rgba(199, 209, 222, .95),
    -7px -7px 14px rgba(255, 255, 255, .98),
    inset 1px 1px 0 rgba(255, 255, 255, .7);
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.theme-label {
  font-family: "Vazirmatn", Arial, sans-serif;
  font-size: 10px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  direction: rtl;
}

.theme-knob {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #bcc3cf;
  background: linear-gradient(145deg, #fbfcfd, #e7ecf2);
  font-size: 14px;
  box-shadow:
    5px 6px 10px rgba(169, 180, 194, .8),
    -4px -4px 9px rgba(255, 255, 255, .95);
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease, color .25s ease;
}

body.dark-mode .theme-toggle {
  padding: 0 10px 0 6px;
  flex-direction: row-reverse;
  background: #252f42;
  color: #d6dde8;
  box-shadow:
    7px 7px 14px rgba(5, 10, 18, .88),
    -7px -7px 14px rgba(45, 59, 84, .74),
    inset 0 0 0 2px rgba(0, 0, 0, .32);
}

body.dark-mode .theme-knob {
  color: #c9d0dc;
  background: linear-gradient(145deg, #f9fbfd, #dfe5ec);
  box-shadow:
    5px 6px 10px rgba(0, 0, 0, .36),
    -3px -3px 8px rgba(255, 255, 255, .22);
}

.icon-button {
  width: 44px;
  padding: 0;
  cursor: pointer;
}

.mobile-menu {
  display: none;
}

.view {
  display: none;
  animation: rise .22s ease;
}

.view.active {
  display: grid;
  gap: 24px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 18px;
}

.stat-card {
  min-height: 132px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  font-size: 25px;
  background: linear-gradient(145deg, #f8fbfd 0%, #e4eaf1 100%);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow:
    13px 13px 24px rgba(196, 207, 222, .95),
    -13px -13px 24px rgba(255, 255, 255, .98);
}

.stat-icon.neu-in {
  box-shadow:
    13px 13px 24px rgba(196, 207, 222, .95),
    -13px -13px 24px rgba(255, 255, 255, .98);
}

.stat-card h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  font-size: 25px;
  line-height: 1.3;
}

.stat-card p {
  margin: 3px 0 0;
}

.content-grid {
  display: grid;
  gap: 22px;
}

.two-cols {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
}

.form-and-table {
  grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
  align-items: start;
}

.stacked-form-table {
  grid-template-columns: 1fr;
  align-items: start;
}

.panel {
  padding: 24px;
  min-width: 0;
}

.panel-header {
  min-height: 38px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .2s ease, filter .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 18px rgba(66, 153, 225, .28);
}

.btn-soft,
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.btn-ghost {
  min-height: 36px;
  color: var(--muted);
}

.btn-small {
  width: 100%;
  min-height: 36px;
  font-size: 13px;
}

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

.form-grid.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.order-section {
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

.order-section legend {
  padding: 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.order-section legend i {
  margin-left: 6px;
  color: var(--blue);
}

.prescription-section {
  display: grid;
  gap: 16px;
}

.prescription-type {
  width: max-content;
  min-height: 48px;
  padding: 7px;
  display: flex;
  gap: 8px;
}

.prescription-type label {
  min-width: 110px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.prescription-type input {
  accent-color: var(--blue);
}

.rx-table-wrap {
  overflow-x: auto;
  padding: 4px;
}

.rx-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
}

.rx-table th,
.rx-table td {
  height: 58px;
  padding: 9px;
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .16);
}

.rx-table thead th {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.rx-table tbody th,
.rx-table tbody td:first-child {
  color: var(--muted);
  font-weight: 900;
}

.rx-table th:first-child {
  border-radius: 0 14px 0 0;
}

.rx-table thead th:last-child {
  border-radius: 14px 0 0 0;
}

.rx-table tbody tr:last-child td:first-child,
.rx-table tbody tr:last-child th:first-child {
  border-radius: 0 0 14px 0;
}

.rx-table tbody tr:last-child td:last-child {
  border-radius: 0 0 0 14px;
}

.rx-table select {
  width: 100%;
  min-width: 86px;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 4px 4px 7px var(--shadow-dark), inset -4px -4px 7px var(--shadow-light);
  text-align: center;
  direction: ltr;
}

.rx-table th span {
  color: var(--text);
  font-size: 15px;
}

.repeat-list {
  display: grid;
  gap: 14px;
}

.customer-picker {
  margin-bottom: 14px;
  position: relative;
}

.customer-search-wrap {
  min-height: 48px;
  margin-top: 8px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.customer-search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.customer-search-wrap input::placeholder {
  color: var(--muted);
}

.customer-search-wrap button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.customer-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 38;
  max-height: 260px;
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: auto;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 12px 16px 28px rgba(183, 195, 211, .95), -10px -10px 22px rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .58);
}

.customer-suggestion {
  min-height: 54px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-align: right;
  box-shadow: 4px 4px 9px var(--shadow-dark), -4px -4px 9px var(--shadow-light);
}

.customer-suggestion strong,
.customer-suggestion span {
  display: block;
}

.customer-suggestion span,
.customer-picker-hint {
  color: var(--muted);
  font-size: 12px;
}

.customer-suggestion i {
  color: var(--blue);
}

.customer-picker-hint {
  margin: 8px 4px 0;
  line-height: 1.8;
  font-weight: 800;
}

.option-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.option-plus {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.range-field {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

.range-field strong {
  display: inline-block;
  margin-right: 10px;
  color: var(--blue-dark);
  direction: ltr;
}

.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.dual-range {
  position: relative;
  height: 34px;
  margin-top: 12px;
}

.dual-range::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  top: 14px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  height: 34px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 4px 5px 10px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 4px 5px 10px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}

.spec-field.hidden {
  display: none;
}

.repeat-card {
  padding: 16px;
}

.repeat-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeat-head strong {
  color: var(--text);
  font-size: 15px;
}

.lens-spec-picker {
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

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

.lens-spec-picker select {
  width: 100%;
}

.repeater-add {
  width: max-content;
  margin-top: 14px;
}

.toggle-row {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
}

.toggle-row input {
  width: 42px;
  height: 22px;
  appearance: none;
  border-radius: 999px;
  background: #cfd8e5;
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  position: relative;
  transition: .2s ease;
}

.toggle-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: .2s ease;
}

.toggle-row input:checked {
  background: var(--blue);
}

.toggle-row input:checked::after {
  right: 23px;
}

.toggle-row span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 16px;
  resize: vertical;
}

textarea.field {
  line-height: 1.8;
}

.jalali-date,
.eye-picker {
  width: 100%;
  min-height: 44px;
  padding: 7px;
  gap: 7px;
  align-items: center;
}

.jalali-date {
  position: relative;
  display: flex;
}

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

.eye-picker select {
  width: 100%;
  min-height: 32px;
  border: 0;
  outline: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.date-display {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.date-display i {
  color: var(--blue);
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(315px, 82vw);
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 12px 16px 28px rgba(183, 195, 211, .95), -10px -10px 22px rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .58);
  display: none;
}

#orderForm .calendar-popover {
  top: calc(100% + 10px);
  bottom: auto;
}

.jalali-date.open .calendar-popover {
  display: grid;
  gap: 12px;
}

.calendar-head,
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-head strong {
  font-size: 14px;
  color: var(--text);
}

.calendar-nav button,
.calendar-day {
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.calendar-nav button {
  width: 32px;
  height: 32px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  font-size: 12px;
}

.calendar-day.placeholder {
  visibility: hidden;
}

.calendar-day.selected {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 16px rgba(66, 153, 225, .28);
}

.eye-field {
  grid-column: span 2;
}

.full,
.form-submit {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 780px;
}

th {
  padding: 0 14px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

td {
  padding: 14px;
  background: rgba(255, 255, 255, .25);
  border-top: 1px solid rgba(255, 255, 255, .55);
  border-bottom: 1px solid rgba(209, 217, 230, .75);
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

td:first-child {
  border-radius: 0 14px 14px 0;
}

td:last-child {
  border-radius: 14px 0 0 14px;
}

.row-title {
  display: grid;
  gap: 2px;
}

.row-title span {
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status.active,
.status.delivered,
.status.ready {
  color: var(--green);
  background: rgba(56, 161, 105, .12);
}

.status.pending,
.status.registered,
.status.progress {
  color: var(--amber);
  background: rgba(214, 158, 46, .14);
}

.status.expired,
.status.cancelled {
  color: var(--red);
  background: rgba(229, 62, 62, .12);
}

.actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.action-btn.edit {
  color: var(--blue-dark);
}

.action-btn.delete {
  color: var(--red);
}

.time-strip {
  min-height: 122px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto minmax(220px, .8fr) minmax(300px, 1fr);
  align-items: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
}

.time-strip::before {
  content: "";
  position: absolute;
  inset: -70% 45% auto -10%;
  height: 220px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(11, 180, 184, .18), rgba(66, 224, 227, .08), transparent);
  transform: rotate(-8deg);
  pointer-events: none;
}

.time-orbit {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--blue);
  background: var(--surface);
  box-shadow: inset 9px 9px 16px var(--shadow-dark), inset -9px -9px 16px var(--shadow-light);
}

.time-orbit i {
  font-size: 27px;
  position: relative;
  z-index: 2;
}

.orbit-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid rgba(66, 153, 225, .22);
  border-top-color: var(--blue);
  animation: orbitSpin 8s linear infinite;
}

.time-main {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.time-clock-card span,
.time-chip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.time-clock-card {
  min-height: 78px;
  padding: 14px 18px;
  display: grid;
  gap: 7px;
  align-content: center;
}

.time-clock-card strong {
  direction: ltr;
  font-size: clamp(30px, 4vw, 46px);
  line-height: .95;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0;
}

.time-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.time-chip {
  min-height: 78px;
  padding: 14px 18px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.time-chip i {
  color: var(--blue);
  font-size: 20px;
}

.time-chip strong {
  font-size: 18px;
}

.bar-chart {
  height: 285px;
  padding: 22px 10px 6px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 14px;
  overflow: hidden;
  contain: paint;
  position: relative;
}

.bar-item {
  flex: 1;
  min-width: 34px;
  height: 100%;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.bar-pill {
  width: min(46px, 100%);
  height: var(--bar-height, 60px);
  max-height: calc(100% - 48px);
  min-height: 18px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  flex: 0 0 auto;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.bar-pill.active-bar,
.bar-item.selected .bar-pill {
  background: #e1e8f0;
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  transform: translateY(-4px);
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bar-value {
  min-height: 18px;
  max-width: 92px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(66, 153, 225, .12);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(6px);
  transition: .2s ease;
  white-space: nowrap;
}

.bar-item.selected .bar-value,
.bar-item:hover .bar-value {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip {
  position: absolute;
  top: 4px;
  left: 10px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.donut-wrap {
  min-height: 285px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
}

.donut {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 45%, var(--amber) 45% 70%, var(--red) 70% 100%);
  box-shadow: 9px 9px 16px var(--shadow-dark), -9px -9px 16px var(--shadow-light);
  position: relative;
}

.donut::after {
  content: "";
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
}

.donut span {
  position: absolute;
  z-index: 1;
  font-weight: 800;
  font-size: 24px;
}

.legend {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.legend-item i {
  color: var(--dot);
}

.tracking-list {
  display: grid;
  gap: 12px;
}

.track-card {
  padding: 15px;
  display: grid;
  gap: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .55);
}

.track-head,
.track-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.track-meta {
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.step {
  height: 7px;
  border-radius: 999px;
  background: #d8e0ea;
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.step.done {
  background: var(--blue);
  box-shadow: none;
}

.plan-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.plan-card h3 {
  margin: 0;
}

.plan-card span {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: 340px;
  padding: 13px 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--text);
  box-shadow: 0 16px 30px rgba(39, 50, 68, .22);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

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

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(39, 50, 68, .22);
  backdrop-filter: blur(12px);
}

.payment-card {
  width: min(500px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 24px;
}

.payment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.payment-head span,
.payment-summary span,
.payment-summary small {
  color: var(--muted);
  font-weight: 800;
}

.payment-head h2 {
  margin: 4px 0 0;
  font-size: 26px;
}

.payment-summary {
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 7px;
}

.payment-summary strong {
  font-size: 28px;
}

.payment-form {
  grid-template-columns: 1fr 1fr;
}

.payment-form .btn-ghost {
  background: transparent;
}

.app-signature {
  margin: 24px auto 0;
  padding: 12px 18px;
  max-width: max-content;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.app-signature span {
  display: inline-block;
  margin-right: 18px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
  direction: ltr;
}

.auth-signature {
  position: static;
  transform: none;
  margin: 0;
}

.receipt-modal,
.public-track-screen {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(39, 50, 68, .22);
  backdrop-filter: blur(12px);
}

.receipt-card,
.public-track-card {
  width: min(760px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 24px;
}

.receipt-head,
.receipt-brand,
.receipt-actions,
.public-track-head,
.public-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.receipt-head span,
.public-track-head span,
.receipt-grid span,
.receipt-qr span,
.receipt-sms span,
.public-status-row span,
.public-order-meta span {
  color: var(--muted);
  font-weight: 800;
}

.receipt-head h2,
.public-track-head h1 {
  margin: 4px 0 0;
  font-size: 25px;
}

.receipt-brand {
  justify-content: flex-start;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .24);
}

.receipt-brand .logo-icon,
.public-track-head .logo-icon {
  flex: 0 0 58px;
}

.receipt-brand strong {
  display: block;
  font-size: 21px;
}

.receipt-brand span {
  color: var(--muted);
  font-weight: 700;
}

.receipt-grid,
.public-order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.receipt-grid div,
.public-order-meta div {
  min-height: 74px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .22);
  box-shadow: inset 3px 3px 7px var(--shadow-dark), inset -3px -3px 7px var(--shadow-light);
  display: grid;
  gap: 7px;
}

.receipt-grid strong,
.public-order-meta strong {
  word-break: break-word;
}

.receipt-qr {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: center;
}

.receipt-qr img {
  width: 190px;
  height: 190px;
  border-radius: 14px;
  background: #fff;
}

.receipt-qr small {
  display: block;
  direction: ltr;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  word-break: break-all;
}

.receipt-sms {
  margin-top: 14px;
  padding: 14px 16px;
}

.receipt-sms p {
  margin: 7px 0 0;
  line-height: 1.9;
}

.receipt-actions {
  margin-top: 18px;
  justify-content: flex-start;
}

.action-btn.receipt {
  color: var(--blue);
}

.public-track-card {
  width: min(680px, 100%);
}

.public-track-head {
  justify-content: flex-start;
  margin-bottom: 22px;
}

.public-status-row {
  margin-bottom: 14px;
}

.public-status-row strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.public-order-meta {
  margin-bottom: 18px;
}

.public-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.public-step {
  min-height: 86px;
  padding: 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
}

.public-step span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(66, 153, 225, .12);
  color: var(--blue);
  font-weight: 900;
}

.public-step.done {
  color: var(--text);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.public-step.done span {
  background: var(--blue);
  color: #fff;
}

.public-note,
.public-empty span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.9;
}

.public-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  padding: 24px;
}

.public-empty i {
  color: var(--amber);
  font-size: 42px;
}

.mobile-backdrop {
  display: none;
}

body.sidebar-locked {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    top: 12px;
    right: 12px;
    bottom: 12px;
    height: auto;
    width: min(340px, calc(100vw - 24px));
    padding: 18px 14px 16px;
    transform: translateX(calc(100% + 40px));
    transition: transform .25s ease, box-shadow .25s ease;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    width: 42px;
    height: 42px;
    margin: 0 0 12px auto;
    display: grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
    border-radius: 50%;
  }

  .sidebar .logo {
    margin-bottom: 18px;
  }

  .menu-group {
    margin-bottom: 16px;
  }

  .menu-link {
    min-height: 50px;
    margin-bottom: 7px;
    padding: 12px 14px;
    font-size: 14px;
  }

  .mobile-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(39, 50, 68, .24);
    backdrop-filter: blur(3px);
  }

  .two-cols,
  .form-and-table,
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    padding: 10px;
    gap: 12px;
  }

  .auth-screen {
    min-height: 100svh;
    padding: 12px;
    gap: 10px;
  }

  .login-panel {
    min-height: auto;
    width: min(440px, 100%);
    padding: 18px 18px;
    grid-template-columns: 1fr;
    gap: 12px;
    direction: rtl;
  }

  .login-copy {
    max-width: none;
    justify-items: stretch;
    text-align: center;
    order: 2;
    min-height: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    margin: 0 auto 22px;
  }

  .login-panel h1,
  .login-panel p {
    text-align: center;
  }

  .login-panel p {
    margin-bottom: 18px;
  }

  .login-submit {
    min-height: 52px;
    margin-top: 16px;
    font-size: 18px;
  }

  input,
  select,
  textarea,
  .field,
  .login-field input,
  .demo-field {
    font-size: 16px !important;
  }

  .login-field,
  .field,
  .date-display,
  .customer-search-wrap {
    min-height: 50px;
  }

  label {
    font-size: 13px;
    line-height: 1.6;
  }

  .auth-signature {
    max-width: calc(100vw - 28px);
    padding: 8px 12px;
    font-size: 10px;
    line-height: 1.9;
    border-radius: 18px;
  }

  .auth-signature span {
    margin-right: 8px;
    padding-right: 8px;
  }

  .login-visual {
    min-height: 175px;
    order: 1;
  }

  .glass-object {
    width: min(215px, 70vw);
  }

  .login-glasses-logo {
    width: min(230px, 72vw);
    max-height: 115px;
  }

  .login-home-link {
    font-size: 12px;
    padding: 8px 12px;
  }

  .glass-core {
    width: 112px;
    height: 112px;
    font-size: 40px;
  }

  .ring-one {
    width: 140px;
    height: 140px;
  }

  .ring-two {
    width: 112px;
    height: 112px;
  }

  .plane-one {
    width: 126px;
    height: 78px;
    top: 38px;
  }

  .plane-two {
    width: 114px;
    height: 90px;
    bottom: 35px;
  }

  .plane-three {
    width: 92px;
    height: 82px;
    top: 78px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    min-height: auto;
    padding: 16px;
    border-radius: 18px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-box {
    flex: 1 1 100%;
    width: 100%;
    min-height: 48px;
  }

  .date-chip {
    min-height: 46px;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header h2 {
    font-size: 17px;
  }

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

  .form-grid,
  .form-grid.wide,
  .plans-grid,
  .ai-summary-grid,
  .ai-coming-soon,
  .time-strip,
  .donut-wrap,
  .receipt-grid,
  .receipt-qr,
  .public-order-meta,
  .public-steps {
    grid-template-columns: 1fr;
  }

  .order-section {
    padding: 14px;
    border-radius: 16px;
  }

  .table-wrap {
    margin-inline: -4px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 700px;
  }

  .prescription-type {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ai-coming-copy {
    justify-items: center;
    text-align: center;
  }

  .time-strip,
  .time-main {
    text-align: center;
    justify-items: center;
  }

  .time-meta {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    justify-items: center;
  }

  .bar-chart {
    height: 220px;
    gap: 8px;
  }

  .calendar-popover {
    right: 50%;
    width: min(315px, calc(100vw - 32px));
    transform: translateX(50%);
  }
}

@media (max-width: 560px) {
  .login-panel,
  .panel {
    padding: 14px;
  }

  .login-panel {
    border-radius: 10px;
  }

  .login-panel h1 {
    font-size: 32px;
  }

  .auth-screen {
    padding: 8px;
  }

  .login-field {
    height: 50px;
    border-radius: 16px;
  }

  .login-visual {
    min-height: 145px;
  }

  .login-glasses-logo {
    max-height: 105px;
  }

  .auth-signature {
    font-size: 9px;
    padding: 7px 10px;
    line-height: 1.8;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .topbar p {
    font-size: 12px;
    line-height: 1.7;
  }

  .mobile-menu,
  .icon-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
  }

  .theme-toggle {
    width: 86px;
  }

  .btn,
  .btn-small,
  .btn-ghost,
  .btn-primary {
    min-height: 44px;
    font-size: 14px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .topbar-actions .theme-toggle {
    order: 2;
  }

  .sidebar {
    inset: 8px 8px 8px auto;
    width: min(316px, calc(100vw - 16px));
    border-radius: 22px;
  }

  .sidebar-close {
    width: 40px;
    height: 40px;
  }

  .menu-title {
    margin-bottom: 8px;
  }

  .menu-link {
    min-height: 48px;
    border-radius: 13px;
  }

  .date-chip {
    width: 100%;
  }

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

  .stat-card {
    min-height: 112px;
  }

  .bar-item {
    min-width: 24px;
  }

  .bar-item span {
    writing-mode: vertical-rl;
  }
}

@media (max-width: 420px) {
  .topbar-actions {
    grid-template-columns: 1fr 42px 42px;
  }

  .topbar-actions .search-box {
    grid-column: 1 / -1;
    order: -1;
  }

  .theme-toggle {
    width: 100%;
    grid-column: 1 / -1;
  }

  .login-panel {
    padding: 12px;
  }
}

body.dark-mode .menu-link:hover,
body.dark-mode .menu-link.active {
  box-shadow: 6px 8px 14px rgba(7, 12, 21, .88), -5px -5px 12px rgba(36, 49, 73, .82);
}

body.dark-mode .badge {
  background: rgba(33, 210, 214, .14);
  color: var(--blue-dark);
}

body.dark-mode .avatar {
  background: linear-gradient(145deg, #07898d, #21d2d6);
}

body.dark-mode .logo-icon,
body.dark-mode .stat-icon,
body.dark-mode .stat-icon.neu-in {
  background: linear-gradient(145deg, #202d42, #121b2a);
  border-color: rgba(33, 210, 214, .12);
  box-shadow: 12px 12px 22px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
}

body.dark-mode .stat-card,
body.dark-mode .panel,
body.dark-mode .sidebar,
body.dark-mode .time-strip {
  border: 1px solid rgba(255, 255, 255, .035);
}

body.dark-mode .btn-soft,
body.dark-mode .btn-ghost,
body.dark-mode .action-btn,
body.dark-mode .upgrade-option,
body.dark-mode .calendar-nav button,
body.dark-mode .calendar-day {
  background: var(--surface);
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  color: var(--text);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #74849a;
}

body.dark-mode td {
  background: rgba(255, 255, 255, .035);
  border-top-color: rgba(255, 255, 255, .08);
  border-bottom-color: rgba(0, 0, 0, .32);
}

body.dark-mode .calendar-popover {
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 12px 16px 28px rgba(3, 8, 16, .82), -10px -10px 22px rgba(36, 49, 73, .72);
}

body.dark-mode .calendar-day.selected {
  color: #fff;
}

body.dark-mode .bar-pill {
  background: var(--surface);
}

body.dark-mode .bar-pill.active-bar,
body.dark-mode .bar-item.selected .bar-pill {
  background: #223149;
}

body.dark-mode .bar-value {
  background: rgba(33, 210, 214, .14);
  color: var(--blue-dark);
}

body.dark-mode .track-card {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .08);
}

body.dark-mode .order-section,
body.dark-mode .rx-table th,
body.dark-mode .rx-table td {
  background: rgba(255, 255, 255, .035);
}

body.dark-mode .step {
  background: #26354c;
}

body.dark-mode .toast {
  background: #e8eef8;
  color: #111827;
}

body.dark-mode .receipt-brand,
body.dark-mode .receipt-grid div,
body.dark-mode .public-order-meta div {
  background: rgba(255, 255, 255, .035);
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #receiptModal,
  #receiptContent,
  #receiptContent * {
    visibility: visible !important;
  }

  #receiptModal {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
    backdrop-filter: none;
  }

  #receiptContent {
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 18mm;
    color: #1f2937;
    background: #fff;
    box-shadow: none;
  }

  .receipt-screen-only {
    display: none !important;
  }
}
