:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --green-dark: #15803d;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --amber: #f59e0b;
  --blue-soft: #dbeafe;
  --green-soft: #dcfce7;
  --red-soft: #fee2e2;
  --amber-soft: #fef3c7;
  --line: #dbe4ee;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
  --shadow-soft: 0 6px 18px rgba(31, 41, 55, 0.06);
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.14), transparent 28rem),
    radial-gradient(circle at 100% 8%, rgba(22, 163, 74, 0.12), transparent 24rem),
    linear-gradient(135deg, #f8fbff 0%, #f4f9f6 54%, #fff7f7 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.auth-shell {
  display: block;
}

.mobile-header,
.sidebar-backdrop,
.sidebar-close {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

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

.sidebar .brand {
  justify-content: flex-start;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--green));
  color: white;
  font-weight: 800;
}

.brand small, .muted, .delivery-card small {
  color: var(--muted);
}

.brand strong, .brand small {
  display: block;
}

.nav-link {
  color: #334155;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 650;
  font-size: 0.94rem;
}

.nav-link:hover, .action:hover {
  background: var(--blue-soft);
  color: var(--primary-dark);
}

.logout-link {
  margin-top: 10px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid rgba(220, 38, 38, 0.16);
}

.logout-link:hover {
  background: #fecaca;
  color: var(--red-dark);
}

.main {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px 10px;
  min-width: 0;
}

.topbar > div:first-child {
  min-width: 0;
}

.eyebrow {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
}

h1, h2, h3 {
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.04rem;
  font-weight: 800;
  margin: 0 0 16px;
}

h3 {
  font-size: 0.96rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.content {
  padding: 14px 30px 42px;
  min-width: 0;
  max-width: 100%;
}

.panel, .metric, .auth-card, .action, .delivery-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px;
  min-width: 0;
}

.panel {
  padding: 20px;
  overflow: hidden;
}

.compact-panel {
  margin-bottom: 18px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--green), var(--red));
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.62rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
}

.wide-left {
  grid-template-columns: minmax(320px, 500px) 1fr;
}

.request-management {
  display: grid;
  gap: 18px;
}

.request-entry-panel {
  align-self: start;
}

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

.subscription-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.7), rgba(220, 252, 231, 0.56));
  padding: 14px;
}

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

.subscription-preview-head h3 {
  margin: 0;
}

.subscription-preview-body {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 228, 238, 0.82);
  border-radius: 12px;
  padding: 10px;
}

.compact-table {
  margin: -10px;
}

.compact-table .table {
  font-size: 0.86rem;
}

.span-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.operational-holiday-form {
  align-items: end;
}

.operational-holiday-form .form-control {
  width: 160px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  font-weight: 650;
  color: #20343a;
  font-size: 0.94rem;
}

label .form-control, label .form-select {
  margin-top: 6px;
}

.form-note {
  border: 1px dashed #bfdbfe;
  border-radius: 11px;
  padding: 11px 12px;
  background: #eff6ff;
  display: grid;
  gap: 3px;
}

.form-note strong {
  color: var(--ink);
}

.form-note span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.form-control, .form-select {
  border-color: #d7e2e7;
  border-radius: 11px;
  min-height: 42px;
  max-width: 100%;
  font-size: 0.94rem;
}

.btn {
  border-radius: 11px;
  font-weight: 750;
  white-space: normal;
  font-size: 0.94rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  padding: 28px;
  align-self: center;
}

.auth-brand {
  margin-bottom: 0;
}

.auth-brand small {
  color: rgba(255, 255, 255, 0.85);
}

.login-stage {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: center;
}

.login-hero {
  min-height: 360px;
  border-radius: 22px;
  padding: 24px;
  color: white;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.28), transparent 8rem),
    radial-gradient(circle at 12% 92%, rgba(220, 38, 38, 0.32), transparent 13rem),
    linear-gradient(142deg, #1d4ed8 0%, #0284c7 42%, #16a34a 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  pointer-events: none;
}

.login-hero .brand-mark {
  background: white;
  color: var(--primary);
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 28px;
}

.login-kicker {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ecfeff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 520px;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.08;
  margin: 0;
}

