:root {
  --ink: #111827;
  --muted: #667085;
  --line: #d7e0dc;
  --brand: #04786f;
  --brand-dark: #075f59;
  --brand-light: #16a394;
  --accent: #b42318;
  --card: #ffffff;
  --soft: #e8f5f2;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #eef6f3;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

h1,
p {
  margin-top: 0;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 48px);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(241, 250, 247, 0.78)),
    radial-gradient(circle at 18% 16%, rgba(22, 163, 148, 0.22), transparent 30%),
    radial-gradient(circle at 84% 84%, rgba(4, 120, 111, 0.18), transparent 34%),
    #eef6f3;
}

.ambient,
.lens-ring {
  position: absolute;
  pointer-events: none;
}

.ambient {
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.42;
  animation: floatGlow 8s ease-in-out infinite;
}

.ambient-one {
  left: -120px;
  top: -90px;
  background: rgba(22, 163, 148, 0.32);
}

.ambient-two {
  right: -140px;
  bottom: -120px;
  background: rgba(214, 159, 49, 0.24);
  animation-delay: -3s;
}

.lens-ring {
  border-radius: 999px;
  border: 1px solid rgba(4, 120, 111, 0.16);
  animation: slowSpin 18s linear infinite;
}

.lens-ring::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  border: 20px solid rgba(4, 120, 111, 0.06);
}

.lens-ring-one {
  width: 280px;
  height: 280px;
  right: 10%;
  top: 8%;
}

.lens-ring-two {
  width: 190px;
  height: 190px;
  left: 12%;
  bottom: 10%;
  animation-direction: reverse;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(18px);
  animation: cardIn 0.7s ease both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(22, 163, 148, 0.45), rgba(255, 255, 255, 0.2), rgba(214, 159, 49, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-brand-row strong {
  display: block;
  color: #233936;
  font-size: 1rem;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  box-shadow: 0 16px 30px rgba(4, 120, 111, 0.26);
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-copy h1,
.dashboard-header h1 {
  margin-bottom: 10px;
  font-size: clamp(2.15rem, 5vw, 3.15rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-copy p {
  margin-bottom: 30px;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: #263937;
  font-size: 0.9rem;
  font-weight: 800;
}

.field-group input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field-group input::placeholder {
  color: #98a5a1;
}

.field-group input:focus {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(4, 120, 111, 0.12), 0 12px 26px rgba(17, 24, 39, 0.08);
}

.field-error,
.login-error {
  color: var(--accent);
  font-size: 0.86rem;
}

.login-error {
  padding: 12px 14px;
  border: 1px solid #fecdca;
  border-radius: 14px;
  background: #fffbfa;
}

.primary-btn,
.secondary-btn {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  position: relative;
  margin-top: 4px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 18px 30px rgba(4, 120, 111, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: transform 0.55s ease;
}

.primary-btn span {
  position: relative;
  z-index: 1;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 38px rgba(4, 120, 111, 0.28);
}

.primary-btn:hover::before {
  transform: translateX(110%);
}

.secondary-btn {
  padding: 0 18px;
  color: var(--brand-dark);
  background: #e6f4f1;
}

.dashboard-shell {
  min-height: 100vh;
  padding: clamp(24px, 5vw, 56px);
  background: linear-gradient(135deg, #f7fbff 0%, #eef6f1 52%, #fff8ec 100%);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

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

.info-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid rgba(213, 221, 217, 0.9);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.08);
}

.info-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.info-card strong {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatGlow {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(26px, 18px, 0) scale(1.06);
  }
}

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

@media (max-width: 820px) {
  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 460px) {
  .login-shell {
    padding: 18px;
  }

  .login-card {
    border-radius: 20px;
  }

  .login-brand-row {
    margin-bottom: 28px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }
}

/* App header and BloodCheck-style slide menu */
.app-body {
  background: #f5f7fb;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: rgba(232, 245, 242, 0.96);
  border-bottom: 1px solid #d7e0dc;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(12px);
}

.hamburger {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 0;
  border-radius: 12px;
  background: #dff2ef;
  cursor: pointer;
}

.hamburger span {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: var(--brand-dark);
}

.app-title-wrap {
  flex: 1;
  text-align: center;
}

.app-title {
  margin: 0;
  color: #102a27;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
}

.welcome-date {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.header-user-chip {
  min-width: 150px;
  display: grid;
  justify-items: end;
  line-height: 1.2;
}

.header-user-chip span {
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.header-user-chip strong {
  max-width: 170px;
  color: #102a27;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: none;
  background: rgba(17, 24, 39, 0.42);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 280px;
  height: 100vh;
  padding: 16px;
  overflow-y: auto;
  background: #e8f5f2;
  border-right: 1px solid #c9d8d4;
  box-shadow: 18px 0 45px rgba(17, 24, 39, 0.18);
  transform: translateX(-105%);
  transition: transform 0.25s ease;
}

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

.menu-open .menu-overlay {
  display: block;
}

.sidebar-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #c9d8d4;
}

.menu-brand {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.sidebar-head strong,
.sidebar-head span {
  display: block;
}

.sidebar-head strong {
  color: #102a27;
  font-size: 0.98rem;
}

.sidebar-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.close-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #102a27;
  background: #dbece8;
  font-weight: 900;
  cursor: pointer;
}

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

.menu-item {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #102a27;
  background: #d7ebe7;
  text-align: left;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.menu-item:hover,
.menu-item.active,
.menu-item.expanded {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  transform: translateX(2px);
}

.menu-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 900;
}

.menu-caret {
  font-size: 1rem;
  font-weight: 900;
}

.menu-item.expanded .menu-caret {
  transform: rotate(45deg);
}

.submenu {
  display: none;
  margin: -2px 0 10px 40px;
  padding-left: 10px;
  border-left: 2px solid #c4d7d2;
}

.submenu.open {
  display: block;
  animation: submenuIn 0.18s ease both;
}

.submenu-item {
  display: block;
  margin: 5px 0;
  padding: 9px 10px;
  border-radius: 9px;
  color: #263937;
  background: rgba(255, 255, 255, 0.64);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.submenu-item:hover {
  color: var(--brand-dark);
  background: #fff;
}

.sidebar-logout {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #c9d8d4;
}

.logout-item {
  color: #8a1f17;
  background: #fff0ee;
}

.main-body {
  min-height: 100vh;
  padding-top: 58px;
}

.main-body .dashboard-shell {
  min-height: calc(100vh - 58px);
}

@keyframes submenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .app-header {
    padding: 8px 12px;
  }

  .header-user-chip {
    display: none;
  }

  .app-title {
    font-size: 1rem;
  }

  .welcome-date {
    font-size: 0.74rem;
  }

  .sidebar {
    width: min(86vw, 280px);
  }
}

.submenu-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 7px;
  color: var(--brand-dark);
  background: #e8f5f2;
  font-size: 0.72rem;
  font-weight: 900;
}

.mobile-close {
  margin-bottom: 14px;
}

.logout-button {
  text-align: center;
}

/* Frame Purchase tabs */
.module-shell {
  min-height: calc(100vh - 58px);
  padding: clamp(18px, 4vw, 34px);
  background: linear-gradient(135deg, #f7fbff 0%, #eef6f1 52%, #fff8ec 100%);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.module-header h1 {
  margin: 0;
  color: #102a27;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  letter-spacing: 0;
}

.module-branch {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e6f4f1;
  font-weight: 900;
}

.tab-card {
  overflow: hidden;
  border: 1px solid rgba(213, 221, 217, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 55px rgba(16, 24, 40, 0.09);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: #e8f5f2;
}

.tab-button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: #263937;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab-button.active,
.tab-button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
  padding: clamp(18px, 3vw, 28px);
}

.tab-panel.active {
  display: block;
  animation: tabIn 0.22s ease both;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title-row h2 {
  margin: 0 0 6px;
  color: #102a27;
  font-size: 1.25rem;
  font-weight: 900;
}

.panel-title-row p {
  margin: 0;
  color: var(--muted);
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e6f4f1;
  font-size: 0.78rem;
  font-weight: 900;
}

.form-grid,
.search-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.search-toolbar {
  align-items: end;
  grid-template-columns: minmax(220px, 1fr) 180px 180px 130px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: #344054;
  font-size: 0.86rem;
  font-weight: 900;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(4, 120, 111, 0.1);
}

.readonly-field input {
  color: var(--brand-dark);
  background: #edf8f5;
  font-weight: 900;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.compact-btn {
  min-width: 130px;
  padding: 0 18px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 170px;
  margin-top: 18px;
  border: 1px dashed #c6d6d1;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(232, 245, 242, 0.48);
  text-align: center;
}

.empty-state strong {
  color: #263937;
}

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .form-grid,
  .search-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .module-header,
  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .search-toolbar {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;
  }

  .compact-btn {
    width: 100%;
  }
}

/* Frame purchase item form */
.purchase-item-panel {
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 217, 0.95);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.08);
}

.item-header {
  padding: 14px 18px 12px;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
}

.item-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
}

.item-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.item-badges span {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
}

.item-form {
  padding: 16px 18px 20px;
}

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

.item-grid .form-field label {
  color: #0956a8;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.item-grid .form-field input,
.item-grid .form-field select,
.checkbox-field {
  min-height: 42px;
  border-radius: 12px;
  background: #f8fbff;
  border-color: #cfe0f8;
}

.item-grid .readonly-field input {
  background: #e9edf2;
}

.checkbox-field {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px;
  border: 1px solid #cfe0f8;
}

.checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #0f2744 !important;
  font-size: 0.88rem !important;
  text-transform: none !important;
}

.checkbox-field input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--brand);
}

@media (max-width: 760px) {
  .item-grid {
    grid-template-columns: 1fr;
  }
}

/* Combined frame purchase page */
.single-purchase-card {
  padding: clamp(18px, 3vw, 26px);
  margin-bottom: 24px;
}

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

.multi-item-panel {
  margin-top: 0;
}

.items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5ece9;
  background: #fbfefd;
}

.items-toolbar strong,
.items-toolbar span {
  display: block;
}

.items-toolbar strong {
  color: #102a27;
  font-size: 1rem;
}

.items-toolbar span {
  color: var(--muted);
  font-size: 0.88rem;
}

.add-row-btn {
  min-width: 118px;
}

.item-table-wrap {
  overflow-x: auto;
  padding: 12px;
}

.item-entry-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.item-entry-table th {
  padding: 0 8px 6px;
  color: #0956a8;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.item-entry-table td {
  padding: 0 4px;
}

.item-entry-table input,
.item-entry-table select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cfe0f8;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ink);
  outline: none;
}

.item-entry-table input:focus,
.item-entry-table select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(4, 120, 111, 0.09);
}

.item-entry-table input[readonly] {
  background: #e9edf2;
  font-weight: 800;
}

.row-remove {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #8a1f17;
  background: #fff0ee;
  font-size: 0.78rem;
  font-weight: 900;
}

.save-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 16px 18px 20px;
  border-top: 1px solid #e5ece9;
  background: #fbfefd;
}

.save-footer div {
  min-width: 120px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #d7e0dc;
  border-radius: 12px;
  background: #fff;
}

.save-footer span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.save-footer strong {
  color: #102a27;
  font-size: 1.05rem;
}

.save-all-btn {
  min-width: 160px;
  padding: 0 22px;
}

.save-alert {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 12px;
  font-weight: 800;
}

.success-alert {
  color: #075f59;
  background: #dcf7ef;
  border: 1px solid #a7ead8;
}

.error-alert {
  color: #8a1f17;
  background: #fff0ee;
  border: 1px solid #fecdca;
}

@media (max-width: 1180px) {
  .bill-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bill-grid {
    grid-template-columns: 1fr;
  }

  .items-toolbar,
  .save-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .save-all-btn,
  .add-row-btn {
    width: 100%;
  }
}

.multi-item-panel .item-header {
  display: none;
}

/* Professional purchase entry polish */
.frame-purchase-page {
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text-strong: #17212b;
  --text-soft: #667085;
  --border-soft: #e4e7ec;
  --border-strong: #cfd6df;
  --focus: #0f766e;
  padding: 28px clamp(22px, 3vw, 42px) 36px;
  background: #f3f6f8;
}

.purchase-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.purchase-header h1 {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 800;
}

