:root {
  --bg: #f1e9eb;
  --card: #f5f5f5;
  --text: #111111;
  --muted: #5c6773;
  --primary: #d3345c;
  --primary-dark: #b90f3a;
  --danger: #b91c1c;
  --border: #dfe7ee;
  --field-bg: #dfeaf1;
  --button-bg: #1f2328;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Myanmar", "Myanmar Text", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.site-logo-image {
  display: block;
  width: auto;
  max-width: 58px;
  max-height: 44px;
  border-radius: 10px;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

nav a,
.button,
button {
  border: none;
  border-radius: 10px;
  background: #edf4f3;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.button.primary,
button[type='submit'] {
  background: var(--button-bg);
  color: #fff;
  border-radius: 12px;
  font-size: 0.95rem;
  padding: 12px 14px;
  font-weight: 700;
}

.button.full {
  width: 100%;
  display: inline-block;
  text-align: center;
}

.login-form {
  margin-top: 8px;
}

.hero,
.auth-shell,
.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}

.hero-card,
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.hero-card {
  text-align: center;
  padding: 48px 24px;
}

.branch-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  max-width: 840px;
  margin: 36px auto 8px;
  text-align: left;
}

.branch-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 32px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  color: var(--text);
  text-decoration: none;
}

.branch-choice span {
  color: var(--muted);
}

.branch-choice strong {
  font-size: 1.6rem;
}

.branch-choice small {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 18px;
  font-weight: 800;
  text-align: center;
}

h1, h2 {
  margin-top: 0;
}

.auth-card h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 22px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(100%, 540px);
  padding: 28px 34px 22px;
  border: 1px solid #d9d9d9;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.auth-logo {
  display: flex;
  justify-content: center;
  min-height: 72px;
  margin-bottom: 12px;
}

.auth-logo-image {
  display: block;
  width: auto;
  max-width: 190px;
  max-height: 82px;
  object-fit: contain;
  border-radius: 14px;
}

.login-contact {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.login-contact-details {
  display: grid;
  gap: 8px;
}

.login-contact-details a,
.login-contact-details > span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
}