.login-hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  margin: 0;
}

.login-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.login-feature-grid span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  font-size: 0.86rem;
}

.login-form-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-form-head h2 {
  margin-bottom: 4px;
}

.login-form-head p {
  margin: 0;
}

.login-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--green));
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

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

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

.prefixed-input {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.prefixed-input span {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #eef6ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.prefixed-input .form-control {
  border-radius: 0 12px 12px 0;
}

.filterbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.compact {
  margin-top: -4px;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.topbar-store-logo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
}

.topbar-store-logo img {
  max-height: 42px;
  max-width: 150px;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
}

.user-pill {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 800;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  line-height: normal;
}

a.user-pill {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

a.user-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.action {
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
  border-left: 5px solid var(--primary);
  overflow-wrap: anywhere;
}

.action:nth-child(3n + 2) {
  border-left-color: var(--green);
}

.action:nth-child(3n) {
  border-left-color: var(--red);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
  margin-bottom: 24px;
}

.chart-panel {
  padding: 20px;
}

.chart-panel--wide {
  grid-column: 1 / -1;
}

.chart-panel .panel-head h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-wrap--doughnut {
  height: 260px;
  max-width: 340px;
  margin: 0 auto;
}

.chart-empty {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  margin-top: 8px;
}

.dashboard-section {
  margin-bottom: 32px;
  padding-bottom: 8px;
}

.dashboard-section + .dashboard-section {
  border-top: 2px solid var(--line);
  padding-top: 24px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

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

.switch-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfefe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.switch-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.switch-copy strong {
  font-weight: 800;
}

.switch-copy small {
  color: var(--muted);
  font-weight: 700;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
}

.switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #cbd5dc;
  display: block;
  padding: 3px;
  transition: background 0.18s ease;
}

.switch-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  display: block;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.switch-control input:checked + .switch-track {
  background: linear-gradient(135deg, var(--primary), var(--green));
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateX(24px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid rgba(15, 118, 110, 0.25);
  outline-offset: 3px;
}

.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.weekday-row label {
  background: #f3f7f8;
  padding: 8px 10px;
  border-radius: 999px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: capitalize;
}

.ok, .delivered { background: var(--green-soft); color: #166534; }
.pending, .scheduled { background: var(--amber-soft); color: #92400e; }
.failed, .suspended, .expired { background: var(--red-soft); color: #991b1b; }
.skipped, .partially_delivered { background: var(--blue-soft); color: #1e40af; }
.accepted, .approved { background: #e0f2fe; color: #0369a1; }

.inline-form {
  display: flex;
  gap: 10px;
}

.delivery-list {
  display: grid;
  gap: 8px;
}

.delivery-searchbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 170px auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.delivery-searchbar label {
  margin: 0;
}

.delivery-status-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 8px;
}

.delivery-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.delivery-tab span {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2f7;
  color: var(--ink);
  font-size: 0.72rem;
}

.delivery-tab.is-active {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

.delivery-tab.delivered.is-active {
  border-color: #86efac;
  background: var(--green-soft);
  color: #166534;
}

.delivery-tab.failed.is-active {
  border-color: #fecaca;
  background: var(--red-soft);
  color: #991b1b;
}

.delivery-search-count {
  align-self: center;
  white-space: nowrap;
  font-weight: 800;
}

.delivery-empty-state {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  text-align: center;
}

.reset-password-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.payment-due-banner {
  margin-bottom: 14px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 13px 16px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
}

.operational-holiday-banner {
  margin-bottom: 14px;
  border: 1px solid #fca5a5;
  border-left: 6px solid var(--red);
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fee2e2, #fff7ed);
  color: #7f1d1d;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-soft);
}

.operational-holiday-banner strong {
  font-size: 1rem;
}

.operational-holiday-banner span {
  font-weight: 650;
}

.invoice-panel {
  border-color: #bfdbfe;
  background: #fbfdff;
}

.delivery-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  max-width: 100%;
}

.compact-delivery h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  font-size: 0.98rem;
}

.delivery-card.is-delivered {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.10);
}

.delivery-card.is-delivered h3,
.delivery-card.is-delivered .delivery-meta strong {
  color: #166534;
}

.delivery-card.is-delivered .delivery-actions {
  opacity: 0.72;
}

.delivery-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.28;
}

.delivery-meta {
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
}

.delivery-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.85fr) auto;
  gap: 8px;
  align-items: center;
}

.delivery-boy-field {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 850;
  color: var(--muted);
  text-transform: uppercase;
}

.delivery-boy-field .form-select {
  margin-top: 3px;
}

.pos-lines {
  display: grid;
  gap: 12px;
}

.pos-line {
  display: grid;
  grid-template-columns: 1fr 80px 100px 100px 42px;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: end;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fcfc;
  min-width: 0;
}

/* Product label spans the full row so the search field is as wide as the panel */
.pos-line > label:first-child {
  grid-column: 1 / -1;
}

.pos-row-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-product-search,
.pos-product-select {
  width: 100%;
}

.pos-product-search {
  margin-bottom: 6px;
}

.pos-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-search-wrap .form-control,
.pos-search-wrap .form-select {
  width: 100%;
}

.pos-line-total {
  background: #eef7f6 !important;
  font-weight: 600;
  color: var(--primary-dark);
}

.pos-grand-total {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  background: #f4faf9;
}

.pos-grand-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.95rem;
}

.pos-grand-row.total-row {
  border-top: 2px solid var(--primary);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: #ffffff;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.icon-button:hover:not(:disabled) {
  background: #e7f5f3;
  border-color: #b7dcd8;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-icon-button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.78rem;
}

.table-icon-button.danger {
  color: var(--red-dark);
  border-color: rgba(220, 38, 38, 0.28);
}

.add-pos-line {
  background: linear-gradient(135deg, var(--primary), var(--green));
  border-color: var(--primary);
  color: #ffffff;
}

.add-pos-line:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.remove-pos-line {
  color: var(--red-dark);
}

.activate-card {
  max-width: 560px;
}

.activation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.activation-summary div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f9fcfc;
}