.module-subtitle {
  max-width: 680px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.header-summary {
  display: flex;
  gap: 10px;
}

.header-summary div {
  min-width: 118px;
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.04);
}

.header-summary span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.header-summary strong {
  color: var(--text-strong);
  font-size: 1rem;
}

.single-purchase-card,
.multi-item-panel {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.06);
}

.single-purchase-card {
  padding: 22px;
}

.panel-title-row {
  align-items: center;
  margin-bottom: 18px;
}

.panel-title-row h2 {
  color: var(--text-strong);
  font-size: 1.08rem;
  font-weight: 800;
}

.panel-title-row p {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.status-pill {
  border: 1px solid #bfe3dc;
  border-radius: 999px;
  background: #effaf7;
  color: var(--focus);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.bill-grid {
  grid-template-columns: 110px 130px 1.2fr 150px 150px 150px 110px 130px 130px 130px 130px;
  gap: 12px;
  align-items: end;
}

.form-field {
  gap: 5px;
}

.form-field label,
.item-entry-table th {
  color: #475467;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.item-entry-table input,
.item-entry-table select {
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-strong);
  font-size: 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-field input,
.form-field select {
  padding: 8px 10px;
}

.form-field input:focus,
.form-field select:focus,
.item-entry-table input:focus,
.item-entry-table select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.readonly-field input,
.item-entry-table input[readonly] {
  color: #344054;
  background: #f2f4f7;
  font-weight: 800;
}

.items-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: #fcfcfd;
}

.items-toolbar strong {
  color: var(--text-strong);
  font-size: 1.02rem;
  font-weight: 800;
}

.items-toolbar span {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.add-row-btn {
  min-height: 38px;
  min-width: 112px;
  border-radius: 6px;
  color: var(--focus);
  background: #eaf7f4;
  font-size: 0.9rem;
  box-shadow: none;
}

.item-table-wrap {
  padding: 8px 12px 12px;
  background: #ffffff;
}

.item-entry-table {
  min-width: 1320px;
  border-collapse: collapse;
  border-spacing: 0;
}

.item-entry-table thead tr {
  border-bottom: 1px solid var(--border-soft);
}

.item-entry-table th {
  padding: 10px 6px;
  background: #ffffff;
  white-space: nowrap;
}

.item-entry-table tbody tr {
  border-bottom: 1px solid #eef2f6;
}

.item-entry-table tbody tr:hover {
  background: #f8fafc;
}

.item-entry-table td {
  padding: 8px 4px;
  vertical-align: middle;
}

.item-entry-table input,
.item-entry-table select {
  min-height: 36px;
  padding: 7px 8px;
  border-color: #d0d5dd;
  background: #ffffff;
}

.row-remove {
  min-height: 34px;
  border-radius: 6px;
  color: #b42318;
  background: #fff4f2;
  font-size: 0.76rem;
}

.save-footer {
  position: sticky;
  bottom: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.save-footer div {
  min-width: 126px;
  padding: 8px 11px;
  border-color: var(--border-soft);
  border-radius: 8px;
  box-shadow: none;
}

.save-footer span {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.save-footer strong {
  color: var(--text-strong);
  font-size: 1rem;
}

.save-all-btn {
  min-height: 42px;
  min-width: 150px;
  border-radius: 7px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.save-alert {
  border-radius: 8px;
  font-size: 0.92rem;
}

@media (max-width: 1380px) {
  .bill-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .purchase-header {
    align-items: flex-start;
  }

  .header-summary {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-summary div {
    flex: 1 1 130px;
  }

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

@media (max-width: 560px) {
  .frame-purchase-page {
    padding: 18px 14px 28px;
  }

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

/* Executive-grade Frame Purchase refinement */
.frame-purchase-page {
  --page-bg: #f6f7f9;
  --card-bg: #ffffff;
  --ink-900: #111827;
  --ink-700: #344054;
  --ink-500: #667085;
  --line-100: #eef0f3;
  --line-200: #d8dee6;
  --line-300: #c5cdd8;
  --teal-700: #0f766e;
  --teal-50: #eef8f6;
  --danger-50: #fff4f2;
  --danger-700: #b42318;
  padding: 24px 28px 34px;
  background: var(--page-bg);
}

.frame-purchase-page .eyebrow {
  margin-bottom: 7px;
  color: var(--teal-700);
  font-size: 0.7rem;
  font-weight: 800;
}

.purchase-header {
  margin-bottom: 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line-200);
}

.purchase-header h1 {
  color: var(--ink-900);
  font-size: 2.2rem;
  line-height: 1.08;
  font-weight: 780;
}

.module-subtitle {
  color: var(--ink-500);
  font-size: 0.94rem;
}

.header-summary {
  align-items: stretch;
}

.header-summary div {
  min-width: 128px;
  padding: 9px 13px;
  border-radius: 6px;
  background: #ffffff;
  border-color: var(--line-200);
  box-shadow: none;
}

.header-summary span,
.save-footer span {
  color: var(--ink-500);
  font-size: 0.66rem;
  font-weight: 800;
}

.header-summary strong {
  color: var(--ink-900);
  font-size: 0.96rem;
}

.section-card {
  border: 1px solid var(--line-200);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px rgba(16, 24, 40, 0.045);
}

.section-kicker {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-100);
  color: var(--ink-700);
  background: #fbfcfd;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.single-purchase-card {
  padding: 0;
  margin-bottom: 18px;
}

.single-purchase-card .panel-title-row {
  margin: 0;
  padding: 16px 18px 4px;
}

.panel-title-row h2 {
  color: var(--ink-900);
  font-size: 1rem;
  font-weight: 780;
}

.panel-title-row p {
  color: var(--ink-500);
  font-size: 0.84rem;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: #0b625c;
  background: var(--teal-50);
  font-size: 0.68rem;
}

.bill-grid {
  padding: 14px 18px 18px;
  grid-template-columns: 100px 125px minmax(170px, 1.2fr) 140px 135px 140px 96px 120px 120px 120px 112px;
  gap: 10px;
}

.form-field label,
.item-entry-table th {
  color: #536071;
  font-size: 0.66rem;
  font-weight: 820;
}

.form-field input,
.form-field select,
.item-entry-table input,
.item-entry-table select {
  min-height: 34px;
  border-radius: 5px;
  border-color: var(--line-300);
  color: var(--ink-900);
  font-size: 0.86rem;
}

.form-field input,
.form-field select {
  padding: 7px 9px;
}

.form-field input::placeholder,
.item-entry-table input::placeholder {
  color: #98a2b3;
}

.readonly-field input,
.item-entry-table input[readonly] {
  color: #475467;
  background: #f3f5f7;
}

.multi-item-panel {
  margin-top: 0;
  border-radius: 8px;
}

.multi-item-panel .section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.items-toolbar {
  padding: 13px 16px;
  background: #ffffff;
}

.items-toolbar strong {
  color: var(--ink-900);
  font-size: 0.98rem;
  font-weight: 780;
}

.items-toolbar span {
  color: var(--ink-500);
  font-size: 0.83rem;
}

.add-row-btn {
  min-height: 34px;
  min-width: 104px;
  padding: 0 12px;
  border: 1px solid #b8ded8;
  border-radius: 5px;
  color: #0b625c;
  background: #f2fbf9;
  font-size: 0.84rem;
  font-weight: 780;
}

.add-row-btn span {
  display: inline-block;
  margin-right: 4px;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}

.item-table-wrap {
  padding: 0 12px 8px;
  background: #ffffff;
}

.item-entry-table {
  min-width: 1340px;
}

.item-entry-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 5px 8px;
  background: #f8fafc;
  border-top: 1px solid var(--line-100);
  border-bottom: 1px solid var(--line-200);
}

.item-entry-table tbody tr {
  background: #ffffff;
}

.item-entry-table tbody tr:nth-child(even) {
  background: #fcfcfd;
}

.item-entry-table tbody tr:hover {
  background: #f5fbf9;
}

.item-entry-table td {
  padding: 6px 4px;
}

.item-entry-table input,
.item-entry-table select {
  min-height: 33px;
  padding: 6px 7px;
  background: #ffffff;
}

.item-entry-table td:nth-child(8),
.item-entry-table td:nth-child(9),
.item-entry-table td:nth-child(10),
.item-entry-table td:nth-child(11),
.item-entry-table td:nth-child(12) {
  min-width: 92px;
}

.item-entry-table td:nth-child(13) {
  width: 76px;
}

.row-remove {
  min-height: 31px;
  padding: 0 8px;
  border: 1px solid #ffd0c9;
  border-radius: 5px;
  color: var(--danger-700);
  background: var(--danger-50);
  font-size: 0.7rem;
  font-weight: 800;
}

.save-footer {
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  background: #fbfcfd;
}

.save-footer div {
  min-width: 112px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #ffffff;
}

.save-footer strong {
  color: var(--ink-900);
  font-size: 0.96rem;
}

.save-all-btn {
  min-height: 38px;
  min-width: 184px;
  border-radius: 5px;
  background: #0f766e;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 820;
}

.save-all-btn:hover {
  background: #0b625c;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.save-alert {
  padding: 11px 13px;
  border-radius: 6px;
}

@media (max-width: 1400px) {
  .bill-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Premium ERP visual theme for Frame Purchase */
.frame-purchase-page {
  --premium-bg-a: #eef7f5;
  --premium-bg-b: #f7f9fc;
  --premium-card: rgba(255, 255, 255, 0.94);
  --premium-teal: #0d9488;
  --premium-teal-dark: #0f766e;
  --premium-blue: #2563eb;
  --premium-gold: #d99b2b;
  --premium-ink: #102033;
  --premium-muted: #667085;
  --premium-line: #dbe4ee;
  --premium-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  position: relative;
  padding: 26px 30px 38px;
  background:
    radial-gradient(circle at 5% 4%, rgba(13, 148, 136, 0.16), transparent 28%),
    radial-gradient(circle at 96% 12%, rgba(37, 99, 235, 0.10), transparent 26%),
    linear-gradient(135deg, var(--premium-bg-a), var(--premium-bg-b) 48%, #fff8ed);
}

.frame-purchase-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 72%);
}

.combined-purchase-form,
.purchase-header,
.save-alert {
  position: relative;
  z-index: 1;
}

.premium-purchase-hero {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(219, 228, 238, 0.84);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(240,250,247,0.9));
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(14px);
}

.hero-title-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hero-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--premium-teal-dark), var(--premium-teal));
  box-shadow: 0 16px 30px rgba(13, 148, 136, 0.28);
  font-weight: 900;
}

.premium-purchase-hero h1 {
  margin-bottom: 5px;
  color: var(--premium-ink);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 900;
}

.hero-subtitle {
  margin: 0;
  color: var(--premium-muted);
  font-size: 0.95rem;
}

.premium-purchase-hero .header-summary {
  flex: 0 0 auto;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.premium-purchase-hero .header-summary div {
  min-width: 132px;
  width: max-content;
  max-width: 190px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.premium-purchase-hero .header-summary span {
  color: var(--premium-teal-dark);
  white-space: nowrap;
}

.premium-purchase-hero .header-summary strong {
  display: block;
  color: var(--premium-ink);
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-card {
  overflow: hidden;
  border: 1px solid rgba(219, 228, 238, 0.9);
  border-radius: 18px;
  background: var(--premium-card);
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(12px);
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(219, 228, 238, 0.82);
  background: linear-gradient(135deg, #f8fffd, #f5f8ff);
}

.section-kicker span {
  color: var(--premium-ink);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-kicker em {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--premium-teal-dark);
  background: #e9faf6;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.single-purchase-card .panel-title-row {
  padding: 17px 20px 6px;
}

.panel-title-row h2,
.items-toolbar strong {
  color: var(--premium-ink);
  font-weight: 900;
}

.panel-title-row p,
.items-toolbar span {
  color: var(--premium-muted);
}

.status-pill {
  border: 1px solid rgba(217, 155, 43, 0.28);
  color: #9a650b;
  background: #fff7e8;
}

.bill-grid {
  padding: 16px 20px 22px;
  gap: 13px;
}

.form-field label,
.item-entry-table th {
  color: #334155;
  font-weight: 900;
}

.form-field input,
.form-field select,
.item-entry-table input,
.item-entry-table select {
  border: 1px solid #cbd8e6;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--premium-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 1px 2px rgba(15,23,42,0.04);
}

.form-field input:focus,
.form-field select:focus,
.item-entry-table input:focus,
.item-entry-table select:focus {
  border-color: var(--premium-teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.13), 0 8px 16px rgba(15, 23, 42, 0.06);
}

.readonly-field input,
.item-entry-table input[readonly] {
  color: #18364f;
  background: linear-gradient(180deg, #eef4f8, #e8eef5);
}

.items-toolbar {
  padding: 16px 18px;
  background: rgba(255,255,255,0.92);
}

.add-row-btn {
  min-height: 40px;
  min-width: 120px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--premium-blue), var(--premium-teal));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.item-table-wrap {
  padding: 0 14px 12px;
}

.item-entry-table {
  border-collapse: separate;
  border-spacing: 0 7px;
}

.item-entry-table thead th {
  top: 0;
  padding: 12px 8px;
  color: #24415f;
  background: linear-gradient(135deg, #eaf7f4, #eef4ff);
  border-top: 1px solid rgba(203, 216, 230, 0.9);
  border-bottom: 1px solid rgba(203, 216, 230, 0.9);
}

.item-entry-table thead th:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.item-entry-table thead th:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.item-entry-table tbody tr {
  background: transparent;
  border-bottom: 0;
}

.item-entry-table tbody tr:nth-child(even),
.item-entry-table tbody tr:hover {
  background: transparent;
}

.item-entry-table td {
  padding: 4px 5px;
  background: rgba(255,255,255,0.92);
  border-top: 1px solid rgba(219, 228, 238, 0.85);
  border-bottom: 1px solid rgba(219, 228, 238, 0.85);
}

.item-entry-table td:first-child {
  border-left: 1px solid rgba(219, 228, 238, 0.85);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.item-entry-table td:last-child {
  border-right: 1px solid rgba(219, 228, 238, 0.85);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.item-entry-table tbody tr:hover td {
  background: #f6fffc;
  border-color: rgba(13, 148, 136, 0.28);
}

.item-entry-table input,
.item-entry-table select {
  min-height: 36px;
  border-radius: 9px;
  background: #ffffff;
}

.row-remove {
  border: 0;
  border-radius: 9px;
  color: #b42318;
  background: #fff0ed;
}

.save-footer {
  margin: 0 14px 14px;
  border: 1px solid rgba(219, 228, 238, 0.9);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,247,245,0.96));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.save-footer div {
  border: 1px solid rgba(13, 148, 136, 0.16);
  border-radius: 12px;
  background: #ffffff;
}

.save-footer span {
  color: var(--premium-muted);
}

.save-footer strong {
  color: var(--premium-ink);
  font-size: 1.08rem;
}

.save-all-btn {
  min-height: 44px;
  min-width: 210px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--premium-teal-dark), var(--premium-teal));
  box-shadow: 0 16px 28px rgba(13, 148, 136, 0.24);
}

.save-alert {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}

@media (max-width: 820px) {
  .premium-purchase-hero {
    align-items: flex-start;
  }

  .hero-title-wrap {
    align-items: flex-start;
  }
}

/* Master CRUD pages */
.master-shell {
  min-height: calc(100vh - 58px);
  padding: 26px 30px 38px;
  background: radial-gradient(circle at 4% 5%, rgba(13, 148, 136, 0.12), transparent 28%), linear-gradient(135deg, #f5f8fb, #eef7f5 55%, #fff8ed);
}

.master-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(219, 228, 238, 0.9);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 45px rgba(15,23,42,0.08);
}

.master-hero h1 {
  margin: 0;
  color: #102033;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 900;
}

.master-count {
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid rgba(13,148,136,0.18);
  border-radius: 14px;
  background: #fff;
  text-align: right;
}

.master-count span {
  display: block;
  color: #667085;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.master-count strong {
  color: #0f766e;
  font-size: 1.4rem;
}

.master-card {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
}

.master-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid #e8edf3;
  background: linear-gradient(135deg, #f8fffd, #f5f8ff);
}

.master-card-head strong,
.master-card-head span {
  display: block;
}

.master-card-head strong {
  color: #102033;
  font-size: 1.04rem;
  font-weight: 900;
}

.master-card-head span {
  color: #667085;
  font-size: 0.86rem;
}

.master-clear {
  align-self: center;
  padding: 8px 12px;
  border-radius: 10px;
  color: #0f766e;
  background: #e9faf6;
  font-weight: 900;
  text-decoration: none;
}

.master-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  align-items: end;
}

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

.master-field label {
  color: #475467;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.master-field input {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cbd8e6;
  border-radius: 10px;
  background: #fff;
  color: #102033;
  outline: none;
}

.master-field input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(13,148,136,0.12);
}

.master-save-btn {
  min-height: 42px;
  border-radius: 11px;
}

.master-table-wrap {
  overflow: auto;
  padding: 12px;
}

.master-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.master-table th {
  padding: 11px 10px;
  color: #24415f;
  background: linear-gradient(135deg, #eaf7f4, #eef4ff);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.master-table th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.master-table th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.master-table td {
  padding: 10px;
  border-top: 1px solid #e3eaf2;
  border-bottom: 1px solid #e3eaf2;
  background: #fff;
  color: #102033;
  font-size: 0.9rem;
}

.master-table td:first-child { border-left: 1px solid #e3eaf2; border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.master-table td:last-child { border-right: 1px solid #e3eaf2; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.master-table tr:hover td { background: #f6fffc; border-color: rgba(13,148,136,0.25); }

.master-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.edit-link,
.delete-link {
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.edit-link { color: #0f766e; background: #e9faf6; }
.delete-link { color: #b42318; background: #fff0ed; }
.master-actions form { margin: 0; }
.master-empty { text-align: center; color: #667085 !important; }

@media (max-width: 1100px) {
  .master-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .master-shell { padding: 18px 14px 28px; }
  .master-hero, .master-card-head { align-items: flex-start; flex-direction: column; }
  .master-form { grid-template-columns: 1fr; }
  .master-save-btn { width: 100%; }
}

.master-field select {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cbd8e6;
  border-radius: 10px;
  background: #fff;
  color: #102033;
  outline: none;
}

.master-field select:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(13,148,136,0.12);
}

/* Frame Purchase item column balance */
.frame-purchase-page .item-entry-table th:nth-child(6),
.frame-purchase-page .item-entry-table td:nth-child(6) {
  width: 92px;
  min-width: 92px;
}

.frame-purchase-page .item-entry-table td:nth-child(6) select {
  min-width: 82px;
  padding-right: 24px;
}

.frame-purchase-page .item-entry-table th:nth-child(10),
.frame-purchase-page .item-entry-table td:nth-child(10) {
  width: 72px;
  min-width: 72px;
}

.frame-purchase-page .item-entry-table td:nth-child(10) input {
  padding-left: 7px;
  padding-right: 7px;
}
/* Frame Purchase compact header summary */
.frame-purchase-page .premium-purchase-hero {
  min-height: 96px;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.frame-purchase-page .premium-purchase-hero .hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.frame-purchase-page .premium-purchase-hero h1 {
  font-size: clamp(2rem, 2.8vw, 2.45rem);
}

.frame-purchase-page .purchase-summary-kicker {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}

.frame-purchase-page .purchase-header-summary {
  justify-self: center;
  width: auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.frame-purchase-page .purchase-header-summary div {
  min-width: 132px;
  padding: 8px 12px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.frame-purchase-page .purchase-header-summary .next-barcode-card {
  min-width: 158px;
}

.frame-purchase-page .purchase-header-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--premium-teal-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.frame-purchase-page .purchase-header-summary strong {
  display: block;
  color: var(--premium-ink);
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .frame-purchase-page .purchase-summary-kicker {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .frame-purchase-page .purchase-header-summary {
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .frame-purchase-page .purchase-header-summary div {
    flex: 1 1 140px;
  }
}
/* Frame Purchase history */
.frame-history-page .history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.frame-history-page .history-toolbar span {
  color: var(--premium-teal-dark, #0f766e);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.frame-history-page .history-toolbar h1 {
  margin: 4px 0 0;
  color: var(--premium-ink, #102033);
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  font-weight: 900;
}

.history-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 0 18px;
  text-decoration: none;
}

.history-card {
  overflow: hidden;
}

.history-table-wrap {
  overflow-x: auto;
  padding: 12px;
  background: #ffffff;
}

.history-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.history-table th {
  padding: 10px;
  color: #24415f;
  background: linear-gradient(135deg, #eaf7f4, #eef4ff);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-table th:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.history-table th:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.history-table td {
  padding: 10px;
  border-top: 1px solid #e3eaf2;
  border-bottom: 1px solid #e3eaf2;
  background: #ffffff;
  color: #102033;
  font-size: 0.9rem;
}

.history-table td:first-child { border-left: 1px solid #e3eaf2; border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.history-table td:last-child { border-right: 1px solid #e3eaf2; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.history-table tr:hover td { background: #f6fffc; border-color: rgba(13,148,136,0.25); }
.history-empty { text-align: center; color: #667085 !important; }

@media (max-width: 620px) {
  .frame-history-page .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
/* Frame purchase barcode print action */
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: #0f766e;
  background: #e9faf6;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.print-link:hover {
  color: #ffffff;
  background: #0f766e;
}
/* Eyewear mobile app dashboard */
.eyewear-dashboard {
  min-height: calc(100vh - 58px);
  padding: clamp(16px, 4vw, 34px);
  background:
    linear-gradient(180deg, #ecf8f5 0%, #f8fbff 46%, #fff8ed 100%);
}

.eyewear-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 172px;
  margin-bottom: 18px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(232,245,242,0.92)),
    #ffffff;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.08);
}

.eyewear-hero h1 {
  margin: 0;
  color: #102033;
  font-size: clamp(1.72rem, 4vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 900;
}

.hero-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: #566b68;
  font-size: 0.98rem;
  line-height: 1.45;
}

.lens-visual {
  width: clamp(116px, 18vw, 178px);
  height: clamp(72px, 12vw, 112px);
  display: grid;
  grid-template-columns: 1fr 22px 1fr;
  align-items: center;
}

.lens {
  aspect-ratio: 1.32;
  border: 8px solid #0f766e;
  border-radius: 999px 999px 820px 820px;
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(188,230,222,0.58));
  box-shadow: inset 0 0 0 5px rgba(255,255,255,0.78), 0 12px 22px rgba(15,118,110,0.12);
}

.bridge {
  height: 10px;
  margin: 0 -3px;
  border-top: 7px solid #0f766e;
  border-radius: 999px;
}

.mobile-action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.action-tile {
  min-height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid #dce9e6;
  border-radius: 8px;
  background: #ffffff;
  color: #102033;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.07);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  color: #0f766e;
  box-shadow: 0 16px 32px rgba(16, 24, 40, 0.1);
}

.action-tile span:last-child {
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.15;
}

.action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f7f3;
  color: #0f766e;
  font-weight: 900;
}

.primary-action {
  background: linear-gradient(135deg, #0f766e, #16a394);
  color: #ffffff;
}

.primary-action:hover {
  color: #ffffff;
}

.primary-action .action-icon {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.status-card {
  min-height: 104px;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.06);
}

.dashboard-workflow {
  padding: 18px;
  border: 1px solid #dce9e6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

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

.workflow-head h2 {
  margin: 0;
  color: #102033;
  font-size: 1.18rem;
  font-weight: 900;
}

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

.workflow-list a {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3ece9;
  border-radius: 8px;
  color: #263937;
  background: #f9fcfb;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.workflow-list span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #102033;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 900;
}

@media (max-width: 980px) {
  .mobile-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .eyewear-dashboard {
    padding: 14px 12px 24px;
  }

  .eyewear-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
  }

  .lens-visual {
    justify-self: center;
    width: min(100%, 148px);
  }

  .mobile-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .action-tile {
    min-height: 88px;
    padding: 10px 6px;
  }

  .action-icon {
    width: 36px;
    height: 36px;
  }

  .action-tile span:last-child {
    font-size: 0.76rem;
  }

  .status-grid,
  .workflow-list {
    grid-template-columns: 1fr;
  }

  .status-card {
    min-height: 84px;
  }
}

/* Mobile app matching dashboard */
.mobile-app-dashboard {
  min-height: calc(100vh - 58px);
  padding: 14px 15px 56px;
  background: linear-gradient(105deg, #f0e2fb 0%, #f8e8f3 100%);
  color: #07152f;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.metric-card {
  min-height: 68px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(18, 24, 40, 0.06);
}

.metric-card strong {
  color: #06142e;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
}

.metric-card span {
  color: #44556f;
  font-size: 0.72rem;
  line-height: 1.1;
}

.mobile-welcome-card {
  min-height: 326px;
  margin-bottom: 20px;
  padding: 14px 15px 20px;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(18, 24, 40, 0.05);
}

.welcome-copy h1 {
  margin: 0 0 5px;
  color: #07152f;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.welcome-copy p {
  margin: 0;
  color: #4f6280;
  font-size: 0.78rem;
  line-height: 1.35;
}

.app-action-layout {
  min-height: 246px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 20px;
  padding: 22px min(14vw, 165px) 0;
}

.action-column {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.center-actions {
  padding-top: 0;
}

.right-actions {
  padding-top: 0;
}

.mobile-app-action {
  width: 96px;
  min-height: 70px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  color: #07152f;
  text-align: center;
  text-decoration: none;
}

.mobile-app-action > span:last-child {
  max-width: 96px;
  color: #07152f;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.circle-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: 0 9px 18px rgba(24, 34, 55, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-app-action:hover {
  color: #07152f;
}

.mobile-app-action:hover .circle-icon {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(24, 34, 55, 0.22);
}

.circle-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-green .circle-icon { background: #1dbf5b; }
.action-cyan .circle-icon { background: #12a7c9; }
.action-teal .circle-icon { background: #169b93; }
.action-purple .circle-icon { background: #7b46e9; }
.action-red .circle-icon { background: #ef3438; }
.action-orange .circle-icon { background: #f28a00; }
.action-blue .circle-icon { background: #2f73ef; }

.today-orders-panel {
  color: #07152f;
}

.today-orders-panel h2 {
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.today-orders-panel p {
  margin: 0 0 16px;
  color: #59638a;
  font-size: 0.92rem;
}

.orders-empty {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 11px;
  background: #ffffff;
  color: #5f6f86;
  font-size: 0.76rem;
  box-shadow: 0 8px 20px rgba(18, 24, 40, 0.05);
}

@media (max-width: 820px) {
  .mobile-app-dashboard {
    padding: 12px 10px 34px;
  }

  .metric-row {
    gap: 8px;
  }

  .metric-card {
    min-height: 62px;
  }

  .mobile-welcome-card {
    min-height: 0;
  }

  .app-action-layout {
    min-height: 0;
    padding: 22px 4px 0;
    gap: 8px;
  }

  .mobile-app-action {
    width: 86px;
  }
}

@media (max-width: 520px) {
  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card strong {
    font-size: 1.05rem;
  }

  .metric-card span {
    font-size: 0.66rem;
  }

  .mobile-welcome-card {
    padding: 14px 10px 18px;
  }

  .app-action-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .action-column {
    gap: 10px;
  }

  .mobile-app-action {
    width: 100%;
    min-height: 67px;
  }

  .circle-icon {
    width: 46px;
    height: 46px;
  }

  .circle-icon svg {
    width: 23px;
    height: 23px;
  }

  .mobile-app-action > span:last-child {
    font-size: 0.58rem;
  }
}

/* Mobile app click pages */
.app-action-page {
  display: grid;
  gap: 14px;
}

.app-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(18, 24, 40, 0.06);
}

.back-link {
  min-width: 54px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #07152f;
  background: #f0e2fb;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.app-page-header h1 {
  margin: 0 0 4px;
  color: #07152f;
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.15;
}

.app-page-header p {
  margin: 0;
  color: #58667f;
  font-size: 0.8rem;
}

.app-page-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  padding: 18px 12px;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(18, 24, 40, 0.05);
}

.app-page-actions .mobile-app-action {
  width: 100%;
  min-height: 78px;
}

.stock-search-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(18, 24, 40, 0.06);
}

.stock-search-card label {
  color: #07152f;
  font-size: 0.78rem;
  font-weight: 900;
}

.stock-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.stock-search-row input {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e7f0;
  border-radius: 11px;
  color: #07152f;
  outline: none;
  text-transform: uppercase;
}

.stock-search-row input:focus {
  border-color: #7b46e9;
  box-shadow: 0 0 0 4px rgba(123, 70, 233, 0.12);
}

.stock-search-row button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  color: #ffffff;
  background: #07152f;
  font-size: 0.82rem;
  font-weight: 900;
}

.stock-result-list {
  display: grid;
  gap: 9px;
}

.stock-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(18, 24, 40, 0.05);
}

.stock-result-card strong,
.stock-result-card span,
.stock-result-card em {
  display: block;
}

.stock-result-card strong {
  color: #07152f;
  font-size: 0.96rem;
  font-weight: 900;
}

.stock-result-card span {
  margin-top: 2px;
  color: #33445f;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
}

.stock-result-card em {
  margin-top: 2px;
  color: #68768d;
  font-size: 0.76rem;
  font-style: normal;
}

.stock-result-meta {
  text-align: right;
  white-space: nowrap;
}

.stock-result-meta span {
  color: #68768d;
  font-size: 0.74rem;
}

.stock-result-meta strong {
  margin-top: 3px;
  color: #07152f;
  font-size: 0.88rem;
}

.mobile-page-empty {
  padding-top: 4px;
}

@media (max-width: 520px) {
  .app-page-header {
    padding: 13px;
  }

  .app-page-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 15px 8px;
  }

  .stock-search-row {
    grid-template-columns: 1fr;
  }

  .stock-result-card {
    grid-template-columns: 1fr;
  }

  .stock-result-meta {
    text-align: left;
  }
}

/* Mobile app eyewear order flow */
.order-mobile-page {
  min-height: calc(100vh - 58px);
  padding: 34px 0 86px;
  background: #f7fffd;
  color: #12325a;
  font-family: Arial, Helvetica, sans-serif;
}

.order-mobile-header {
  width: min(100% - 28px, 360px);
  min-height: 150px;
  margin: 0 auto -72px;
  padding: 12px 14px 86px;
  background: #148b7a;
  color: #ffffff;
  text-align: center;
}

.order-header-title {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1.2;
}

.order-header-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-header-badges span,
.history-tab-btn {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
}

.order-mobile-card {
  position: relative;
  z-index: 1;
  width: min(100% - 52px, 310px);
  margin: 0 auto;
  padding: 14px 13px 18px;
  border: 1px solid #dff3ef;
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(20, 139, 122, 0.08);
}

.order-field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.order-field label,
.order-check-row label {
  margin: 0;
  color: #153766;
  font-size: 0.78rem;
  font-weight: 500;
}

.order-field input,
.order-field select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #cfe0f4;
  border-radius: 10px;
  background: #f8fbff;
  color: #12284f;
  font-size: 0.86rem;
  outline: none;
}

.order-field input:focus,
.order-field select:focus {
  border-color: #15a8e0;
  box-shadow: 0 0 0 3px rgba(21,168,224,0.12);
}

.order-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: center;
}

.order-inline button,
.btn-fetch-like {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: #16a8df;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
}

.order-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}

.order-check-row input {
  width: 14px;
  height: 14px;
}

.order-section-title {
  margin: 18px 0 10px;
  color: #153766;
  font-size: 0.9rem;
  font-weight: 900;
}

.order-item-card {
  padding: 12px;
  border: 1px solid #d7e8fb;
  border-radius: 14px;
  background: #f5f9ff;
}

.order-item-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.scan-btn,
.remove-btn {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
}

.scan-btn {
  padding: 0 14px;
  background: #148b7a;
}

.remove-btn {
  width: 34px;
  background: #ef3438;
}

.order-add-btn {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px dashed #1b79dc;
  border-radius: 12px;
  background: #e8f2ff;
  color: #1b5db5;
  font-size: 0.86rem;
  font-weight: 700;
}

.order-save-bar {
  width: min(100% - 52px, 310px);
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(18, 24, 40, 0.08);
}

.delivery-field {
  margin-bottom: 10px;
}

.save-order-btn {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: #148b7a;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
}

.order-bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 920;
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #5440ea;
  box-shadow: 0 -10px 24px rgba(26, 20, 102, 0.22);
}

.order-bottom-tabs a {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
}

.order-bottom-tabs a.active {
  background: rgba(255,255,255,0.08);
}

.bill-box {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2937;
}

.bill-top {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
}

.bill-logo-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #148b7a;
  color: #ffffff;
  font-weight: 900;
}

.bill-top strong,
.bill-top span {
  display: block;
}

.bill-top span,
.bill-info-row,
.empty-bill,
.bill-footer-text {
  color: #64748b;
  font-size: 0.76rem;
}

.bill-line {
  height: 1px;
  margin: 12px 0;
  background: #e5edf5;
}

.bill-info-row,
.summary-totals div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.empty-bill {
  padding: 12px;
  border-radius: 10px;
  background: #f8fbff;
  text-align: center;
}

.empty-bill.soft {
  margin-bottom: 12px;
}

.summary-totals {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.summary-totals .total {
  padding-top: 8px;
  border-top: 1px solid #e5edf5;
  color: #111827;
  font-weight: 900;
}

.bill-footer-text {
  margin-top: 14px;
  text-align: center;
}

.margin-top {
  margin-top: 14px;
}

.full-width {
  width: 100%;
}

.prescription-meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.prescription-meta-row .order-field {
  margin-bottom: 10px;
}

.rx-table-wrap {
  overflow-x: auto;
  margin: 10px 0 14px;
}

.rx-table-web {
  width: 100%;
  min-width: 280px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #d7e8fb;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.rx-table-web th,
.rx-table-web td {
  padding: 8px;
  border-bottom: 1px solid #e5edf5;
  border-right: 1px solid #e5edf5;
  color: #153766;
  font-size: 0.76rem;
  text-align: center;
}

.rx-table-web th:last-child,
.rx-table-web td:last-child {
  border-right: 0;
}

.rx-table-web tr:last-child td {
  border-bottom: 0;
}

.rx-table-web th {
  background: #eaf4ff;
  font-weight: 900;
}

.rx-table-web input {
  width: 100%;
  min-height: 32px;
  padding: 6px;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  background: #f8fbff;
}

@media (min-width: 700px) {
  .order-mobile-header,
  .order-mobile-card,
  .order-save-bar {
    width: min(100% - 72px, 620px);
  }

  .order-mobile-card {
    padding: 18px 24px;
  }

  .order-mobile-header {
    min-height: 160px;
  }

  .order-bottom-tabs {
    left: 50%;
    right: auto;
    width: min(100%, 620px);
    transform: translateX(-50%);
    border-radius: 14px 14px 0 0;
  }
}

/* Website layout upgrade for eyewear order flow */
@media (min-width: 900px) {
  .order-mobile-page {
    min-height: calc(100vh - 58px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-template-areas:
      "header header"
      "tabs tabs"
      "main side";
    align-items: start;
    gap: 18px;
    padding: 24px clamp(24px, 4vw, 54px) 36px;
    background: linear-gradient(135deg, #eef7ff 0%, #f8f2ff 48%, #fff7ed 100%);
  }

  .order-mobile-header {
    grid-area: header;
    width: 100%;
    min-height: 118px;
    margin: 0;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0f766e, #159b8b);
    text-align: left;
    box-shadow: 0 18px 38px rgba(15, 118, 110, 0.16);
  }

  .order-header-title {
    margin: 0;
    font-size: clamp(1.8rem, 2.7vw, 2.45rem);
  }

  .order-header-badges {
    justify-content: flex-end;
  }

  .order-header-badges span,
  .history-tab-btn {
    min-height: 32px;
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  .order-bottom-tabs {
    position: static;
    grid-area: tabs;
    width: 100%;
    min-height: 58px;
    transform: none;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(18, 24, 40, 0.08);
    overflow: hidden;
  }

  .order-bottom-tabs a {
    color: #263656;
    border-right: 1px solid #e5edf5;
    font-size: 0.9rem;
  }

  .order-bottom-tabs a:last-child {
    border-right: 0;
  }

  .order-bottom-tabs a.active {
    color: #ffffff;
    background: #5440ea;
  }

  .order-mobile-card {
    grid-area: main;
    width: 100%;
    margin: 0;
    padding: 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(18, 24, 40, 0.08);
  }

  .order-mobile-card:not(.payment-card):not(.prescription-card) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }

  .order-mobile-card:not(.payment-card):not(.prescription-card) .order-section-title,
  .order-mobile-card:not(.payment-card):not(.prescription-card) .order-item-card,
  .order-mobile-card:not(.payment-card):not(.prescription-card) .order-add-btn {
    grid-column: 1 / -1;
  }

  .order-field {
    margin-bottom: 0;
  }

  .order-field label,
  .order-check-row label {
    font-size: 0.82rem;
    font-weight: 800;
  }

  .order-field input,
  .order-field select {
    min-height: 46px;
    border-radius: 8px;
    background: #fbfdff;
  }

  .order-inline button,
  .btn-fetch-like,
  .save-order-btn {
    border-radius: 8px;
  }

  .order-check-row {
    min-height: 46px;
    align-self: end;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #e4edf7;
    border-radius: 8px;
    background: #fbfdff;
  }

  .order-section-title {
    margin: 8px 0 0;
    padding-top: 6px;
    border-top: 1px solid #edf2f7;
    font-size: 1rem;
  }

  .order-item-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 16px;
    border-radius: 8px;
    background: #f8fbff;
  }

  .order-item-actions,
  .order-item-card .order-field:nth-child(2) {
    grid-column: 1 / -1;
  }

  .order-add-btn {
    max-width: 260px;
    justify-self: start;
    border-radius: 8px;
  }

  .order-save-bar {
    grid-area: side;
    position: sticky;
    top: 78px;
    width: 100%;
    margin: 0;
    padding: 18px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(18, 24, 40, 0.08);
  }

  .delivery-field {
    margin-bottom: 14px;
  }

  .payment-card,
  .prescription-card {
    max-width: none;
  }

  .payment-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 18px;
  }

  .payment-card .bill-box {
    grid-row: span 4;
  }

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

  .rx-table-web th,
  .rx-table-web td {
    padding: 10px;
    font-size: 0.82rem;
  }
}

@media (min-width: 1200px) {
  .order-mobile-page {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .order-item-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Connected eyewear workflow */
.order-alert { padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-weight: 600; }
.order-alert.error { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.order-alert.success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.payment-items { border: 1px solid #dbe5ef; border-radius: 6px; overflow: hidden; }
.payment-items > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 12px; border-bottom: 1px solid #e8eef5; }
.payment-items > div:last-child { border-bottom: 0; }
.payment-items small { color: #64748b; }
.prescription-customer { display: flex; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 14px; background: #ecfdf5; border-left: 4px solid #0f766e; }
.prescription-nav { display: flex; gap: 10px; margin-top: 14px; }
.prescription-nav .order-add-btn { flex: 1; text-align: center; text-decoration: none; }
@media (max-width: 650px) { .prescription-customer { flex-direction: column; } .prescription-nav { flex-wrap: wrap; } .prescription-nav .order-add-btn { min-width: 45%; } }
/* Stable desktop grid for the connected customer order form */
@media (min-width: 900px) {
  .customer-order-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "tabs"
      "main";
  }

  .customer-order-page #customerOrderForm {
    grid-area: main;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .customer-order-page #orderItems,
  .customer-order-page #customerOrderForm > .order-section-title,
  .customer-order-page #customerOrderForm > .order-add-btn,
  .customer-order-page #customerOrderForm > .order-alert,
  .customer-order-page #customerOrderForm > .order-save-bar {
    grid-column: 1 / -1;
  }

  .customer-order-page #orderItems {
    display: grid;
    gap: 16px;
    min-width: 0;
  }

  .customer-order-page .order-item-card {
    width: 100%;
    min-width: 0;
  }

  .customer-order-page #customerOrderForm > .order-save-bar {
    position: static;
    width: 100%;
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px;
    align-items: end;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e4edf7;
    box-shadow: none;
  }

  .customer-order-page .delivery-field {
    margin: 0;
  }

  .customer-order-page .save-order-btn {
    min-height: 46px;
  }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .customer-order-page #customerOrderForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .customer-order-page #customerOrderForm > .order-save-bar {
    width: 100%;
  }
}
/* Prescription sphere and addition selectors */
.rx-selector-input {
  cursor: pointer;
  text-align: center;
  font-weight: 700;
}
.rx-selector-input:hover,
.rx-selector-input:focus {
  border-color: #5440ea;
  background: #f5f3ff;
}
.rx-selector-input.disabled-input {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f1f5f9;
}
.rx-selector-open { overflow: hidden; }
.rx-selector-overlay[hidden] { display: none; }
.rx-selector-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.64);
}
.rx-selector-dialog {
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.rx-selector-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 18px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}
.rx-selector-head h2 {
  margin: 0;
  color: #172554;
  font-size: 1.15rem;
}
.rx-selector-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  color: #475569;
  background: #f1f5f9;
  font-weight: 800;
}
.rx-sign-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.rx-sign-row button,
.rx-value-grid button,
.rx-custom-row button,
.rx-cancel {
  min-height: 44px;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  background: #f8fafc;
  color: #172554;
  font-weight: 700;
  cursor: pointer;
}
.rx-sign-row button.active {
  border-color: #4f46e5;
  background: #5440ea;
  color: #ffffff;
}
.rx-custom-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 16px;
}
.rx-custom-row input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.rx-custom-row .rx-apply { border-color: #16a34a; background: #16a34a; color: #ffffff; }
.rx-custom-row .rx-clear { border-color: #dc2626; background: #dc2626; color: #ffffff; }
.rx-value-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.rx-value-grid button:hover,
.rx-value-grid button:focus {
  border-color: #6366f1;
  background: #eef2ff;
}
.rx-cancel {
  width: 100%;
  margin-top: 16px;
  color: #ffffff;
  background: #475569;
  border-color: #475569;
}
@media (max-width: 520px) {
  .rx-selector-overlay { padding: 10px; }
  .rx-selector-dialog { max-height: 92vh; padding: 16px; }
  .rx-selector-head { top: -16px; margin: -16px -16px 14px; padding: 14px 16px; }
  .rx-value-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rx-custom-row { grid-template-columns: 1fr 1fr; }
  .rx-custom-row input { grid-column: 1 / -1; }
}
/* Eye Test add and search pages */
.eye-test-shell {
  min-height: calc(100vh - 58px);
  padding: 24px clamp(18px, 4vw, 54px) 42px;
  background: #f4f7fb;
  color: #172554;
}
.eye-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-radius: 8px 8px 0 0;
  color: #ffffff;
  background: #4338ca;
}
.eye-test-header h1 { margin: 2px 0 4px; color: #ffffff; font-size: 1.7rem; }
.eye-test-header p { margin: 0; color: #e0e7ff; }
.eye-test-kicker { font-size: .72rem; font-weight: 800; letter-spacing: 0; }
.eye-test-number { min-width: 120px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; text-align: center; }
.eye-test-number span,.eye-test-number strong { display: block; }
.eye-test-number span { font-size: .7rem; }
.eye-test-number strong { font-size: 1.2rem; }
.eye-test-header-action { padding: 11px 16px; border-radius: 6px; color: #312e81; background: #ffffff; font-weight: 800; text-decoration: none; }
.eye-test-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 18px; border: 1px solid #dbe3ef; border-top: 0; background: #ffffff; }
.eye-test-tabs a { padding: 15px; color: #334155; text-align: center; text-decoration: none; font-size: .84rem; font-weight: 800; }
.eye-test-tabs a + a { border-left: 1px solid #dbe3ef; }
.eye-test-tabs a.active { color: #ffffff; background: #5440ea; }
.eye-test-form { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(380px,.75fr); gap: 18px; align-items: start; }
.eye-test-panel { padding: 20px; border: 1px solid #dbe3ef; border-radius: 8px; background: #ffffff; box-shadow: 0 12px 28px rgba(30,41,59,.07); }
.eye-test-panel h2 { margin: 0 0 16px; color: #172554; font-size: 1rem; }
.eye-test-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 16px; }
.eye-test-full { grid-column: 1/-1; }
.eye-test-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 16px; border: 1px solid #dbe3ef; border-radius: 8px; background: #ffffff; }
.eye-test-actions .save-order-btn { width: 180px; }
.eye-test-secondary { min-height: 42px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid #cbd5e1; border-radius: 6px; color: #334155; text-decoration: none; font-weight: 700; }
.eye-test-rx input { min-width: 90px; text-align: center; }
.eye-test-search { display: grid; grid-template-columns: minmax(200px,1fr) minmax(200px,1fr) 120px 90px; align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #ffffff; }
.eye-test-search button,.eye-test-search a { min-height: 46px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #ffffff; background: #4338ca; font-weight: 800; text-decoration: none; }
.eye-test-search a { color: #334155; background: #e2e8f0; }
.eye-test-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.eye-test-result { min-width: 0; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #ffffff; box-shadow: 0 10px 24px rgba(30,41,59,.06); }
.eye-test-result > header { display: grid; grid-template-columns: 1.3fr 1fr .8fr .8fr; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.eye-test-result > header span,.eye-test-result > header strong { display: block; overflow-wrap: anywhere; }
.eye-test-result > header span { color: #64748b; font-size: .7rem; }
.eye-test-result > header strong { margin-top: 3px; color: #172554; font-size: .86rem; }
.eye-test-result > footer { display: flex; justify-content: space-between; gap: 12px; color: #64748b; font-size: .76rem; }
.eye-test-empty { min-height: 180px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; background: #ffffff; }
@media (max-width: 1050px) { .eye-test-form { grid-template-columns: 1fr; } .eye-test-list { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .eye-test-shell { padding: 14px 10px 30px; }
  .eye-test-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .eye-test-number,.eye-test-header-action { width: 100%; text-align: center; }
  .eye-test-grid,.eye-test-search { grid-template-columns: 1fr; }
  .eye-test-result > header { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .eye-test-actions { flex-direction: column-reverse; }
  .eye-test-actions .save-order-btn,.eye-test-secondary { width: 100%; justify-content: center; }
}
/* Branch-wise sales report */
.sales-report-shell { min-height: calc(100vh - 58px); padding: 24px clamp(18px,4vw,54px) 44px; background: #f3f7fc; color: #172554; }
.sales-report-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-radius: 8px 8px 0 0; color: #fff; background: #1d4ed8; }
.sales-report-header > div > span { font-size: .72rem; font-weight: 900; }
.sales-report-header h1 { margin: 2px 0 4px; color: #fff; font-size: 1.75rem; }
.sales-report-header p { margin: 0; color: #dbeafe; }
.sales-print-button,.sales-load-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; color: #1e3a8a; background: #fff; font-weight: 800; cursor: pointer; }
.sales-report-controls { margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ef; border-top: 0; border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.sales-mode-control { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.sales-mode-control label { min-height: 64px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid #cbd5e1; border-radius: 6px; color: #334155; background: #f8fafc; cursor: pointer; }
.sales-mode-control label.active { border-color: #2563eb; color: #1e3a8a; background: #dbeafe; box-shadow: inset 0 0 0 1px #2563eb; }
.sales-mode-control input { position: absolute; opacity: 0; pointer-events: none; }
.sales-mode-control strong { font-size: .88rem; }
.sales-mode-control span { color: #64748b; font-size: .7rem; }
.sales-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)) 150px; align-items: end; gap: 14px; }
.sales-load-button { color: #fff; background: #2563eb; }
.sales-report-empty { min-height: 180px; display: grid; place-items: center; border: 1px dashed #bfcee0; border-radius: 8px; color: #64748b; background: #fff; }
.sales-report-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.sales-print-head { grid-column: 1/-1; display: none; text-align: center; }
.branch-sales-card { min-width: 0; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(30,41,59,.06); }
.branch-sales-card > header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid #e2e8f0; }
.branch-sales-card > header strong { color: #0f172a; font-size: 1.05rem; }
.branch-sales-card > header span { color: #64748b; font-size: .78rem; }
.branch-sales-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.branch-sales-totals > div { padding: 12px; border-radius: 6px; background: #eff6ff; }
.branch-sales-totals > div:nth-child(2) { background: #ecfdf5; }
.branch-sales-totals > div:nth-child(3) { background: #fff7ed; }
.branch-sales-totals span,.branch-sales-totals strong { display: block; }
.branch-sales-totals span { margin-bottom: 4px; color: #64748b; font-size: .7rem; }
.branch-sales-totals strong { color: #172554; font-size: .92rem; overflow-wrap: anywhere; }
.branch-sales-breakdown { margin-top: 14px; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.branch-sales-row { display: grid; grid-template-columns: 1.15fr repeat(3,1fr); gap: 8px; padding: 9px 11px; border-bottom: 1px solid #e2e8f0; color: #475569; font-size: .76rem; }
.branch-sales-row:last-child { border-bottom: 0; }
.branch-sales-row.heading { color: #1e3a8a; background: #eff6ff; font-weight: 800; }
.branch-sales-row span:not(:first-child) { text-align: right; }
@media (max-width: 1000px) { .sales-report-results { grid-template-columns: 1fr; } .sales-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 620px) {
  .sales-report-shell { padding: 12px 10px 30px; }
  .sales-report-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .sales-print-button { width: 100%; }
  .sales-mode-control,.sales-filter-grid { grid-template-columns: 1fr; }
  .branch-sales-totals { grid-template-columns: 1fr; }
  .branch-sales-row { grid-template-columns: 1fr repeat(3,.8fr); font-size: .68rem; }
}
@media print {
  body.print-sales { page: sales-report; }
  body.print-sales * { visibility: hidden; }
  #reportPrintArea,#reportPrintArea * { visibility: visible; }
  #reportPrintArea { position: absolute; inset: 0; display: block; padding: 10mm; color: #000; background: #fff; }
  .sales-print-head { display: grid; gap: 4px; margin-bottom: 8mm; }
  .branch-sales-card { break-inside: avoid; margin-bottom: 6mm; box-shadow: none; }
  @page sales-report { size: A4; margin: 8mm; }
}
/* Eyewear stock */
.inventory-shell,.order-search-shell { min-height: calc(100vh - 58px); padding: 24px clamp(18px,4vw,54px) 44px; background: #f4f7fb; color: #172554; }
.inventory-header,.order-search-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-radius: 8px 8px 0 0; color: #fff; background: #0f766e; }
.inventory-header > div > span,.order-search-header > div > span { font-size: .72rem; font-weight: 900; }
.inventory-header h1,.order-search-header h1 { margin: 2px 0 4px; color: #fff; font-size: 1.7rem; }
.inventory-header p,.order-search-header p { margin: 0; color: #ccfbf1; }
.inventory-total { min-width: 115px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; text-align: center; }
.inventory-total span,.inventory-total strong { display: block; }
.inventory-total span { font-size: .7rem; }.inventory-total strong { font-size: 1.35rem; }
.inventory-filters { display: grid; grid-template-columns: repeat(4,minmax(140px,1fr)); align-items: end; gap: 12px; padding: 18px; border: 1px solid #dbe3ef; border-top: 0; border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.inventory-search-button,.inventory-clear-button { min-height: 46px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-weight: 800; text-decoration: none; }
.inventory-clear-button { color: #334155; background: #e2e8f0; }
.inventory-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 14px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; }
.inventory-type-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #dbe3ef; border-radius: 6px; color: #334155; background: #f8fafc; font-size: .76rem; font-weight: 700; }
.inventory-type-chip strong { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #2563eb; }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(235px,1fr)); gap: 12px; }
.inventory-card { min-width: 0; display: grid; gap: 10px; padding: 14px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(30,41,59,.06); }
.inventory-card header,.inventory-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inventory-card header strong { color: #2563eb; font-size: .76rem; }.inventory-card header span { padding: 3px 7px; border-radius: 4px; color: #3730a3; background: #eef2ff; font-size: .68rem; font-weight: 800; }
.inventory-card-main strong,.inventory-card-main span { display: block; }.inventory-card-main strong { color: #111827; }.inventory-card-main span { margin-top: 3px; color: #64748b; font-size: .78rem; }
.inventory-card footer { padding-top: 9px; border-top: 1px solid #edf2f7; }.inventory-card footer span { color: #64748b; font-size: .72rem; }.inventory-card footer span b { margin-left: 5px; color: #334155; }.inventory-card footer > strong { color: #1e3a8a; }
.inventory-empty,.order-search-empty { min-height: 180px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; background: #fff; }

/* Order search */
.order-search-header { background: #4338ca; }.order-search-header p { color: #e0e7ff; }.order-search-header > a { padding: 11px 15px; border-radius: 6px; color: #312e81; background: #fff; font-weight: 800; text-decoration: none; }
.order-search-filters { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)) 115px 85px; align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ef; border-top: 0; border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.order-search-button,.order-search-clear { min-height: 46px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #fff; background: #4338ca; font-weight: 800; text-decoration: none; }.order-search-clear { color: #334155; background: #e2e8f0; }
.order-search-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.order-result-card { min-width: 0; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(30,41,59,.06); }
.order-result-card > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }.order-result-card > header span,.order-result-card > header strong { display: block; }.order-result-card > header span { color: #64748b; font-size: .7rem; }.order-result-card > header strong { color: #111827; font-size: 1rem; }.order-result-card > header > b { padding: 5px 9px; border: 1px solid #c7d2fe; border-radius: 5px; color: #4338ca; background: #eef2ff; font-size: .76rem; }
.order-result-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 12px 0; padding: 11px 0; border-top: 1px dashed #dbe3ef; border-bottom: 1px dashed #dbe3ef; }.order-result-meta span,.order-result-meta strong { display: block; overflow-wrap: anywhere; }.order-result-meta span { color: #64748b; font-size: .68rem; }.order-result-meta strong { margin-top: 3px; color: #334155; font-size: .78rem; }
.order-result-bills { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }.order-result-bills > div { padding: 10px; border-radius: 6px; background: #f8fafc; text-align: center; }.order-result-bills > div:nth-child(2) { background: #ecfdf5; }.order-result-bills > div:nth-child(3) { background: #fff1f2; }.order-result-bills span,.order-result-bills strong { display: block; }.order-result-bills span { color: #64748b; font-size: .68rem; }.order-result-bills strong { margin-top: 4px; color: #172554; font-size: .84rem; }
.order-result-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 10px; margin-top: 12px; }.order-result-actions > a,.order-result-actions summary,.order-paid-chip { min-height: 38px; display: inline-flex; align-items: center; padding: 0 13px; border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-size: .76rem; font-weight: 800; text-decoration: none; cursor: pointer; list-style: none; }.order-result-actions summary { background: #5440ea; }.order-result-actions summary::-webkit-details-marker { display: none; }.order-paid-chip { color: #166534; background: #dcfce7; }
.order-result-actions details { position: relative; }.order-result-actions details form { position: absolute; right: 0; z-index: 5; width: min(460px,80vw); margin-top: 8px; padding: 12px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 16px 35px rgba(15,23,42,.16); }.order-result-actions details .order-inline { grid-template-columns: 1fr 120px 76px; }.order-result-actions details input,.order-result-actions details select { min-width: 0; min-height: 40px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; }.order-result-actions details button { border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-weight: 800; }
@media (max-width: 1100px) { .inventory-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }.order-search-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }.order-search-results { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .inventory-shell,.order-search-shell { padding: 12px 10px 30px; }.inventory-header,.order-search-header { align-items: flex-start; flex-direction: column; padding: 18px; }.inventory-total,.order-search-header > a { width: 100%; text-align: center; }.inventory-filters,.order-search-filters { grid-template-columns: 1fr; }.order-result-meta,.order-result-bills { grid-template-columns: 1fr; }.order-result-actions { flex-wrap: wrap; }.order-result-actions details form { right: auto; left: 0; width: min(430px,calc(100vw - 40px)); }.order-result-actions details .order-inline { grid-template-columns: 1fr; } }

/* Contact-lens sales */
.cl-sales-shell { min-height: calc(100vh - 58px); padding: 24px clamp(18px,4vw,54px) 44px; color: #172554; background: #f3f7fb; }
.cl-sales-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 22px 26px; border-radius: 8px 8px 0 0; color: #fff; background: #0f766e; }
.cl-sales-header > div:first-child > span { font-size: .72rem; font-weight: 900; }
.cl-sales-header h1 { margin: 2px 0 4px; color: #fff; font-size: 1.7rem; }
.cl-sales-header p { margin: 0; color: #ccfbf1; }
.cl-stock-count { min-width: 140px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; text-align: center; }
.cl-stock-count span,.cl-stock-count strong { display: block; }
.cl-stock-count span { font-size: .7rem; }
.cl-stock-count strong { font-size: 1.3rem; }
.cl-order-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.cl-order-meta span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; font-size: .75rem; font-weight: 800; }
.cl-sales-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; border: 1px solid #dbe3ef; border-top: 0; background: #fff; }
.cl-sales-tabs a,.cl-sales-tabs span { min-height: 50px; display: grid; place-items: center; color: #64748b; text-decoration: none; font-size: .8rem; font-weight: 900; }
.cl-sales-tabs > * + * { border-left: 1px solid #dbe3ef; }
.cl-sales-tabs a.active { color: #fff; background: #5440ea; }
.cl-search-form { display: grid; grid-template-columns: repeat(3,minmax(170px,1fr)) 135px 80px; align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.cl-primary-button,.cl-clear-button,.cl-select-button { min-height: 46px; display: inline-grid; place-items: center; padding: 0 15px; border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-weight: 800; text-decoration: none; cursor: pointer; }
.cl-clear-button { color: #334155; background: #e2e8f0; }
.cl-select-button { min-height: 36px; background: #4338ca; font-size: .76rem; }
.cl-empty { min-height: 190px; display: grid; place-items: center; padding: 24px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; background: #fff; text-align: center; }
.cl-table-wrap { overflow-x: auto; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(30,41,59,.06); }
.cl-results-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.cl-results-table th,.cl-results-table td { padding: 12px 13px; border-bottom: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.cl-results-table th { color: #475569; background: #f8fafc; font-size: .7rem; text-transform: uppercase; }
.cl-results-table td { color: #334155; font-size: .8rem; }
.cl-results-table tbody tr:last-child td { border-bottom: 0; }
.cl-results-table tbody tr:hover { background: #f8fffe; }
.cl-results-table td strong,.cl-results-table td small { display: block; }
.cl-results-table td strong { color: #0f766e; }
.cl-results-table td small { margin-top: 3px; color: #64748b; }
.cl-results-table .number { text-align: right; }
.cl-order-form { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(380px,.8fr); align-items: start; gap: 18px; }
.cl-form-alert { grid-column: 1/-1; }
.cl-form-panel { padding: 20px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.cl-form-panel h2 { margin: 0 0 16px; color: #172554; font-size: 1rem; }
.cl-customer-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 16px; }
.cl-lens-title { margin-bottom: 14px; padding: 13px; border-left: 4px solid #0f766e; background: #ecfdf5; }
.cl-lens-title strong,.cl-lens-title span { display: block; }
.cl-lens-title strong { color: #0f766e; }
.cl-lens-title span { margin-top: 3px; color: #475569; font-size: .78rem; }
.cl-lens-specs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 16px; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.cl-lens-specs div { padding: 10px; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.cl-lens-specs div:nth-child(3n) { border-right: 0; }
.cl-lens-specs div:nth-last-child(-n+3) { border-bottom: 0; }
.cl-lens-specs dt { color: #64748b; font-size: .66rem; }
.cl-lens-specs dd { margin: 3px 0 0; color: #172554; font-size: .84rem; font-weight: 800; overflow-wrap: anywhere; }
.cl-pricing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.cl-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 16px 0; }
.cl-totals > div { padding: 11px; border-radius: 6px; background: #f1f5f9; }
.cl-totals .net { color: #fff; background: #4338ca; }
.cl-totals span,.cl-totals strong { display: block; }
.cl-totals span { margin-bottom: 4px; font-size: .67rem; }
.cl-totals strong { font-size: .86rem; overflow-wrap: anywhere; }
.cl-save-button { width: 100%; }
.cl-payment-alert { margin: 0 0 14px; }
.cl-payment-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); align-items: start; gap: 18px; }
.cl-payment-receipt { margin: 0; }
.cl-payment-side { display: grid; gap: 16px; }
@media (max-width: 1050px) {
  .cl-search-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cl-primary-button,.cl-clear-button { width: 100%; }
  .cl-order-form,.cl-payment-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .cl-sales-shell { padding: 12px 10px 30px; }
  .cl-sales-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .cl-stock-count,.cl-order-meta { width: 100%; }
  .cl-order-meta { justify-content: flex-start; }
  .cl-search-form,.cl-customer-grid,.cl-pricing-grid,.cl-totals { grid-template-columns: 1fr; }
  .cl-sales-tabs a,.cl-sales-tabs span { min-height: 46px; font-size: .7rem; }
  .cl-form-panel { padding: 16px; }
}


/* Order tracking */
.tracking-shell { min-height: calc(100vh - 58px); padding: 24px clamp(18px,4vw,54px) 44px; color: #172554; background: #f3f7fb; }
.tracking-header { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 22px 26px; border-radius: 8px 8px 0 0; color: #fff; background: #0f766e; }
.tracking-header > div:first-child > span { font-size: .72rem; font-weight: 900; }
.tracking-header h1 { margin: 2px 0 4px; color: #fff; font-size: 1.7rem; }
.tracking-header p { margin: 0; color: #ccfbf1; }
.tracking-count { min-width: 130px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; text-align: center; }
.tracking-count span,.tracking-count strong { display: block; }
.tracking-count span { font-size: .7rem; }
.tracking-count strong { font-size: 1.35rem; }
.tracking-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 18px; border: 1px solid #dbe3ef; border-top: 0; background: #fff; }
.tracking-tabs a { min-height: 50px; display: grid; place-items: center; padding: 8px; color: #475569; text-align: center; text-decoration: none; font-size: .76rem; font-weight: 900; }
.tracking-tabs a + a { border-left: 1px solid #dbe3ef; }
.tracking-tabs a.active { color: #fff; background: #5440ea; }
.tracking-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(30,41,59,.06); }
.tracking-filters .order-field { flex: 1 1 210px; margin: 0; }
.tracking-filter-button,.tracking-clear-button { min-height: 46px; display: grid; place-items: center; padding: 0 17px; border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-weight: 800; text-decoration: none; cursor: pointer; }
.tracking-clear-button { color: #334155; background: #e2e8f0; }
.tracking-empty { min-height: 190px; display: grid; place-items: center; padding: 24px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; background: #fff; text-align: center; }
.tracking-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.tracking-card { min-width: 0; padding: 18px; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(30,41,59,.06); }
.tracking-card > header { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid #e2e8f0; }
.tracking-card > header .tracking-product { grid-column: 1/-1; }
.tracking-card > header span,.tracking-card > header strong { display: block; overflow-wrap: anywhere; }
.tracking-card > header span { color: #64748b; font-size: .68rem; }
.tracking-card > header strong { margin-top: 3px; color: #172554; font-size: .86rem; }
.tracking-parties,.tracking-measurements { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tracking-parties span,.tracking-measurements span { padding: 6px 9px; border-radius: 5px; color: #475569; background: #f1f5f9; font-size: .7rem; }
.tracking-parties b,.tracking-measurements b { margin-left: 5px; color: #172554; }
.tracking-rx { margin-top: 12px; border: 1px solid #dbe3ef; border-radius: 6px; overflow: hidden; }
.tracking-rx > div { display: grid; grid-template-columns: .55fr repeat(4,1fr); }
.tracking-rx span,.tracking-rx b { min-width: 0; padding: 8px; border-right: 1px solid #e2e8f0; color: #334155; text-align: center; font-size: .76rem; overflow-wrap: anywhere; }
.tracking-direction-rx > div { grid-template-columns: .55fr repeat(6,minmax(0,1fr)); }
.tracking-direction-rx span,.tracking-direction-rx b { padding-inline: 5px; }
.tracking-rx span:last-child { border-right: 0; }
.tracking-rx .heading { border-bottom: 1px solid #dbe3ef; background: #eef2ff; }
.tracking-rx .heading span { color: #3730a3; font-size: .67rem; font-weight: 800; }
.tracking-rx > div:last-child { border-top: 1px solid #e2e8f0; }
.tracking-action-form { display: grid; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #cbd5e1; }
.tracking-action-form .order-field { margin: 0; }
.tracking-stage-button { min-height: 44px; border: 0; border-radius: 6px; color: #fff; background: #0f766e; font-weight: 800; cursor: pointer; }
.tracking-company-toggle { display: flex; align-items: center; gap: 8px; color: #334155; font-size: .78rem; font-weight: 700; cursor: pointer; }
.tracking-company-toggle input { width: 17px; height: 17px; accent-color: #0f766e; }
.tracking-company-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
@media (max-width: 1050px) { .tracking-grid { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .tracking-shell { padding: 12px 10px 30px; }
  .tracking-header { align-items: flex-start; flex-direction: column; padding: 18px; }
  .tracking-count { width: 100%; }
  .tracking-tabs a { min-height: 52px; padding: 6px 3px; font-size: .62rem; }
  .tracking-filters { display: grid; grid-template-columns: 1fr; }
  .tracking-filter-button,.tracking-clear-button { width: 100%; }
  .tracking-card > header,.tracking-company-fields { grid-template-columns: 1fr; }
  .tracking-card > header .tracking-product { grid-column: auto; }
}


/* Frame purchase workflow pages */
.fp-workflow { min-height: calc(100vh - 58px); padding: 24px clamp(18px,4vw,54px) 44px; color:#172554; background:#f3f7fb; }
.fp-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:18px; padding:22px 26px; border-radius:8px; color:#fff; background:#0f766e; }
.fp-header span { font-size:.72rem; font-weight:900; }
.fp-header h1 { margin:2px 0 4px; color:#fff; font-size:1.7rem; }
.fp-header p { margin:0; color:#ccfbf1; }
.fp-header > strong { min-width:70px; padding:10px; border:1px solid rgba(255,255,255,.35); border-radius:6px; text-align:center; font-size:1.35rem; }
.fp-header > a { min-height:42px; display:grid; place-items:center; padding:0 16px; border-radius:6px; color:#0f766e; background:#fff; font-weight:800; text-decoration:none; }
.fp-split { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:16px; margin-bottom:16px; }
.fp-panel { min-width:0; padding:18px; border:1px solid #dbe3ef; border-radius:8px; background:#fff; box-shadow:0 10px 24px rgba(30,41,59,.06); }
.fp-panel h2 { margin:0; color:#172554; font-size:1rem; }
.fp-form { display:grid; gap:15px; }
.fp-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.fp-form-grid .order-field { margin:0; }
.fp-wide { grid-column:1/-1; }
.fp-primary,.fp-secondary,.fp-link { min-height:42px; display:inline-grid; place-items:center; padding:0 15px; border:0; border-radius:6px; color:#fff; background:#0f766e; font-weight:800; text-decoration:none; cursor:pointer; }
.fp-secondary { color:#334155; background:#e2e8f0; }
.fp-link { min-height:34px; color:#3730a3; background:#eef2ff; font-size:.74rem; }
.fp-placeholder { min-height:260px; display:grid; place-items:center; align-content:center; gap:6px; color:#64748b; text-align:center; }
.fp-placeholder strong { color:#172554; }
.fp-panel-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.fp-table-wrap { overflow-x:auto; }
.fp-table { width:100%; min-width:760px; border-collapse:collapse; }
.fp-table th,.fp-table td { padding:11px 12px; border-bottom:1px solid #e2e8f0; color:#334155; text-align:left; font-size:.76rem; white-space:nowrap; }
.fp-table th { color:#475569; background:#f8fafc; font-size:.67rem; text-transform:uppercase; }
.fp-table tbody tr:last-child td { border-bottom:0; }
.fp-table input,.fp-table select { width:100%; min-height:38px; padding:7px 9px; border:1px solid #cbd5e1; border-radius:5px; }
.fp-status { padding:4px 7px; border-radius:5px; font-size:.68rem; font-weight:800; }
.fp-status.pending { color:#9a3412; background:#ffedd5; }
.fp-status.done { color:#166534; background:#dcfce7; }
.fp-empty { min-height:150px; display:grid; place-items:center; color:#64748b; text-align:center; }
.fp-filter { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:16px; padding:16px; border:1px solid #dbe3ef; border-radius:8px; background:#fff; }
.fp-filter .order-field { flex:1 1 200px; margin:0; }
.fp-check { min-height:44px; display:flex; align-items:center; gap:7px; color:#334155; font-size:.78rem; font-weight:700; }
.fp-check input { width:17px; height:17px; accent-color:#0f766e; }
.fp-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.fp-track-card { display:grid; gap:12px; }
.fp-track-card > header { display:flex; align-items:start; justify-content:space-between; gap:12px; padding-bottom:10px; border-bottom:1px solid #e2e8f0; }
.fp-track-card > header span,.fp-track-card > header strong { display:block; }
.fp-track-card > header span { color:#64748b; font-size:.7rem; }
.fp-track-card > header b { padding:4px 7px; border-radius:5px; color:#0f766e; background:#ecfdf5; font-size:.7rem; }
.fp-track-card p { margin:0; }
.fp-track-card p strong,.fp-track-card p span { display:block; }
.fp-track-card p span { margin-top:3px; color:#64748b; font-size:.75rem; }
.fp-party { display:flex; justify-content:space-between; gap:12px; padding:9px; border-radius:6px; color:#475569; background:#f8fafc; font-size:.76rem; }
.fp-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.fp-summary > div { padding:14px; border:1px solid #dbe3ef; border-radius:8px; background:#fff; }
.fp-summary .balance { color:#fff; background:#4338ca; }
.fp-summary span,.fp-summary b { display:block; }
.fp-summary span { font-size:.68rem; }
.fp-summary b { margin-top:4px; font-size:.95rem; overflow-wrap:anywhere; }
.fp-transfer-tools { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:10px; }
.fp-transfer-tools input { min-height:42px; padding:8px 11px; border:1px solid #cbd5e1; border-radius:6px; }
.fp-form textarea { width:100%; padding:10px; border:1px solid #cbd5e1; border-radius:6px; resize:vertical; }
@media (max-width:1000px) { .fp-split,.fp-card-grid { grid-template-columns:1fr; } .fp-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:650px) {
 .fp-workflow { padding:12px 10px 30px; }
 .fp-header { align-items:flex-start; flex-direction:column; padding:18px; }
 .fp-header > a,.fp-header > strong { width:100%; }
 .fp-form-grid,.fp-summary,.fp-transfer-tools { grid-template-columns:1fr; }
 .fp-wide { grid-column:auto; }
 .fp-filter { display:grid; grid-template-columns:1fr; }
 .fp-primary,.fp-secondary { width:100%; }
}

/* Expected purchase list-first workflow */
.fp-single-form { max-width: 920px; margin: 0 auto; }
.fp-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.fp-po-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.fp-po-summary > div { min-width: 0; padding: 13px 15px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; }
.fp-po-summary span,.fp-po-summary strong { display: block; overflow-wrap: anywhere; }
.fp-po-summary span { color: #64748b; font-size: .68rem; font-weight: 700; }
.fp-po-summary strong { margin-top: 4px; color: #172554; font-size: .88rem; }
.fp-count-chip { padding: 5px 8px; border-radius: 5px; color: #0f766e; background: #ecfdf5; font-size: .7rem; font-weight: 800; }
.fp-items-table { min-width: 650px; }
.fp-items-table td small { display: block; margin-top: 3px; color: #64748b; font-size: .67rem; }
.fp-manage-layout { grid-template-columns: minmax(390px,.75fr) minmax(0,1.25fr); }
@media (max-width:1000px) { .fp-manage-layout { grid-template-columns: 1fr; } }
@media (max-width:650px) { .fp-po-summary { grid-template-columns: 1fr 1fr; } .fp-form-actions { display:grid; grid-template-columns:1fr; } }
/* Invoice workflow */
.invoice-shell { min-height:calc(100vh - 58px); padding:24px clamp(18px,4vw,54px) 44px; color:#172554; background:#f3f7fb; }
.invoice-header { display:flex; align-items:center; justify-content:space-between; gap:22px; padding:22px 26px; border-radius:8px 8px 0 0; color:#fff; background:#0f766e; }
.invoice-header > div:first-child > span { font-size:.72rem; font-weight:900; }
.invoice-header h1 { margin:2px 0 4px; color:#fff; font-size:1.7rem; }
.invoice-header p { margin:0; color:#ccfbf1; }
.invoice-current { min-width:190px; padding:10px 14px; border:1px solid rgba(255,255,255,.35); border-radius:6px; text-align:center; }
.invoice-current span,.invoice-current strong,.invoice-current small { display:block; }
.invoice-current span { font-size:.68rem; }.invoice-current strong { margin-top:3px; font-size:1.05rem; overflow-wrap:anywhere; }
.invoice-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:18px; border:1px solid #dbe3ef; border-top:0; background:#fff; }
.invoice-tabs a { min-height:50px; display:grid; place-items:center; color:#475569; text-decoration:none; font-size:.78rem; font-weight:900; }
.invoice-tabs a + a { border-left:1px solid #dbe3ef; }.invoice-tabs a.active { color:#fff; background:#5440ea; }
.invoice-filter { display:flex; align-items:end; gap:12px; margin-bottom:16px; padding:16px; border:1px solid #dbe3ef; border-radius:8px; background:#fff; box-shadow:0 10px 24px rgba(30,41,59,.05); }
.invoice-filter .order-field { width:min(360px,100%); margin:0; }.invoice-list-filter .order-field:nth-child(2) { flex:1; width:auto; }
.invoice-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.invoice-summary > div { padding:14px 16px; border:1px solid #dbe3ef; border-radius:8px; background:#fff; }
.invoice-summary > div:nth-child(2) { background:#ecfdf5; }.invoice-summary > div:nth-child(3) { color:#fff; background:#4338ca; }
.invoice-summary span,.invoice-summary strong { display:block; }.invoice-summary span { font-size:.68rem; }.invoice-summary strong { margin-top:4px; font-size:1rem; }
.invoice-panel { min-width:0; border:1px solid #dbe3ef; border-radius:8px; background:#fff; box-shadow:0 10px 24px rgba(30,41,59,.06); overflow:hidden; }
.invoice-panel-title { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 18px; border-bottom:1px solid #e2e8f0; }
.invoice-panel-title h2 { margin:0; color:#172554; font-size:1rem; }.invoice-panel-title span { color:#64748b; font-size:.72rem; }
.invoice-table-wrap { overflow-x:auto; }.invoice-table { width:100%; min-width:920px; border-collapse:collapse; }
.invoice-table th,.invoice-table td { padding:12px 13px; border-bottom:1px solid #e2e8f0; color:#334155; text-align:left; font-size:.78rem; white-space:nowrap; }
.invoice-table th { color:#475569; background:#f8fafc; font-size:.67rem; text-transform:uppercase; }.invoice-table tbody tr:last-child td { border-bottom:0; }
.invoice-table tbody tr:hover { background:#f8fffe; }.invoice-table td strong,.invoice-table td small { display:block; }.invoice-table td small { margin-top:3px; color:#64748b; }
.invoice-table .number { text-align:right; }.invoice-table .amount-due { color:#b91c1c; font-weight:800; }
.invoice-action,.invoice-clear { min-height:38px; display:inline-grid; place-items:center; padding:0 13px; border:0; border-radius:6px; color:#fff; background:#0f766e; font-size:.75rem; font-weight:800; text-decoration:none; cursor:pointer; white-space:nowrap; }
.invoice-clear { color:#334155; background:#e2e8f0; }.invoice-empty { min-height:180px; display:grid; place-items:center; padding:24px; color:#64748b; text-align:center; }
.invoice-view-actions { display:flex; justify-content:flex-end; gap:10px; margin-bottom:14px; }.invoice-document { max-width:1000px; margin:0 auto; padding:32px; border:1px solid #dbe3ef; background:#fff; box-shadow:0 12px 30px rgba(30,41,59,.08); }
.invoice-document-head { display:flex; justify-content:space-between; gap:30px; padding-bottom:20px; border-bottom:2px solid #0f766e; }.invoice-document-head h1 { margin:0 0 6px; color:#0f766e; font-size:1.65rem; }.invoice-document-head p { margin:2px 0; color:#475569; font-size:.76rem; }
.invoice-document-number { min-width:230px; text-align:right; }.invoice-document-number span,.invoice-document-number strong,.invoice-document-number small { display:block; }.invoice-document-number span { color:#64748b; font-size:.7rem; font-weight:900; }.invoice-document-number strong { margin:6px 0; color:#172554; font-size:1.15rem; }.invoice-document-number small { color:#64748b; }
.invoice-customer { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:20px 0; }.invoice-customer > div { padding:13px; border-radius:6px; background:#f8fafc; }.invoice-customer span,.invoice-customer strong,.invoice-customer small { display:block; }.invoice-customer span { color:#64748b; font-size:.67rem; }.invoice-customer strong { margin:4px 0; }.invoice-customer small { margin-top:2px; color:#475569; }
.invoice-lines { min-width:760px; border:1px solid #e2e8f0; }.invoice-document-bottom { display:grid; grid-template-columns:1fr 330px; align-items:start; gap:30px; margin-top:22px; }
.invoice-payment-list h2 { margin:0 0 10px; font-size:.86rem; }.invoice-payment-list p { display:flex; justify-content:space-between; gap:15px; margin:0; padding:7px 0; border-bottom:1px solid #e2e8f0; color:#475569; font-size:.75rem; }
.invoice-totals { margin:0; }.invoice-totals > div { display:flex; justify-content:space-between; gap:20px; padding:8px 10px; }.invoice-totals dt,.invoice-totals dd { margin:0; }.invoice-totals dt { color:#64748b; }.invoice-totals dd { color:#172554; font-weight:800; }.invoice-totals .grand { color:#fff; background:#0f766e; }.invoice-totals .grand dt,.invoice-totals .grand dd { color:#fff; }
.invoice-document footer { margin-top:28px; padding-top:14px; border-top:1px solid #e2e8f0; color:#64748b; text-align:center; font-size:.75rem; }
@media(max-width:760px){.invoice-shell{padding:12px 10px 30px}.invoice-header{align-items:flex-start;flex-direction:column;padding:18px}.invoice-current{width:100%}.invoice-filter{display:grid;grid-template-columns:1fr}.invoice-filter .order-field{width:100%}.invoice-summary{grid-template-columns:1fr}.invoice-view-actions>*{flex:1}.invoice-document{padding:18px}.invoice-document-head{flex-direction:column}.invoice-document-number{text-align:left}.invoice-customer,.invoice-document-bottom{grid-template-columns:1fr}}
@media print { body.print-invoice{page:invoice}body.print-invoice *{visibility:hidden}body.print-invoice .invoice-document,body.print-invoice .invoice-document *{visibility:visible}.invoice-document{position:absolute;inset:0;max-width:none;padding:8mm;border:0;box-shadow:none}.invoice-view-actions{display:none}.invoice-shell{padding:0;background:#fff}@page invoice{size:A4;margin:8mm} }
/* Purchase module */
.purchase-shell{min-height:calc(100vh - 58px);padding:24px clamp(18px,4vw,54px) 44px;color:#172554;background:#f3f7fb}.purchase-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 26px;border-radius:8px 8px 0 0;color:#fff;background:#0f766e}.purchase-header span{font-size:.72rem;font-weight:900}.purchase-header h1{margin:2px 0 4px;color:#fff;font-size:1.7rem}.purchase-header p{margin:0;color:#ccfbf1}.purchase-header>a{min-height:42px;display:grid;place-items:center;padding:0 16px;border-radius:6px;color:#0f766e;background:#fff;font-weight:800;text-decoration:none}.purchase-header>strong{min-width:80px;padding:10px;border:1px solid rgba(255,255,255,.35);border-radius:6px;text-align:center;font-size:1.3rem}.purchase-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:18px;border:1px solid #dbe3ef;border-top:0;background:#fff}.purchase-tabs a{min-height:50px;display:grid;place-items:center;color:#475569;text-decoration:none;font-size:.78rem;font-weight:900}.purchase-tabs a+a{border-left:1px solid #dbe3ef}.purchase-tabs a.active{color:#fff;background:#5440ea}.purchase-panel{min-width:0;padding:18px;border:1px solid #dbe3ef;border-radius:8px;background:#fff;box-shadow:0 10px 24px rgba(30,41,59,.06)}.purchase-panel-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.purchase-panel-title h2{margin:0;font-size:1rem}.purchase-panel-title>span{padding:5px 8px;border-radius:5px;color:#0f766e;background:#ecfdf5;font-size:.7rem;font-weight:800}.purchase-form{display:grid;gap:15px}.purchase-form-single{max-width:940px;margin:0 auto}.purchase-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.purchase-form-grid .order-field{margin:0}.purchase-wide{grid-column:1/-1}.purchase-actions{display:flex;justify-content:flex-end;gap:10px}.purchase-primary,.purchase-secondary,.purchase-row-action,.stock-danger{min-height:42px;display:inline-grid;place-items:center;padding:0 15px;border:0;border-radius:6px;color:#fff;background:#0f766e;font-size:.76rem;font-weight:800;text-decoration:none;cursor:pointer}.purchase-secondary{color:#334155;background:#e2e8f0}.purchase-row-action{min-height:34px;color:#3730a3;background:#eef2ff;white-space:nowrap}.purchase-summary,.stock-check-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}.purchase-summary>div,.stock-check-summary>div{padding:13px 15px;border:1px solid #dbe3ef;border-radius:7px;background:#fff}.purchase-summary span,.purchase-summary strong,.stock-check-summary span,.stock-check-summary strong{display:block;overflow-wrap:anywhere}.purchase-summary span,.stock-check-summary span{color:#64748b;font-size:.68rem}.purchase-summary strong,.stock-check-summary strong{margin-top:4px;font-size:.9rem}.purchase-manage{display:grid;grid-template-columns:minmax(390px,.75fr) minmax(0,1.25fr);align-items:start;gap:16px}.purchase-table-wrap{overflow-x:auto}.purchase-table{width:100%;min-width:760px;border-collapse:collapse}.purchase-table th,.purchase-table td{padding:11px 12px;border-bottom:1px solid #e2e8f0;color:#334155;text-align:left;font-size:.76rem;white-space:nowrap}.purchase-table th{color:#475569;background:#f8fafc;font-size:.67rem;text-transform:uppercase}.purchase-table tbody tr:last-child td{border-bottom:0}.purchase-table td strong,.purchase-table td small{display:block}.purchase-table td small{margin-top:3px;color:#64748b;font-size:.67rem}.purchase-empty{min-height:160px;display:grid;place-items:center;padding:24px;color:#64748b;text-align:center}.purchase-filter{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr)) auto auto;align-items:end;gap:12px;margin-bottom:16px;padding:16px;border:1px solid #dbe3ef;border-radius:8px;background:#fff}.purchase-filter .order-field{margin:0}.stock-check-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.stock-check-layout{display:grid;grid-template-columns:minmax(330px,.55fr) minmax(0,1.45fr);align-items:start;gap:16px;margin-bottom:16px}.stock-check-tools{display:grid;gap:13px}.stock-check-tools form{display:grid;gap:10px}.stock-check-entry{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px}.stock-check-entry input{min-width:0;min-height:42px;padding:8px 11px;border:1px solid #cbd5e1;border-radius:6px}.stock-check-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.stock-danger{width:100%;background:#b91c1c}.stock-message{min-height:20px;color:#475569;font-size:.75rem;font-weight:700}.stock-camera{display:grid;gap:8px}.stock-camera video{width:100%;max-height:280px;border-radius:6px;background:#0f172a}.stock-empty-row td{text-align:center;color:#64748b}.stock-remove{min-height:32px;padding:0 10px;border:0;border-radius:5px;color:#b91c1c;background:#fee2e2;font-size:.7rem;font-weight:800;cursor:pointer}.stock-sessions,.stock-detail{margin-top:16px}.stock-session-actions{display:flex;gap:6px}.stock-session-actions .remaining{color:#9a3412;background:#ffedd5}
@media(max-width:1100px){.purchase-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-manage,.stock-check-layout{grid-template-columns:1fr}}
@media(max-width:650px){.purchase-shell{padding:12px 10px 30px}.purchase-header{align-items:flex-start;flex-direction:column;padding:18px}.purchase-header>a,.purchase-header>strong{width:100%}.purchase-tabs a{font-size:.68rem}.purchase-form-grid,.purchase-summary,.stock-check-summary,.purchase-filter{grid-template-columns:1fr}.purchase-wide{grid-column:auto}.purchase-actions,.stock-check-entry,.stock-check-actions{grid-template-columns:1fr;display:grid}.purchase-primary,.purchase-secondary{width:100%}}
.purchase-tabs-two{grid-template-columns:repeat(2,minmax(0,1fr))}.submenu-disabled{opacity:.55;cursor:not-allowed;pointer-events:none}