.login-contact-details strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.login-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-social-links a {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4f3;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-social-links .social-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.login-social-links .facebook { background: #1877f2; }
.login-social-links .tiktok { background: #111; }
.login-social-links .telegram { background: #229ed9; }

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 16px 18px;
  font: inherit;
  background: var(--field-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

input::placeholder {
  color: rgba(17, 17, 17, 0.7);
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 14px;
  font-weight: 600;
}

.message.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.auth-links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.auth-links a.button {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.auth-links a.button:hover,
.auth-links a.button:focus-visible {
  background: var(--button-bg);
  color: #fff;
  text-underline-offset: 3px;
}

.single-link {
  margin-top: 26px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.dashboard-heading p {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.order-status-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.order-status-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 116px;
  padding: 16px 12px;
  border: 1px solid;
  border-radius: 14px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.order-status-row span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.04em;
}

.order-status-row i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.order-status-row strong {
  margin-top: 10px;
  font-size: 1.7rem;
  line-height: 1;
}

.status-pending {
  border-color: #f6d58a;
  background: #fff8df;
  color: #946200;
}

.status-confirmed {
  border-color: #b7d8fb;
  background: #edf6ff;
  color: #1769aa;
}

.status-processing {
  border-color: #d8c4f5;
  background: #f5efff;
  color: #7042a6;
}

.status-delivered {
  border-color: #b8e5ca;
  background: #edfbf2;
  color: #237a45;
}

.status-cancelled {
  border-color: #f2bcbc;
  background: #fff0f0;
  color: #b42323;
}

.chart-row,
.summary-line,
.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.card-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.card-heading-row h2 {
  margin-bottom: 4px;
}

.card-heading-row p {
  margin: 0;
}

.chart-legend {
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.daily-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 230px;
  margin-top: 20px;
}

.daily-chart-column {
  display: grid;
  grid-template-rows: 28px 1fr auto auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
  height: 190px;
  text-align: center;
}

.daily-chart-column > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-bar-track {
  display: flex;
  align-items: end;
  height: 120px;
  border-radius: 10px 10px 4px 4px;
  background: #fce8ee;
  overflow: hidden;
}

.daily-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #e13a63, #b91440);
}

.daily-chart-column > span,
.daily-chart-column > small {
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-total {
  margin-top: 16px;
  border-bottom: 0;
  border-top: 2px solid var(--border);
  font-size: 1.1rem;
}

.metric {
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.page-shell {
  display: grid;
  gap: 20px;
}

.card {
  padding: 22px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.admin-sidebar {
  align-self: start;
  position: sticky;
  top: 20px;
  padding: 18px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.sidebar-title {
  padding: 8px 12px 14px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sidebar-link,
.admin-sidebar summary,
.admin-sidebar details a {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.sidebar-link.active,
.sidebar-link:hover,
.admin-sidebar summary:hover,
.admin-sidebar details a:hover {
  background: #fff0f4;
  color: var(--primary-dark);
}

.admin-sidebar summary::-webkit-details-marker {
  display: none;
}

.admin-sidebar details a {
  padding: 8px 12px 8px 28px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.admin-sidebar .sidebar-current {
  background: #fff0f4;
  color: var(--primary-dark);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.section-heading h2,
.customer-card-heading h3 {
  margin-bottom: 6px;
}

.muted,
.customer-card-heading span,
.customer-card-footer {
  color: var(--muted);
}

.message.success {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.search-form .button {
  margin-top: 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.action-button {
  background: #fff0f4;
  color: var(--primary-dark);
}

.count-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.72rem;
}

.inline-category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.inline-category-form .button {
  margin-top: 0;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.category-edit-form {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.category-edit-form input {
  min-width: 0;
  padding: 9px 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--border);
}

.category-edit-form .button,
.category-pill > .button,
.category-pill > form + form .button {
  flex: 0 0 auto;
  padding: 9px 11px;
}

.category-pill a {
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.customer-management-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.customer-management-card {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.customer-list-row {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr 1.2fr 1.25fr auto;
  align-items: center;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.customer-list-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-list-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.customer-detail-cell {
  justify-items: end;
  gap: 7px;
}

.vip-toggle-form {
  margin: 0;
}

.vip-add-button,
.vip-remove-button {
  min-width: 92px;
  justify-content: center;
  font-size: 0.78rem;
}

.vip-add-button {
  background: #b8860b;
  border-color: #b8860b;
  color: #fff;
}

.vip-remove-button {
  background: #fff4d6;
  border-color: #e0bd63;
  color: #805b00;
}

.detail-button {
  min-width: 92px;
  justify-content: center;
  background: #b4233c;
  border-color: #b4233c;
  color: #fff;
  font-weight: 800;
}

.detail-button:hover {
  background: #8f1830;
  border-color: #8f1830;
}

.customer-card-heading,
.customer-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.customer-card-heading strong {
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.customer-card-footer {
  margin-top: 4px;
  font-size: 0.9rem;
}

.customer-card-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.customer-detail-filter {
  align-items: end;
}

.customer-history-filter label {
  min-width: 140px;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(125px, 1fr)) 140px 140px auto auto;
  align-items: end;
  gap: 10px;
  margin: 16px 0;
}

.admin-filter-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-filter-form input,
.admin-filter-form select {
  width: 100%;
  min-width: 140px;
}

.customer-detail-metrics {
  margin: 0;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.admin-notification {
  position: relative;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #173f35;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 42, 35, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cart-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cart-toast.error {
  background: #a33b32;
}

.customer-profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 30px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(120deg, #123f35, #23715d);
  box-shadow: 0 18px 40px rgba(18, 63, 53, 0.18);
}

.customer-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: #f0b85b;
  color: #173f35;
  font-size: 2rem;
  font-weight: 800;
}

.customer-profile-copy h1,
.customer-profile-copy p {
  margin: 0;
}

.customer-profile-copy h1 {
  margin-top: 4px;
  color: #fff;
}

.customer-profile-copy p:last-child {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.78);
}

.customer-profile-hero .eyebrow {
  color: #f6d18a;
}

.account-status {
  margin-left: auto;
  align-self: flex-start;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  font-weight: 700;
}

.customer-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.customer-details-card,
.customer-summary-card {
  margin: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.customer-summary-card h2 {
  margin-top: 2px;
}

.profile-check {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e4f4ed;
  color: #23715d;
  font-weight: 800;
}

.profile-detail-list {
  display: grid;
  gap: 0;
  margin: 20px 0 24px;
}

.profile-detail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0ed;
}

.profile-detail span {
  color: #71807a;
}

.profile-detail strong {
  color: #173f35;
  text-align: right;
}

.customer-summary-card .customer-metrics {
  margin-top: 22px;
}

@media (max-width: 760px) {
  .customer-profile-hero {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 22px;
  }

  .account-status {
    width: 100%;
    margin-left: 0;
  }

  .customer-profile-layout {
    grid-template-columns: 1fr;
  }
}

.admin-notification.has-alert {
  background: #fff0f4;
  color: var(--primary-dark);
}

.payment-proof-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.proof-view-button {
  padding: 6px 9px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.proof-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.78);
}

.proof-modal.is-open {
  display: grid;
}

.proof-modal-panel {
  position: relative;
  max-width: min(900px, 94vw);
  max-height: 90vh;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.proof-modal-panel img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.proof-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #b4233c;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-actions form {
  margin: 0;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.invoice-actions .button {
  white-space: nowrap;
}

.approve-button {
  background: #166534;
  color: #fff;
}

.reject-button {
  background: #b91c1c;
  color: #fff;
}

.print-page {
  background: #fff;
}

.invoice-paper {
  max-width: 900px;
  margin: 32px auto;
  padding: 36px;
  background: #fff;
}

.invoice-header,
.invoice-meta,
.invoice-customer,
.invoice-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.invoice-header {
  align-items: start;
  border-bottom: 2px solid var(--text);
  padding-bottom: 22px;
}

.invoice-header h1 {
  display: inline;
  margin: 0 0 0 10px;
}

.invoice-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.invoice-meta,
.invoice-customer {
  flex-direction: column;
  align-items: end;
  margin: 22px 0;
}

.invoice-paper table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-paper th,
.invoice-paper td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.invoice-paper th:last-child,
.invoice-paper td:last-child {
  text-align: right;
}

.invoice-footer {
  align-items: center;
  margin-top: 24px;
}

@media print {
  .print-hide {
    display: none;
  }

  .invoice-paper {
    margin: 0;
    padding: 0;
  }
}

.permission-picker,
.user-management-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.location-picker {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.location-picker legend {
  padding: 0 4px;
  font-weight: 700;
}

.location-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.location-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
}

.location-option:has(input:checked) {
  border-color: var(--primary);
  background: #fff0f4;
  color: var(--primary-dark);
}

.location-option input {
  width: auto;
  padding: 0;
  accent-color: var(--primary);
}

.permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.permission-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  font-size: 0.9rem;
}

.permission-option input {
  width: auto;
  padding: 0;
}

.user-management-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.user-management-card {
  margin: 0;
}

.admin-content {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.pos-shell {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
}

.pos-products {
  min-width: 0;
}

.pos-category-control {
  position: relative;
  display: inline-block;
  margin: 14px 0 18px;
}

.category-button {
  min-width: 132px;
  justify-content: space-between;
}

.category-button.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #fff0f4;
}

.pos-category-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  min-width: 210px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(18, 63, 53, 0.14);
}

.pos-category-menu a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.pos-category-menu a:hover,
.pos-category-menu a.active {
  color: var(--primary-dark);
  background: #fff0f4;
}

.pos-product-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.pos-product-card {
  gap: 7px;
}

.pos-product-card .button {
  margin-top: auto;
}

.pos-cart-card {
  align-self: start;
  position: sticky;
  top: 20px;
}

.pos-cart-row {
  display: grid;
  grid-template-columns: 1fr 65px auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.pos-cart-row span,
.pos-cart-row small {
  display: block;
}

.pos-cart-row button {
  padding: 6px;
  color: var(--danger);
  background: #fff1f2;
  font-size: .75rem;
}

.pos-cart-row input {
  width: 65px;
  padding: 7px;
}

.pos-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  font-size: 1.15rem;
}

.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.receipt-meta span {
  color: var(--muted);
}

.receipt-lines {
  border-top: 1px solid var(--border);
}

.receipt-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.admin-content > .card,
.admin-content > .dashboard-grid,
.admin-content > .metric-grid,
.admin-content > .dashboard-heading {
  margin: 0;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-menu-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.mobile-module-drawer {
  position: fixed;
  right: 0;
  bottom: 76px;
  left: 0;
  z-index: 19;
  display: flex;
  justify-content: center;
  padding: 0 14px 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mobile-module-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-module-panel {
  width: min(100%, 560px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(18, 63, 53, 0.2);
}

.mobile-module-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #173f35;
}

.mobile-module-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #edf4f0;
  color: #173f35;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mobile-module-grid a {
  padding: 11px 12px;
  border: 1px solid #e3ebe6;
  border-radius: 12px;
  color: #285a4b;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-module-grid a:active,
.mobile-module-grid a:hover {
  border-color: #23715d;
  background: #f0f8f4;
}

.welcome {
  color: var(--muted);
  font-weight: 600;
}

.inline-form {
  display: inline;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef2f3;
}

.product-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.table-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.branch-tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.branch-tabs a {
  padding: 10px 14px;
  border-radius: 999px;
  background: #edf4f3;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.branch-tabs a.active {
  color: #fff;
  background: var(--primary);
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-tabs a {
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.category-tabs a.active {
  border-color: var(--primary);
  background: #fff0f4;
  color: var(--primary-dark);
}

.payment-options {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.payment-option {
  flex-direction: row;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
}

.payment-option span,
.payment-option small {
  display: block;
}

.payment-option small {
  color: var(--muted);
  margin-top: 4px;
}

.copy-button {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.checkout-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.checkout-layout > .card {
  padding: 26px;
}

.checkout-layout h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.checkout-layout .stacked-form {
  margin-top: 16px;
}

.guest-account-fields {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #dcebe4;
  border-radius: 14px;
  background: #f5faf7;
}

.form-note {
  margin: 0 0 12px;
  color: #507165;
  font-size: 0.88rem;
}

.checkout-layout label {
  gap: 6px;
}

.checkout-layout input,
.checkout-layout select {
  min-height: 44px;
}

.order-summary {
  position: sticky;
  top: 20px;
}

.order-summary .summary-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.summary-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-summary h2 {
  margin-bottom: 16px;
}

.summary-line {
  padding: 10px 0;
  font-size: 0.92rem;
}

.checkout-float {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 10px 18px 10px 22px;
  border: 0;
  border-radius: 999px;
  background: #173f35;
  color: #fff;
  box-shadow: 0 14px 30px rgba(18, 63, 53, 0.28);
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.checkout-float:hover,
.checkout-float:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(18, 63, 53, 0.34);
}

.checkout-float span {
  font-weight: 800;
}

.checkout-float strong {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: #f6d18a;
  font-size: 0.9rem;
}

.payment-confirmation {
  padding: 16px;
  background: #fff3f6;
  border: 1px solid #f5bfd0;
  border-radius: 12px;
  margin: 18px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.setting-card {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.settings-logo-preview {
  display: block;
  width: auto;
  max-width: 180px;
  max-height: 72px;
  margin: 4px 0 8px;
  object-fit: contain;
}

.invoice-logo {
  display: block;
  width: auto;
  max-width: 140px;
  max-height: 52px;
  margin-bottom: 8px;
  object-fit: contain;
}

.print-size-100x150 .invoice-paper {
  width: 100mm;
  min-height: 150mm;
}

.print-size-58 .invoice-paper {
  width: 58mm;
  min-height: 100mm;
}

.print-size-90 .invoice-paper {
  width: 90mm;
  min-height: 130mm;
}

.upload-field input {
  background: #fff;
  padding: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.mobile-data-table {
  width: 100%;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
}

.product-card h3 {
  margin: 0;
}

.product-card p {
  margin: 0;
  color: var(--muted);
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-top: auto;
}

.product-footer form {
  align-items: center;
  gap: 8px;
  margin: 0;
}

.product-price small {
  display: block;
  color: #15803d;
  font-weight: 700;
  margin-top: 4px;
}

.product-price small.out-of-stock {
  color: var(--danger);
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.quantity-button {
  width: 30px;
  height: 32px;
  padding: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

.quantity-input {
  width: 42px;
  padding: 6px 2px;
  border-radius: 0;
  background: #fff;
  text-align: center;
  font-size: 0.9rem;
}

.product-footer small {
  display: block;
  color: var(--muted);
}

.checkout-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stacked-form {
  margin-top: 20px;
}

@media (max-width: 640px) {
  .pos-shell {
    grid-template-columns: 1fr;
    padding-left: 14px;
    padding-right: 14px;
  }

  .pos-cart-card {
    position: static;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  .topbar .brand {
    gap: 8px;
  }

  .topbar .brand strong {
    font-size: 0.94rem;
  }

  .topbar .brand small {
    font-size: 0.68rem;
  }

  .topbar .site-logo-image,
  .topbar .logo {
    max-width: 44px;
    width: 36px;
    height: 36px;
    max-height: 36px;
    border-radius: 9px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .auth-shell {
    padding: 22px 12px 88px;
  }

  .auth-card {
    padding: 24px 18px 18px;
    border-radius: 16px;
  }

  .auth-logo {
    min-height: 60px;
    margin-bottom: 8px;
  }

  .auth-logo-image {
    max-width: 150px;
    max-height: 64px;
    border-radius: 12px;
  }

  .auth-card h1 {
    margin-bottom: 16px;
    font-size: 2.2rem;
  }

  .metric-grid,
  .dashboard-grid,
  .settings-grid,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-layout {
    gap: 14px;
    padding: 18px 14px 144px;
  }

  .checkout-layout > .card {
    padding: 16px;
    border-radius: 16px;
  }

  .checkout-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 8px;
  }

  .checkout-topbar .brand {
    min-width: 0;
    gap: 8px;
  }

  .checkout-topbar .brand > div {
    min-width: 0;
  }

  .checkout-topbar .brand strong,
  .checkout-topbar .brand small {
    white-space: nowrap;
  }

  .checkout-topbar .site-logo-image {
    max-width: 44px;
    max-height: 34px;
  }

  .checkout-topbar nav {
    width: auto;
  }

  .checkout-topbar nav a {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .checkout-layout h1 {
    font-size: 1.55rem;
  }

  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .cart-table tr:last-child {
    border-bottom: 0;
  }

  .cart-table td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .cart-table td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .cart-table td:nth-child(1)::before { content: "Product"; }
  .cart-table td:nth-child(2)::before { content: "Qty"; }
  .cart-table td:nth-child(3)::before { content: "Price"; }
  .cart-table td:nth-child(4)::before { content: "Subtotal"; }
  .cart-table td:nth-child(5) {
    display: block;
    padding-top: 10px;
  }

  .cart-table td:nth-child(5)::before {
    display: block;
    margin-bottom: 6px;
  }

  .cart-table td:nth-child(5) form,
  .cart-table td:nth-child(5) button {
    width: 100%;
  }

  .checkout-box {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .checkout-box .button {
    width: 100%;
    text-align: center;
  }

  .checkout-layout .two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .checkout-layout .stacked-form {
    gap: 12px;
    margin-top: 12px;
  }

  .checkout-layout .guest-account-fields {
    margin: 8px 0;
    padding: 10px;
  }

  .checkout-layout label {
    gap: 5px;
    font-size: 0.86rem;
  }

  .checkout-layout input,
  .checkout-layout select {
    min-height: 42px;
    padding: 11px 13px;
    border-radius: 10px;
  }

  .checkout-layout .payment-options {
    margin: 8px 0;
    padding: 9px;
  }

  .checkout-layout .payment-option {
    padding: 7px;
    font-size: 0.86rem;
  }

  .checkout-layout .payment-option small {
    font-size: 0.76rem;
    overflow-wrap: anywhere;
  }

  .checkout-layout input[type='file'] {
    width: 100%;
    min-width: 0;
    font-size: 0.74rem;
  }

  .checkout-submit {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .order-summary {
    position: static;
    order: -1;
  }

  .order-summary h2 {
    margin-bottom: 8px;
    font-size: 1.05rem;
  }

  .order-summary .summary-line {
    padding: 7px 0;
    font-size: 0.82rem;
  }

  .order-summary .summary-total {
    margin-top: 6px;
    padding-top: 10px;
  }

  .checkout-float {
    right: 14px;
    bottom: 70px;
    left: 14px;
    justify-content: space-between;
    min-height: 48px;
    padding: 7px 14px;
    font-size: 0.88rem;
  }

  .checkout-float strong {
    padding-left: 12px;
    font-size: 0.8rem;
  }

  .order-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filter-form {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .admin-filter-form > input,
  .admin-filter-form > select {
    grid-column: 1 / -1;
  }

  .admin-filter-form label {
    min-width: 0;
  }

  .admin-filter-form .button {
    width: 100%;
  }

  .location-options {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  body {
    padding-bottom: 58px;
  }

  .branch-picker {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .branch-choice {
    padding: 22px;
  }

  .page-shell,
  .hero,
  .auth-shell {
    width: 100%;
    min-width: 0;
    padding-right: 14px;
    padding-left: 14px;
  }

  .page-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-shell > * {
    min-width: 0;
  }

  .page-shell > .card {
    padding: 18px;
  }

  .page-shell > .card .eyebrow {
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .page-shell > .card h1 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.15;
  }

  .branch-tabs a,
  .category-tabs a {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .branch-tabs a {
    padding: 9px 12px;
  }

  .category-tabs a {
    padding: 7px 10px;
  }

  .product-grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .product-card {
    min-width: 0;
    width: 100%;
    padding: 14px;
    overflow: hidden;
  }

  .product-card h3,
  .product-card p,
  .product-meta {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .product-card h3 {
    font-size: 1.02rem;
    line-height: 1.3;
  }

  .product-card p {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .product-meta {
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.72rem;
  }

  .category-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .admin-shell {
    display: block;
    padding: 18px 14px 96px;
  }

  .admin-content,
  .admin-content > .card,
  .admin-content > .dashboard-heading,
  .admin-content > .metric-grid {
    min-width: 0;
  }

  .admin-content > .card {
    padding: 16px;
    border-radius: 16px;
  }

  .section-heading {
    flex-direction: column;
    gap: 10px;
  }

  .section-heading > form,
  .section-heading > .inline-filter,
  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions {
    justify-content: stretch;
  }

  .dashboard-actions .button,
  .dashboard-actions form,
  .dashboard-actions form .button {
    width: 100%;
  }

  .inline-category-form {
    grid-template-columns: 1fr;
  }

  .inline-category-form .button {
    width: 100%;
  }

  .category-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-pill {
    justify-content: space-between;
    min-width: 0;
    gap: 8px;
    flex-wrap: wrap;
  }

  .category-edit-form {
    width: 100%;
    flex-basis: 100%;
  }

  .category-pill span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .customer-list-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .customer-detail-cell {
    justify-items: start;
  }

  .admin-sidebar {
    position: static;
    margin-bottom: 18px;
  }

  .admin-sidebar details {
    display: none;
  }

  .admin-sidebar .sidebar-link:not(.active) {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
    min-height: 52px;
    padding: 2px 8px max(2px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e3ebe6;
    border-radius: 0;
    box-shadow: 0 -3px 12px rgba(18, 63, 53, 0.1);
  }

  .mobile-bottom-nav a {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 46px;
    margin: 0 auto;
    color: #71807a;
    text-decoration: none;
    transition: color 160ms ease;
  }

  .mobile-bottom-nav .mobile-menu-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 46px;
    margin: 0 auto;
    color: #71807a;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }

  .mobile-bottom-nav .mobile-menu-button .nav-icon {
    width: 34px;
    height: 34px;
    padding: 6px;
    border-radius: 0;
  }

  .mobile-module-drawer {
    bottom: 52px;
  }

  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav a:focus-visible,
  .mobile-bottom-nav a.active:hover,
  .mobile-bottom-nav a.active:focus-visible {
    color: #fff;
    background: var(--primary);
    border-radius: 10px;
  }

  .mobile-bottom-nav a:hover .nav-icon,
  .mobile-bottom-nav a:focus-visible .nav-icon,
  .mobile-bottom-nav a.active:hover .nav-icon,
  .mobile-bottom-nav a.active:focus-visible .nav-icon {
    color: #fff;
    stroke: #fff;
  }

  .nav-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    background: transparent;
    padding: 6px;
    box-shadow: none;
  }

  .mobile-bottom-nav a.active .nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 0;
    background: transparent;
    color: #71807a;
    stroke: currentColor;
    box-shadow: none;
  }

  .mobile-bottom-nav .mobile-cart .nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 0;
    background: transparent;
    color: #71807a;
    stroke: currentColor;
    box-shadow: none;
  }

  .cart-badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
    display: grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #d12655;
    border-radius: 999px;
    background: #ffd166;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
  }

  .settings-page {
    padding-bottom: 100px;
  }

  .module-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .module-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
  }

  .module-status-icon {
    display: grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-weight: 800;
  }

  .module-status-card strong,
  .module-status-card small {
    display: block;
  }

  .module-status-card small,
  .setting-status {
    margin-top: 4px;
    color: var(--muted);
  }

  .module-arrow {
    margin-left: auto;
    color: var(--primary);
    font-size: 1.35rem;
  }

  .table-wrap table {
    min-width: 650px;
  }

  .table-wrap:has(.mobile-data-table) {
    overflow-x: visible;
  }

  .mobile-data-table,
  .mobile-data-table tbody,
  .mobile-data-table tr,
  .mobile-data-table td {
    display: block;
    width: 100%;
  }

  .mobile-data-table {
    min-width: 0 !important;
  }

  .mobile-data-table thead {
    display: none;
  }

  .mobile-data-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .mobile-data-table tr:last-child {
    border-bottom: 0;
  }

  .mobile-data-table td {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .mobile-data-table td::before {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-data-table td:nth-child(1)::before { content: "Image / Order"; }
  .mobile-data-table td:nth-child(2)::before { content: "Date / Product"; }
  .mobile-data-table td:nth-child(3)::before { content: "Category / Customer"; }
  .mobile-data-table td:nth-child(4)::before { content: "SKU / Branch"; }
  .mobile-data-table td:nth-child(5)::before { content: "Stock / Total"; }
  .mobile-data-table td:nth-child(6)::before { content: "Price / Payment"; }
  .mobile-data-table td:nth-child(7)::before { content: "Total / Proof"; }
  .mobile-data-table td:nth-child(8)::before { content: "Action"; }

  .mobile-data-table td[colspan] {
    display: block;
    padding: 16px 0;
  }

  .mobile-data-table td[colspan]::before {
    display: none;
  }

  .mobile-data-table .order-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .mobile-data-table .order-actions .button,
  .mobile-data-table .proof-view-button {
    width: 100%;
    text-align: center;
  }

  .invoice-table-wrap {
    overflow-x: visible;
  }

  .invoice-table {
    min-width: 0 !important;
    width: 100%;
  }

  .invoice-table thead {
    display: none;
  }

  .invoice-table,
  .invoice-table tbody,
  .invoice-table tr,
  .invoice-table td {
    display: block;
  }

  .invoice-table tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .invoice-table tr:last-child {
    border-bottom: 0;
  }

  .invoice-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 0;
  }

  .invoice-table td::before {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .invoice-table td:nth-child(1)::before { content: "Invoice"; }
  .invoice-table td:nth-child(2)::before { content: "Date"; }
  .invoice-table td:nth-child(3)::before { content: "Order"; }
  .invoice-table td:nth-child(4)::before { content: "Customer"; }
  .invoice-table td:nth-child(5)::before { content: "Branch"; }
  .invoice-table td:nth-child(6)::before { content: "Total"; }
  .invoice-table td:nth-child(7)::before { content: "Status"; }
  .invoice-table td:nth-child(8) {
    display: block;
    padding-top: 12px;
  }

  .invoice-table td:nth-child(8)::before {
    display: block;
    margin-bottom: 8px;
  }

  .invoice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .invoice-actions .button {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 9px 8px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .module-status-grid {
    grid-template-columns: 1fr;
  }

  .product-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .product-footer form {
    align-items: stretch;
    width: 100%;
  }

  .quantity-control {
    justify-content: center;
    width: 100%;
  }

  .quantity-button {
    flex: 1;
  }

  .quantity-input {
    flex: 1;
    width: auto;
  }

  .product-footer .add-to-cart-button {
    width: 100%;
    font-size: 0.9rem;
    padding: 11px 12px;
  }
}

@media (max-width: 640px) {
  body:has(.checkout-layout) .checkout-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
  }

  body:has(.checkout-layout) .checkout-topbar .brand {
    min-width: 0;
  }

  body:has(.checkout-layout) .checkout-topbar nav {
    width: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    width: 100%;
    min-width: 0;
  }

  body:has(.admin-shell) > .topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .admin-dashboard > .topbar nav {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .admin-shell {
    width: 100%;
    max-width: none;
    min-width: 0;
    grid-template-columns: 1fr;
    padding: 18px 14px 96px;
  }

  .admin-content {
    width: 100%;
    min-width: 0;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-content > .card,
  .admin-content > .dashboard-grid,
  .admin-content > .metric-grid,
  .admin-content > .dashboard-heading {
    width: 100%;
    min-width: 0;
  }

  .admin-content .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-content .dashboard-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-content .dashboard-actions form {
    margin: 0;
  }

  .admin-content .order-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.admin-shell) .mobile-module-drawer {
    bottom: 64px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  body {
    padding-bottom: 76px;
  }

  /* Keep the public header compact when it only contains the guest actions. */
  .topbar:has(nav a[href^="/login"]) {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .topbar:has(nav a[href^="/login"]) nav {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .topbar:has(nav a[href^="/login"]) nav a {
    white-space: nowrap;
  }

  .hero-card {
    padding: 28px 18px;
  }

  .hero-card h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .hero-card > p:not(.eyebrow) {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .branch-choice {
    min-height: 140px;
  }

  .cart-toast {
    bottom: 78px;
  }

  .customer-profile-copy {
    min-width: 0;
  }

  .customer-profile-copy h1 {
    font-size: 1.65rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .admin-dashboard {
    width: 100%;
    min-width: 0;
  }

  .admin-dashboard .topbar,
  .admin-dashboard .admin-shell {
    width: 100%;
  }
}

@media (max-width: 900px) {
  body:has(.admin-shell) .mobile-module-drawer {
    right: 0;
    bottom: 58px;
    left: 0;
    align-items: flex-end;
    padding: 0;
    background: rgba(15, 23, 42, 0.32);
  }

  body:has(.admin-shell) .mobile-module-panel {
    width: 100%;
    max-width: none;
    max-height: min(78vh, 620px);
    overflow-y: auto;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 34px rgba(18, 63, 53, 0.2);
  }

  body:has(.admin-shell) .mobile-module-heading {
    position: sticky;
    top: -18px;
    z-index: 1;
    min-height: 42px;
    margin: -18px -14px 14px;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #edf0ee;
  }

  body:has(.admin-shell) .mobile-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body:has(.admin-shell) .mobile-module-grid a {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 14px;
    background: #f8fbfa;
    color: #173f35;
    font-size: 0.84rem;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
  }

  body:has(.admin-shell) .mobile-module-grid a:nth-child(-n + 5) {
    border-color: #cde5da;
    background: #eff9f3;
    color: #176044;
  }

  body:has(.admin-shell) .mobile-module-grid a:active,
  body:has(.admin-shell) .mobile-module-grid a:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
  }
}

@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  body:has(.admin-shell) {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  body:has(.admin-shell) > .topbar {
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 10px 12px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  body:has(.admin-shell) > .topbar .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }

  body:has(.admin-shell) > .topbar .brand > div {
    min-width: 0;
  }

  body:has(.admin-shell) > .topbar .brand strong,
  body:has(.admin-shell) > .topbar .brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:has(.admin-shell) > .topbar nav {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 5px;
  }

  body:has(.admin-shell) > .topbar nav .welcome {
    display: none;
  }

  body:has(.admin-shell) > .topbar nav a,
  body:has(.admin-shell) > .topbar nav button {
    padding: 8px 9px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  body:has(.admin-shell) .admin-shell {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 16px 12px 78px;
  }

  body:has(.admin-shell) .admin-content {
    display: grid;
    width: 100%;
    max-width: none;
    gap: 14px;
  }

  body:has(.admin-shell) .admin-content > .dashboard-heading,
  body:has(.admin-shell) .admin-content > .card,
  body:has(.admin-shell) .admin-content > .metric-grid,
  body:has(.admin-shell) .admin-content > .dashboard-grid {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body:has(.admin-shell) .admin-content > .card {
    padding: 16px;
    border-radius: 16px;
  }

  body:has(.admin-shell) .admin-content h1 {
    margin: 0 0 8px;
    font-size: clamp(1.65rem, 8vw, 2.15rem);
    line-height: 1.2;
  }

  body:has(.admin-shell) .admin-content .dashboard-heading p {
    margin: 0 0 10px;
    line-height: 1.45;
  }

  body:has(.admin-shell) .admin-content .dashboard-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:has(.admin-shell) .admin-content .dashboard-actions .button,
  body:has(.admin-shell) .admin-content .dashboard-actions form,
  body:has(.admin-shell) .admin-content .dashboard-actions form .button {
    width: 100%;
    min-width: 0;
    margin: 0;
    text-align: center;
  }

  body:has(.admin-shell) .admin-content .metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body:has(.admin-shell) .admin-content .metric {
    min-width: 0;
    padding: 16px;
  }

  body:has(.admin-shell) .admin-content .metric strong {
    overflow-wrap: anywhere;
    font-size: 1.45rem;
  }

  body:has(.admin-shell) .admin-content .order-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:has(.admin-shell) .admin-content .order-status-row {
    min-width: 0;
    min-height: 92px;
    padding: 12px 6px;
  }

  body:has(.admin-shell) .admin-content .admin-filter-form {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body:has(.admin-shell) .admin-content .admin-filter-form > *,
  body:has(.admin-shell) .admin-content .admin-filter-form label,
  body:has(.admin-shell) .admin-content .admin-filter-form input,
  body:has(.admin-shell) .admin-content .admin-filter-form select,
  body:has(.admin-shell) .admin-content .admin-filter-form .button {
    width: 100%;
    min-width: 0;
    grid-column: auto;
  }

  body:has(.admin-shell) .admin-content .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:has(.admin-shell) .admin-content table {
    min-width: 560px;
  }
}