.activation-summary span,
.invite-link-row small,
.mini-delivery-row small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

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

.invite-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #f9fcfc;
}

.invite-link-row code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  white-space: normal;
  color: var(--primary-dark);
}

.mini-delivery-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #f9fcfc;
}

.customer-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 20px;
  align-items: start;
}

.calendar-panel {
  overflow: visible;
}

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

.calendar-weekday {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 9px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
  color: var(--ink);
}

.calendar-empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.calendar-day:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.calendar-day.delivered-day {
  border-color: #86efac;
  background: #dcfce7;
}

.calendar-day.extra-day {
  border-color: #fdba74;
  background: #ffedd5;
}

.calendar-day.vacation-day {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.calendar-day.skipped-day {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.calendar-day span {
  font-weight: 900;
  color: var(--primary-dark);
}

.calendar-day.vacation-day span {
  color: #991b1b;
}

.calendar-day.skipped-day span {
  color: #991b1b;
}

.calendar-day strong,
.calendar-day em {
  font-size: 0.7rem;
  font-style: normal;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
}

.calendar-day strong {
  background: var(--green-soft);
  color: #166534;
}

.calendar-day em {
  background: var(--amber-soft);
  color: #92400e;
}

.calendar-day .vacation-badge {
  background: #fecaca;
  color: #991b1b;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.delivery-table {
  min-width: 780px;
}

.table {
  margin-bottom: 0;
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.calendar-detail {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 13px;
}

.calendar-detail p {
  margin: 8px 0 0;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.delivery-dot { background: var(--green); }
.request-dot { background: var(--amber); }
.vacation-dot { background: var(--red); }
.skipped-dot { background: var(--red-dark); }

@media (max-width: 980px) {
  body {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  body.nav-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 68px;
    width: 100%;
  }

  .auth-shell {
    padding-top: 0;
  }

  .mobile-header {
    position: fixed;
    z-index: 1030;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    max-width: 100vw;
  }

  .menu-toggle,
  .sidebar-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  }

  .menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary-dark);
    display: block;
  }

  .menu-toggle {
    gap: 2px;
  }

  .sidebar-close {
    margin-left: auto;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 600;
  }

  .sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    height: 100vh;
    padding: 16px;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 28px 0 60px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
  }

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

  .sidebar-backdrop {
    position: fixed;
    z-index: 1035;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .nav-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .sidebar .nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    padding: 9px 10px;
  }

  .topbar, .content {
    padding-left: 14px;
    padding-right: 14px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 8px;
  }

  h1 {
    font-size: 1.38rem;
    line-height: 1.15;
  }

  h2 {
    font-size: 0.98rem;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 0.92rem;
  }

  .eyebrow {
    font-size: 0.66rem;
  }

  p,
  .muted,
  small {
    font-size: 0.82rem;
  }

  .metric-grid, .action-grid, .toggle-grid, .grid-two, .wide-left, .customer-calendar-layout, .dashboard-charts {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .chart-panel--wide {
    grid-column: auto;
  }

  .request-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .auth-wrap {
    padding: 10px;
    max-width: 100vw;
    overflow-x: hidden;
    align-items: flex-start;
  }

  .login-stage {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
  }

  .login-feature-grid {
    display: none;
  }

  .login-hero {
    min-height: auto;
    padding: 14px;
    border-radius: 16px;
    display: grid;
    gap: 8px;
  }

  .login-hero::after {
    display: none;
  }

  .auth-brand {
    margin-bottom: 0;
  }

  .login-hero-copy {
    gap: 6px;
    margin: 0;
  }

  .login-kicker {
    display: none;
  }

  .login-hero h1 {
    font-size: 1.22rem;
    line-height: 1.1;
  }

  .login-hero p {
    font-size: 0.82rem;
  }

  .auth-card {
    padding: 16px;
  }

  .delivery-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .delivery-searchbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }

  .delivery-search-count {
    justify-self: start;
  }

  .compact-delivery h3 {
    font-size: 0.93rem;
  }

  .delivery-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .delivery-actions {
    grid-template-columns: 1fr;
  }

  .delivery-actions .form-control,
  .delivery-actions .form-select {
    min-height: 36px;
  }

  .hide-mobile {
    display: none !important;
  }

  .pos-line {
    grid-template-columns: 1fr;
  }

  .panel-head, .filterbar, .inline-form, .invite-link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .operational-holiday-form .form-control {
    width: 100%;
  }

  .activation-summary {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric,
  .auth-card,
  .action,
  .delivery-card,
  .switch-card,
  .calendar-detail {
    border-radius: 14px;
  }

  .panel,
  .auth-card {
    padding: 14px;
  }

  .metric,
  .action {
    padding: 14px;
  }

  .metric strong {
    font-size: 1.28rem;
    margin-top: 5px;
  }

  .metric span,
  .action,
  label,
  .btn,
  .form-control,
  .form-select {
    font-size: 0.88rem;
  }

  .form-control,
  .form-select {
    min-height: 40px;
    border-radius: 10px;
  }

  .btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .status {
    font-size: 0.66rem;
    padding: 3px 8px;
  }

  .panel-head {
    gap: 8px;
  }

  .user-pill {
    max-width: 40vw;
    padding: 7px 9px;
    font-size: 0.76rem;
  }

  .topbar-store-logo img {
    max-height: 30px;
    max-width: 110px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.92rem;
  }

  .brand {
    min-width: 0;
  }

  .brand > div {
    min-width: 0;
  }

  .brand strong,
  .brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table-responsive {
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px;
  }

  .table {
    min-width: 590px;
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.5rem;
  }

  .table-actions {
    gap: 5px;
  }

  .table-actions .btn {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .calendar-day {
    min-height: 48px;
    border-radius: 10px;
    padding: 6px;
    gap: 3px;
    font-size: 0.78rem;
    justify-items: start;
  }

  .calendar-day strong,
  .calendar-day em {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.58rem;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
  }

  .calendar-weekday {
    font-size: 0.58rem;
    letter-spacing: 0;
  }

  .calendar-detail {
    padding: 10px;
    font-size: 0.82rem;
  }

  .calendar-legend {
    gap: 9px;
    font-size: 0.76rem;
  }

  .month-picker {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
  }

  .switch-card {
    padding: 12px;
  }

  .switch-copy strong {
    font-size: 0.88rem;
  }

  .switch-copy small {
    font-size: 0.76rem;
  }

  .switch-track {
    width: 50px;
    height: 28px;
  }

  .switch-thumb {
    width: 22px;
    height: 22px;
  }

  .switch-control input:checked + .switch-track .switch-thumb {
    transform: translateX(22px);
  }

  .login-form-head {
    margin-bottom: 16px;
  }
}

.calendar-day.scheduled-day {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.app-processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(3px);
}

.app-processing-overlay[hidden] {
  display: none;
}

body.app-processing {
  cursor: progress;
}

.app-processing-card {
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 18px;
  border: 1px solid rgba(219, 234, 254, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.98)),
    #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.app-processing-spinner {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    conic-gradient(from 0deg, var(--primary), var(--green), var(--red), var(--primary));
  animation: app-processing-spin 0.9s linear infinite;
}

.app-processing-spinner .brand-mark {
  width: 48px;
  height: 48px;
  background: #ffffff;
  color: var(--primary);
  box-shadow: none;
  animation: app-processing-counter-spin 0.9s linear infinite;
}

.app-processing-card strong {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 850;
}

.app-processing-card p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.4;
}

