:root {
  --pharma-teal: #00897b;
  --pharma-sidebar-bg: #000412;
  --pharma-sidebar-hover: rgba(18, 220, 226, .12);
  --pharma-ink: #071a44;
  --pharma-muted-ink: #48628e;
  --pharma-panel-border: rgba(162, 190, 230, .45);
  --pharma-glass: rgba(255, 255, 255, .82);
  --pharma-footer-height: 44px;
  --pharma-footer-safe-space: 24px;
}

body {
  font-size: 15px;
}

html,
body.layout-fixed {
  height: 100%;
}

body.layout-fixed {
  overflow: hidden;
}

body.layout-fixed .wrapper {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

body.layout-fixed .main-header.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1037;
}

body.layout-fixed .content-wrapper {
  height: calc(100vh - 70px - var(--pharma-footer-height));
  margin-top: 70px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

body.layout-fixed .main-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1036;
  min-height: var(--pharma-footer-height);
  padding-top: .7rem;
  padding-bottom: .7rem;
  background: rgba(248, 252, 255, .92);
  border-top: 1px solid rgba(170, 197, 233, .55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.layout-fixed .content-wrapper > .content {
  padding-bottom: calc(var(--pharma-footer-safe-space) + .75rem);
}

body.layout-fixed .main-sidebar .sidebar {
  padding-bottom: calc(var(--pharma-footer-height) + var(--pharma-footer-safe-space));
}

.user-initial,
.rx-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pharma-teal);
  color: #fff;
  font-weight: 700;
}

.user-initial {
  width: 34px;
  height: 34px;
}

.rx-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 16px;
  margin-right: 8px;
  vertical-align: middle;
}

.brand-link-logo {
  display: flex;
  align-items: center;
  min-height: 57px;
  padding: .62rem .75rem;
}

.brand-link-logo .brand-logo-mark {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  max-height: none;
  margin: 0 .65rem 0 0;
  object-fit: cover;
  border-radius: 10px;
}

.brand-link-logo .brand-wordmark {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 150px;
  max-width: 155px;
  height: auto;
  object-fit: contain;
}

.sidebar-collapse .brand-link-logo {
  justify-content: center;
  padding-left: .5rem;
  padding-right: .5rem;
}

.sidebar-collapse .brand-link-logo .brand-logo-mark {
  margin-right: 0;
}