@keyframes app-processing-spin {
  to { transform: rotate(360deg); }
}

@keyframes app-processing-counter-spin {
  to { transform: rotate(-360deg); }
}

.pwa-install-overlay,
.pwa-install-sheet {
  display: none;
}

body.pwa-install-open {
  overflow: hidden;
}

.pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 2990;
  display: block;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.pwa-install-overlay[hidden] {
  display: none;
}

.pwa-install-sheet {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 3000;
  display: block;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(240, 253, 250, 0.98)),
    #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.pwa-install-sheet[hidden] {
  display: none;
}

.pwa-install-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.pwa-install-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding-right: 34px;
}

.pwa-install-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #0f766e;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
}

.pwa-install-head strong {
  display: block;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
}

.pwa-install-head p,
.pwa-install-ios-help {
  margin: 4px 0 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pwa-install-ios-help {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 600;
}

.pwa-install-ios-help[hidden] {
  display: none;
}

.pwa-install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.pwa-install-actions .btn {
  width: 100%;
}

.panel-subsection {
  width: 100%;
  margin: 0.75rem 0;
  padding: 0.85rem;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
}

.panel-subsection h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: #0f172a;
}

/* --- My Subscription mobile card list --- */
.sub-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.sub-mobile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  background: var(--surface-raised, #f8f9fa);
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  gap: 0.5rem;
}

.sub-mobile-product {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #1e293b);
  flex: 1;
}

.sub-mobile-qty {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  white-space: nowrap;
  background: var(--primary-light, #eff6ff);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* ── Delivery Stock Preview Panel ─────────────────────────────── */
.delivery-preview-panel {
  margin-top: 1.25rem;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.delivery-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
}

.delivery-preview-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-icon {
  font-size: 2rem;
  line-height: 1;
}

.delivery-preview-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #1e293b);
}

.preview-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  font-style: italic;
}

.preview-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--surface-raised, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.legend-sub {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.legend-add {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.legend-note {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  margin-left: auto;
}

.preview-table {
  margin-bottom: 0;
}

.preview-table thead th {
  background: var(--surface-raised, #f8fafc);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
  padding: 0.65rem 1rem;
  border-bottom: 2px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.preview-table th.total-col,
.preview-table td.total-col {
  background: #fffbeb;
  border-left: 2px solid #fde68a;
}

.preview-row td {
  padding: 0.6rem 1rem;
  vertical-align: middle;
  border-color: var(--border, #e2e8f0);
  transition: background 0.15s;
}

.preview-row:hover td {
  background: var(--surface-raised, #f8fafc);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unit-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  background: var(--border, #e2e8f0);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qty-cell {
  white-space: nowrap;
}

.qty-chip {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
}

.sub-chip {
  background: #eff6ff;
  color: #2563eb;
}

.add-chip {
  background: #f0fdf4;
  color: #16a34a;
}

.total-qty {
  font-size: 0.9rem;
  color: #92400e;
}

.customer-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  background: var(--surface-raised, #f1f5f9);
  color: var(--text, #1e293b);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border, #e2e8f0);
}

.preview-table tfoot .preview-total-row td {
  background: #fffbeb;
  border-top: 2px solid #fde68a;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted, #64748b);
  gap: 0.5rem;
}

.preview-empty-icon {
  font-size: 2.5rem;
}

.preview-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* ── Calendar day request edit link ──────────────────────────────── */
.cal-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  font-size: 0.8rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
  vertical-align: middle;
}

.cal-edit-link:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* ── Searchable Combobox Component ───────────────────────────────── */
.searchable-combobox {
  position: relative;
  display: block;
  width: 100%;
}

.combobox-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.combobox-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted, #64748b);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.combobox-input {
  width: 100%;
  padding-left: 2.25rem !important;
  padding-right: 3.25rem !important;
  background-color: var(--surface, #ffffff);
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--ink, #1e293b);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: text;
}

.combobox-input:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: 0;
}

.combobox-input-wrap.is-open .combobox-input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--primary, #2563eb);
}

.combobox-actions {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.15rem;
  z-index: 2;
}

.combobox-clear-btn {
  background: none;
  border: none;
  color: var(--muted, #94a3b8);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.combobox-clear-btn:hover {
  color: var(--red, #ef4444);
  background-color: #fee2e2;
}

.combobox-arrow-btn {
  background: none;
  border: none;
  color: var(--muted, #64748b);
  padding: 0.25rem 0.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.combobox-arrow-btn:hover {
  opacity: 1;
}

.combobox-input-wrap.is-open .combobox-arrow-btn {
  transform: rotate(180deg);
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1060;
  background: #ffffff;
  border: 1px solid var(--primary, #2563eb);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 280px;
  overflow-y: auto;
  margin-top: -1px;
}

.combobox-dropdown.combobox-dropup {
  top: auto;
  bottom: 100%;
  border-top: 1px solid var(--primary, #2563eb);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-top: 0;
  margin-bottom: -1px;
}

.combobox-options {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.combobox-option {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-bottom: 1px solid #f8fafc;
  transition: background-color 0.12s;
}

.combobox-option:last-child {
  border-bottom: none;
}

.combobox-option.is-focused,
.combobox-option:hover {
  background-color: #eff6ff;
}

.combobox-option.is-selected {
  background-color: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
}

.combobox-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}

.combobox-option-title {
  font-size: 0.9rem;
  color: var(--ink, #1e293b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.combobox-option-sub {
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.combobox-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
}

.combobox-highlight {
  background-color: #fef08a;
  color: #854d0e;
  font-weight: 600;
  padding: 0 1px;
  border-radius: 2px;
}

.combobox-empty {
  padding: 1.25rem 0.85rem;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
  font-style: italic;
}

/* Small combobox variation */
.combobox-sm .combobox-input {
  padding-left: 1.85rem !important;
  padding-right: 2.75rem !important;
  font-size: 0.85rem;
  height: calc(1.5em + 0.5rem + 2px);
}
.combobox-sm .combobox-search-icon {
  left: 0.55rem;
}
.combobox-sm .combobox-search-icon svg {
  width: 12px;
  height: 12px;
}
.combobox-sm .combobox-option {
  padding: 0.4rem 0.65rem;
}
.combobox-sm .combobox-option-title {
  font-size: 0.82rem;
}

select.combobox-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.combobox-input-wrap.is-invalid .combobox-input {
  border-color: var(--red, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Password Toggle Eye Wrapper & Button */
.password-field-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}

.inline-form .password-field-wrapper {
  flex: 1;
  min-width: 0;
}

.password-field-wrapper .form-control,
.password-field-wrapper input {
  padding-right: 2.75rem !important;
}

.password-toggle-btn {
  position: absolute !important;
  right: 0.5rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  padding: 0.35rem !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #64748b !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
  line-height: 1 !important;
  z-index: 4 !important;
  user-select: none !important;
}

.password-toggle-btn:hover {
  color: #0f766e !important;
  background-color: rgba(15, 118, 110, 0.08) !important;
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #0f766e !important;
  outline-offset: 1px !important;
}

.password-toggle-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  pointer-events: none !important;
}