.sidebar-collapse .brand-link-logo .brand-wordmark {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

.login-page {
  background: #eef4f6;
}

.login-logo {
  font-size: 30px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
}

.login-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

.content-wrapper {
  background:
    radial-gradient(circle at 14% 96%, rgba(2, 167, 255, .12) 0, rgba(2, 167, 255, 0) 34%),
    radial-gradient(circle at 96% 100%, rgba(0, 137, 123, .1) 0, rgba(0, 137, 123, 0) 31%),
    linear-gradient(135deg, #f8fbff 0%, #eef5fc 100%);
}

.app-topbar {
  min-height: 70px;
  padding: .75rem 1.55rem;
  color: var(--pharma-ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(246, 251, 255, .78));
  border-bottom: 1px solid rgba(170, 197, 233, .55);
  box-shadow: 0 12px 30px rgba(14, 43, 84, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-topbar-left,
.app-topbar-actions {
  display: flex;
  align-items: center;
}

.app-topbar-left {
  gap: 1rem;
}

.app-topbar-actions {
  gap: .75rem;
  margin-left: auto;
}

.topbar-menu-toggle,
.topbar-user-pill,
.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--pharma-panel-border);
  border-radius: 13px;
  color: var(--pharma-ink);
  background: var(--pharma-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 8px 22px rgba(18, 47, 90, .06);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.topbar-menu-toggle {
  width: 44px;
  font-size: 1rem;
}

.topbar-menu-toggle:hover,
.topbar-user-pill:hover,
.topbar-logout-btn:hover {
  color: var(--pharma-ink);
  text-decoration: none;
  border-color: rgba(78, 134, 211, .42);
  background: rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84), 0 10px 26px rgba(18, 47, 90, .1);
  transform: translateY(-1px);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(121, 151, 193, .32);
}

.topbar-page-link {
  color: var(--pharma-muted-ink);
  font-weight: 600;
  letter-spacing: .01em;
}

.topbar-page-link:hover {
  color: var(--pharma-ink);
  text-decoration: none;
}

.topbar-user-pill,
.topbar-logout-btn {
  gap: .65rem;
  padding: 0 1.05rem;
  font-weight: 600;
}

.topbar-user-pill {
  min-width: 176px;
}

.topbar-user-pill i:first-child,
.topbar-logout-btn i {
  font-size: 1.05rem;
  color: #244a86;
}

.topbar-user-caret {
  margin-left: .25rem;
  font-size: .72rem;
  color: #55709c;
}

.main-sidebar.sidebar-dark-teal,
.main-sidebar.sidebar-dark-teal .sidebar,
.main-sidebar.sidebar-dark-teal .brand-link {
  background-color: var(--pharma-sidebar-bg) !important;
}

.sidebar-dark-teal .brand-link {
  border-bottom-color: rgba(255, 255, 255, .08);
}

.sidebar-dark-teal .user-panel {
  border-bottom-color: rgba(255, 255, 255, .09);
}

.sidebar-dark-teal .nav-header {
  color: rgba(255, 255, 255, .62);
}

.sidebar-dark-teal .nav-sidebar > .nav-item > .nav-link:not(.active):hover {
  background-color: var(--pharma-sidebar-hover);
  color: #fff;
}

.sidebar-dark-teal .nav-sidebar > .nav-item > .nav-link.active {
  background-color: var(--pharma-teal);
  color: #fff;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 500;
}

.page-header p {
  margin: .25rem 0 0;
  color: #6c757d;
}

.surface {
  width: 100%;
  background: #fff;
  border: 0;
  border-radius: .25rem;
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
  margin-bottom: 1rem;
  padding: 1.25rem;
}

.form-surface {
  max-width: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.25rem;
}

.row.g-2,
.row.g-3 {
  margin-right: -.5rem;
  margin-left: -.5rem;
}

.row.g-2 > [class*="col-"],
.row.g-3 > [class*="col-"] {
  padding-right: .5rem;
  padding-left: .5rem;
  margin-bottom: 1rem;
}

.row.g-2 {
  margin-right: -.375rem;
  margin-left: -.375rem;
}

.row.g-2 > [class*="col-"] {
  padding-right: .375rem;
  padding-left: .375rem;
  margin-bottom: .75rem;
}

.filter-bar {
  padding: 1rem;
}

.table thead th {
  border-top: 0;
  font-weight: 600;
}

.table td,
.table th {
  vertical-align: middle;
}

.table td .form-check-input {
  position: static;
  margin: 0;
  vertical-align: middle;
}

.form-select {
  display: block;
  width: 100%;
  height: calc(2.25rem + 2px);
  padding: .375rem 2.45rem .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23495057' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 6l5 5 5-5'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 12px 12px;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  appearance: none;
  -webkit-appearance: none;
}

.form-select::-ms-expand {
  display: none;
}

.form-control,
.form-select,
.file-upload-control {
  border-radius: 4px;
}

.file-upload-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.file-upload-control:focus-within {
  border-color: #80bdff;
  box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
}

.file-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 .9rem;
  color: #1f2d3d;
  font-weight: 500;
  line-height: 1;
  background: #f8f9fa;
  border-right: 1px solid #ced4da;
  cursor: pointer;
}

.file-upload-name {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0 .85rem;
  color: #6c757d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.subscription-table {
  min-width: 920px;
}

.subscription-table th,
.subscription-table td {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.subscription-table input[type="date"] {
  min-width: 190px;
}

.subscription-toggle-cell {
  width: 150px;
}

.subscription-switch {
  display: inline-flex;
  min-height: 1.5rem;
  padding-left: 2.35rem;
}

.subscription-switch .custom-control-label {
  min-height: 1.5rem;
}

.subscription-switch .custom-control-label::before {
  top: .12rem;
}

.subscription-switch .custom-control-label::after {
  top: calc(.12rem + 2px);
}

.manual-stock-page {
  color: var(--pharma-ink);
}

.manual-stock-header {
  margin-bottom: 1rem;
}

.manual-stock-header h1 {
  color: var(--pharma-ink);
  font-size: clamp(1.85rem, 1.95vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -.02em;
}

.manual-stock-header p {
  color: #385682;
  font-size: .98rem;
}

.manual-stock-card {
  max-width: none;
  padding: 1.45rem 1.55rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(246, 251, 255, .66)),
    radial-gradient(circle at 14% 0%, rgba(48, 183, 255, .12), rgba(48, 183, 255, 0) 34%);
  border: 1px solid rgba(170, 199, 235, .68);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .86),
    0 14px 32px rgba(17, 47, 91, .085);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.manual-stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 1.45rem;
  row-gap: 1rem;
}

.manual-stock-card .form-group {
  margin-bottom: 0;
}

.manual-stock-field {
  min-width: 0;
}

.manual-stock-card .form-label {
  display: block;
  margin-bottom: .38rem;
  color: var(--pharma-ink);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.005em;
}

.manual-input-shell {
  position: relative;
}

.manual-input-icon {
  position: absolute;
  top: 50%;
  left: .9rem;
  z-index: 2;
  width: .95rem;
  color: #385f9d;
  font-size: .88rem;
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.manual-stock-card .form-control,
.manual-stock-card .form-select {
  height: 46px;
  min-height: 46px;
  padding: .55rem .85rem .55rem 2.65rem;
  color: #294776;
  font-size: .93rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, .72);
  border: 1px solid rgba(174, 199, 230, .82);
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .82),
    0 6px 14px rgba(22, 62, 113, .03);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease;
}

.manual-stock-card .form-select {
  padding-right: 2.35rem;
  background-position: right .85rem center;
}

.manual-stock-card .form-control::placeholder {
  color: #8ca2c5;
  font-weight: 500;
}

.manual-stock-card .form-control:focus,
.manual-stock-card .form-select:focus {
  color: #173969;
  background-color: rgba(255, 255, 255, .94);
  border-color: rgba(44, 164, 255, .78);
  box-shadow:
    0 0 0 .16rem rgba(44, 164, 255, .12),
    0 8px 18px rgba(30, 93, 157, .08);
}

.manual-stock-card .text-danger.small {
  display: block;
  max-width: 100%;
  margin-top: .25rem;
  overflow: hidden;
  color: #dc3545;
  font-size: .72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-stock-submit {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
}

.manual-stock-submit .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  min-height: 46px;
  padding: .58rem .85rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(135deg, #13c9ec 0%, #0078ff 100%);
  border: 0;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(0, 119, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.manual-stock-submit .btn i {
  font-size: .9rem;
}

.manual-stock-submit .btn:hover,
.manual-stock-submit .btn:focus {
  color: #fff;
  filter: saturate(1.05);
  box-shadow: 0 12px 26px rgba(0, 119, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .32);
  transform: translateY(-1px);
}

.manual-stock-submit .btn:active {
  transform: translateY(0);
}

.premium-page {
  color: var(--pharma-ink);
  padding: .35rem .15rem 1rem;
}

.premium-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.55rem;
}

.premium-page-header h1 {
  margin: 0;
  color: var(--pharma-ink);
  font-size: clamp(2rem, 2.08vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -.025em;
}

.premium-page-header p {
  margin: .35rem 0 0;
  color: #385682;
  font-size: 1rem;
}

.premium-page-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
}

.premium-card {
  width: 100%;
  margin-bottom: 1.5rem;
  padding: 1.55rem 1.75rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(247, 251, 255, .72)),
    radial-gradient(circle at 8% 0%, rgba(48, 183, 255, .11), rgba(48, 183, 255, 0) 38%);
  border: 0;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .88),
    0 12px 27px rgba(16, 48, 92, .068);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.premium-card.table-responsive,
.table-responsive.premium-card {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-responsive {
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.premium-card.compact {
  padding: 1.25rem 1.55rem;
}

.premium-page .form-label {
  margin-bottom: .55rem;
  color: var(--pharma-ink);
  font-size: .9rem;
  font-weight: 700;
}

.premium-page .form-control,
.premium-page .form-select,
.premium-page .file-upload-control {
  height: 46px;
  min-height: 46px;
  color: #294776;
  font-size: .94rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, .76);
  border: 1px solid rgba(174, 199, 230, .86);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 6px 14px rgba(22, 62, 113, .03);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.premium-page .form-control:focus,
.premium-page .form-select:focus,
.premium-page .file-upload-control:focus-within {
  color: #173969;
  background-color: rgba(255, 255, 255, .96);
  border-color: rgba(44, 164, 255, .78);
  box-shadow: 0 0 0 .16rem rgba(44, 164, 255, .12), 0 8px 18px rgba(30, 93, 157, .08);
}

.premium-page .form-select {
  padding-right: 2.35rem;
  background-position: right .85rem center;
}

.premium-page .form-control::placeholder {
  color: #8ca2c5;
}

.premium-page textarea.form-control {
  height: auto;
  min-height: 104px;
}

.premium-input-shell {
  position: relative;
}

.premium-input-shell .form-control,
.premium-input-shell .form-select,
.premium-input-shell .file-upload-control {
  padding-left: 2.75rem;
}

.premium-input-shell .file-upload-control {
  padding-left: 0;
}

.premium-input-icon {
  position: absolute;
  top: 50%;
  left: .9rem;
  z-index: 2;
  width: 1rem;
  color: #345b9d;
  font-size: .9rem;
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.premium-page .file-upload-button {
  padding-left: 2.55rem;
  color: var(--pharma-ink);
  background: rgba(248, 251, 255, .88);
}

.premium-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .58rem;
  min-height: 46px;
  padding: .6rem 1.35rem;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background-color .14s ease;
}

.premium-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.premium-btn-primary {
  color: #fff !important;
  background: linear-gradient(135deg, #13c9ec 0%, #006eff 100%);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(0, 119, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.premium-btn-primary:hover,
.premium-btn-primary:focus {
  color: #fff !important;
  box-shadow: 0 16px 30px rgba(0, 119, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.premium-btn-soft {
  color: #1764c8 !important;
  background: rgba(255, 255, 255, .78);
  border-color: rgba(169, 198, 235, .88);
  box-shadow: 0 8px 18px rgba(22, 62, 113, .04);
}

.premium-btn-soft:hover,
.premium-btn-soft:focus {
  color: #005bd8 !important;
  background: rgba(255, 255, 255, .96);
  border-color: rgba(91, 151, 232, .72);
}

.premium-table-card {
  padding: 1.45rem 1.75rem;
}

.premium-table {
  min-width: 820px;
  margin-bottom: 0;
  color: #153064;
}

.premium-table thead th {
  padding: .75rem .75rem 1rem;
  color: var(--pharma-ink);
  font-size: .9rem;
  font-weight: 800;
  border-top: 0;
  border-bottom: 1px solid rgba(174, 199, 230, .78);
  white-space: nowrap;
}

.premium-table tbody td {
  padding: 1.05rem .75rem;
  border-top: 0;
  border-bottom: 1px solid rgba(196, 215, 239, .72);
  vertical-align: middle;
}

.premium-table tbody tr:last-child td {
  border-bottom: 0;
}

.premium-table tbody tr:not(.module-row):hover td {
  background: rgba(242, 248, 255, .46);
}

.premium-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-right: .85rem;
  color: #0a6eff;
  font-weight: 800;
  background: linear-gradient(135deg, #edf6ff, #e5f0ff);
  border-radius: 50%;
}

.premium-name-cell {
  display: flex;
  align-items: center;
  min-width: 180px;
}

.premium-status {
  min-height: 30px;
  padding: .38rem .8rem;
  border-radius: 8px;
}

.premium-action-group {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(174, 199, 230, .82);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(22, 62, 113, .04);
}

.premium-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: .45rem .75rem;
  color: #0b6fff;
  background: rgba(255, 255, 255, .72);
  border: 0;
  border-right: 1px solid rgba(174, 199, 230, .72);
}

.premium-icon-btn:last-child {
  border-right: 0;
}

.premium-icon-btn:hover {
  color: #0052d6;
  background: #fff;
  text-decoration: none;
}

.premium-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 3rem 1rem;
  text-align: center;
  color: #31548b;
}

.premium-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  margin-bottom: 1.25rem;
  color: #6e92d1;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(222, 238, 255, .9), rgba(236, 246, 255, .72));
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.premium-empty-state h2,
.premium-empty-state h3 {
  margin: 0 0 .5rem;
  color: var(--pharma-ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.premium-empty-state p {
  margin: 0 0 1.25rem;
  max-width: 420px;
}

.premium-steps {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.55rem;
}

.premium-steps span {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 150px;
  justify-content: center;
  padding: .72rem 1.05rem;
  color: #21457f;
  font-weight: 700;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(174, 199, 230, .82);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(22, 62, 113, .04);
}

.premium-steps span.active {
  color: #fff;
  background: linear-gradient(135deg, #13c9ec 0%, #006eff 100%);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(0, 119, 255, .22);
}

.premium-filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.15rem;
  align-items: end;
}

.premium-filter-grid .span-3 { grid-column: span 3; }
.premium-filter-grid .span-4 { grid-column: span 4; }
.premium-filter-grid .span-5 { grid-column: span 5; }
.premium-filter-grid .span-6 { grid-column: span 6; }
.premium-filter-grid .span-7 { grid-column: span 7; }
.premium-filter-grid .span-2 { grid-column: span 2; }
.premium-filter-grid .span-12 { grid-column: span 12; }

.premium-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.15rem;
}

.premium-form-grid .span-4 { grid-column: span 4; }
.premium-form-grid .span-6 { grid-column: span 6; }
.premium-form-grid .span-12 { grid-column: span 12; }

.premium-page .form-actions {
  margin-top: 1.35rem;
}

.premium-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.premium-page .module-row td {
  padding: .8rem .75rem;
  color: #31558b;
  background: rgba(231, 242, 255, .68);
  border-bottom-color: rgba(196, 215, 239, .72);
  font-weight: 800;
  letter-spacing: .015em;
}

.premium-switch {
  display: inline-flex;
  min-height: 1.5rem;
  padding-left: 3.05rem;
}

.premium-switch .custom-control-label::before {
  top: .02rem;
  left: -3.05rem;
  width: 2.75rem;
  height: 1.48rem;
  background-color: #dce8f8;
  border-color: rgba(170, 199, 235, .9);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(33, 77, 130, .08);
}

.premium-switch .custom-control-label::after {
  top: calc(.02rem + 3px);
  left: calc(-3.05rem + 3px);
  width: calc(1.48rem - 6px);
  height: calc(1.48rem - 6px);
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(31, 82, 151, .16);
}

.premium-switch .custom-control-input:checked ~ .custom-control-label::before {
  background: linear-gradient(135deg, #13c9ec 0%, #006eff 100%);
  border-color: transparent;
}

.premium-switch .custom-control-input:checked ~ .custom-control-label::after {
  transform: translateX(1.27rem);
}

.premium-billing-table {
  min-width: 980px;
}

.premium-billing-table .form-control-sm {
  height: 38px;
  min-height: 38px;
  padding: .35rem .55rem;
  font-size: .875rem;
  border-radius: 4px;
}

.billing-empty-state {
  min-height: 180px;
  border-top: 1px solid rgba(174, 199, 230, .78);
  border-bottom: 1px solid rgba(174, 199, 230, .78);
}

.billing-summary-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
  padding: 1.15rem 0 0;
  color: var(--pharma-ink);
  font-weight: 800;
}

.billing-summary-row strong {
  min-width: 130px;
  text-align: right;
  font-size: 1.05rem;
}

.text-end {
  text-align: right !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .25rem .55rem;
  border-radius: 10rem;
  font-size: .75rem;
  font-weight: 700;
  background: #e9ecef;
  color: #495057;
}

.status-pill.ok,
.status-pill.available {
  background: #d4edda;
  color: #155724;
}

.status-pill.muted,
.status-pill.out-of-stock {
  background: #e9ecef;
  color: #495057;
}

.status-pill.expired {
  background: #f8d7da;
  color: #721c24;
}

.status-pill.expiring-soon {
  background: #d1ecf1;
  color: #0c5460;
}

.status-pill.low-stock {
  background: #fff3cd;
  color: #856404;
}

.module-row td {
  background: #f4f6f9;
  color: #6c757d;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .75rem;
}

.step-strip {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.step-strip span {
  border: 1px solid #ced4da;
  border-radius: 10rem;
  padding: .35rem .85rem;
  background: #fff;
  color: #6c757d;
  font-weight: 600;
}

.step-strip .active {
  background: var(--pharma-teal);
  color: #fff;
  border-color: var(--pharma-teal);
}

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

.metric-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 220px));
}

.metric-card {
  background: #fff;
  border-radius: .25rem;
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
  border-left: 4px solid var(--pharma-teal);
  padding: 1rem;
}

.metric-card span {
  display: block;
  color: #6c757d;
  margin-bottom: .5rem;
}

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

.metric-card.danger { border-left-color: #dc3545; }
.metric-card.success { border-left-color: #28a745; }
.metric-card.warning { border-left-color: #ffc107; }
.metric-card.notice { border-left-color: #17a2b8; }

.search-results {
  position: absolute;
  z-index: 1030;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  margin-top: .25rem;
  width: min(520px, calc(100vw - 48px));
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.search-result {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .65rem .75rem;
}

.search-result:hover {
  background: #f4f6f9;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result span {
  color: #6c757d;
  font-size: .85rem;
}

.bill-table input {
  min-width: 82px;
}

.bill-print {
  max-width: 920px;
  margin: 0 auto;
}

.bill-header,
.bill-customer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: .75rem;
  margin-bottom: .85rem;
}

.bill-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.bill-header p,
.bill-customer {
  color: #6c757d;
}

.bill-total {
  margin-left: auto;
  max-width: 320px;
}

.bill-total div {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
}

.bill-total .grand {
  border-top: 1px solid #dee2e6;
  font-size: 1.1rem;
}

.invoice-viewer-modal .modal-dialog {
  max-width: min(980px, calc(100vw - 2rem));
}

.invoice-viewer-modal .modal-content {
  overflow: hidden;
  color: var(--pharma-ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(244, 250, 255, .9)),
    radial-gradient(circle at 0 0, rgba(36, 182, 255, .1), rgba(36, 182, 255, 0) 36%);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(13, 45, 90, .16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.invoice-viewer-modal .modal-header,
.invoice-viewer-modal .modal-footer {
  border-color: rgba(190, 211, 238, .7);
}

.invoice-viewer-modal .modal-title {
  font-weight: 800;
}

.invoice-viewer {
  color: #153064;
}

.invoice-viewer-header,
.invoice-viewer-customer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(190, 211, 238, .72);
}

.invoice-viewer-header h2 {
  margin: 0;
  color: var(--pharma-ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.invoice-viewer-header p,
.invoice-viewer-customer {
  color: #48628e;
}

.invoice-viewer .premium-table {
  min-width: 760px;
}

.invoice-viewer-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #48628e;
  font-weight: 700;
}

.print-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-bottom: 1rem;
}

.empty-state {
  max-width: 680px;
  background: #fff;
  border-radius: .25rem;
  box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
  padding: 2rem;
  margin: 2rem auto;
  text-align: center;
}

.custom-switch .form-check-input {
  width: 2.25rem;
  margin-left: -2.5rem;
}

@media (max-width: 992px) {
  body {
    font-size: 14px;
  }

  body.layout-fixed .content-wrapper {
    height: calc(100vh - 64px - var(--pharma-footer-height));
    margin-top: 64px;
  }

  .app-topbar {
    min-height: 64px;
    padding: .65rem 1rem;
  }

  .app-topbar-left {
    gap: .75rem;
  }

  .topbar-user-pill {
    min-width: auto;
  }

  .topbar-user-caret {
    display: none;
  }

  .content {
    padding-top: .85rem !important;
  }

  .content .container-fluid {
    padding-left: .95rem;
    padding-right: .95rem;
  }

  .premium-page-header h1 {
    font-size: clamp(1.7rem, 4.6vw, 2.2rem);
  }

  .premium-page-header p {
    font-size: .94rem;
  }

  .premium-card {
    margin-bottom: 1.15rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .84),
      0 10px 22px rgba(16, 48, 92, .055);
  }

  .premium-table {
    font-size: .9rem;
  }

  .premium-table thead th {
    padding-top: .65rem;
    padding-bottom: .8rem;
  }

  .premium-table tbody td {
    padding-top: .85rem;
    padding-bottom: .85rem;
  }

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

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

  .premium-filter-grid .span-2,
  .premium-filter-grid .span-3,
  .premium-filter-grid .span-4,
  .premium-filter-grid .span-5,
  .premium-filter-grid .span-6,
  .premium-filter-grid .span-7,
  .premium-form-grid .span-4,
  .premium-form-grid .span-6 {
    grid-column: span 3;
  }

  .premium-filter-grid .span-12,
  .premium-form-grid .span-12 {
    grid-column: span 6;
  }

  .manual-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: .95rem;
  }
}

@media (max-width: 767.98px) {
  body.layout-fixed .main-header.app-topbar,
  body.layout-fixed .main-footer,
  body.sidebar-collapse.layout-fixed .main-header.app-topbar,
  body.sidebar-collapse.layout-fixed .main-footer {
    left: 0;
  }

  body.layout-fixed .content-wrapper {
    margin-left: 0 !important;
  }
}

@media (max-width: 1199px) and (min-width: 993px) {
  .manual-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13.5px;
  }

  body.layout-fixed .main-header.app-topbar,
  body.layout-fixed .main-footer,
  body.sidebar-collapse.layout-fixed .main-header.app-topbar,
  body.sidebar-collapse.layout-fixed .main-footer {
    left: 0;
  }

  body.layout-fixed .content-wrapper {
    height: calc(100vh - 64px - var(--pharma-footer-height));
    margin-top: 64px;
    margin-left: 0 !important;
  }

  .app-topbar {
    padding: .55rem .7rem;
  }

  .topbar-page-link {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-user-pill,
  .topbar-logout-btn {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .topbar-user-pill span,
  .topbar-logout-btn span,
  .topbar-divider {
    display: none;
  }

  .page-header {
    flex-direction: column;
  }

  .premium-page {
    padding-left: 0;
    padding-right: 0;
  }

  .premium-page-header {
    flex-direction: column;
    gap: .7rem;
    margin-bottom: .85rem;
  }

  .premium-page-header h1 {
    font-size: clamp(1.5rem, 7.2vw, 1.95rem);
    line-height: 1.08;
    letter-spacing: -.018em;
  }

  .premium-page-header p {
    margin-top: .28rem;
    font-size: .9rem;
    line-height: 1.35;
  }

  .premium-page-actions,
  .premium-page-actions .premium-btn {
    width: 100%;
  }

  .premium-card {
    margin-bottom: .95rem;
    padding: .95rem;
    border-radius: 8px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .78),
      0 8px 18px rgba(16, 48, 92, .05);
  }

  .premium-table-card {
    padding: .85rem;
  }

  .premium-filter-grid,
  .premium-form-grid {
    grid-template-columns: 1fr;
    gap: .78rem;
  }

  .premium-filter-grid .span-2,
  .premium-filter-grid .span-3,
  .premium-filter-grid .span-4,
  .premium-filter-grid .span-5,
  .premium-filter-grid .span-6,
  .premium-filter-grid .span-7,
  .premium-filter-grid .span-12,
  .premium-form-grid .span-4,
  .premium-form-grid .span-6,
  .premium-form-grid .span-12 {
    grid-column: 1;
  }

  .premium-steps span {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 40px;
    padding: .55rem .8rem;
    border-radius: 4px;
    font-size: .88rem;
  }

  .premium-page .form-label {
    margin-bottom: .38rem;
    font-size: .82rem;
  }

  .premium-page .form-control,
  .premium-page .form-select,
  .premium-page .file-upload-control {
    height: 42px;
    min-height: 42px;
    font-size: .88rem;
  }

  .premium-input-shell .form-control,
  .premium-input-shell .form-select,
  .premium-input-shell .file-upload-control {
    padding-left: 2.35rem;
  }

  .premium-input-icon {
    left: .72rem;
    width: .9rem;
    font-size: .82rem;
  }

  .premium-page .form-select {
    padding-right: 2rem;
    background-position: right .68rem center;
  }

  .premium-btn {
    min-height: 42px;
    padding: .52rem .95rem;
    font-size: .9rem;
  }

  .premium-table {
    min-width: 720px;
    font-size: .84rem;
  }

  .premium-table thead th {
    padding: .62rem .58rem .72rem;
    font-size: .8rem;
  }

  .premium-table tbody td {
    padding: .75rem .58rem;
  }

  .premium-action-group {
    border-radius: 4px;
  }

  .premium-icon-btn {
    min-width: 40px;
    min-height: 38px;
    padding: .38rem .58rem;
  }

  .premium-empty-state {
    min-height: 210px;
    padding: 1.7rem .7rem;
  }

  .premium-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: .9rem;
    font-size: 1.45rem;
  }

  .premium-empty-state h2,
  .premium-empty-state h3 {
    font-size: .98rem;
  }

  .premium-empty-state p {
    max-width: 280px;
    margin-bottom: .95rem;
    font-size: .86rem;
    line-height: 1.4;
  }

  .premium-table td[colspan] {
    padding: 0 !important;
  }

  .premium-table td[colspan] .premium-empty-state {
    position: sticky;
    left: 0;
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
  }

  .billing-summary-row {
    justify-content: space-between;
    gap: .85rem;
    padding-top: .85rem;
    font-size: .9rem;
  }

  .billing-summary-row strong {
    min-width: auto;
    font-size: .96rem;
  }

  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .manual-stock-card {
    padding: 1rem;
    border-radius: 10px;
  }

  .manual-stock-grid {
    grid-template-columns: 1fr;
    row-gap: .85rem;
  }

  .manual-stock-card .form-control,
  .manual-stock-card .form-select,
  .manual-stock-submit .btn {
    height: 46px;
    min-height: 46px;
  }

  .manual-stock-card .form-label {
    margin-bottom: .35rem;
    font-size: .88rem;
  }

  .manual-input-icon {
    left: .85rem;
    font-size: .86rem;
  }

  .manual-stock-card .form-control,
  .manual-stock-card .form-select {
    padding-left: 2.55rem;
  }

  .form-actions,
  .print-actions,
  .manual-stock-submit {
    flex-direction: column;
  }

  .form-actions .btn,
  .print-actions .btn,
  .manual-stock-submit .btn {
    width: 100%;
  }

  .invoice-viewer-modal .modal-dialog {
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .invoice-viewer-modal .modal-content {
    min-height: 100%;
    border-radius: 0;
  }

  .invoice-viewer-header,
  .invoice-viewer-customer {
    flex-direction: column;
    gap: .35rem;
  }

  .invoice-viewer-header h2 {
    font-size: 1.08rem;
  }
}

@media print {
  .main-sidebar,
  .main-header,
  .main-footer,
  .print-actions,
  .alert {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    background: #fff;
  }

  .content,
  .container-fluid {
    padding: 0 !important;
  }

  .surface,
  .bill-print {
    box-shadow: none;
    padding: 0;
  }
}
