/* ComKey POS final UI audit layer. Loaded last to normalize shared screens. */
:root {
  --ck-ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ck-ui-display: Outfit, "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  --ck-ui-bg: #f6f8fb;
  --ck-ui-surface: #ffffff;
  --ck-ui-soft: #f8fafc;
  --ck-ui-line: #e5edf4;
  --ck-ui-line-strong: #d7e1ea;
  --ck-ui-text: #0f172a;
  --ck-ui-muted: #64748b;
  --ck-ui-subtle: #94a3b8;
  --ck-ui-primary: #14532d;
  --ck-ui-primary-600: #166534;
  --ck-ui-primary-soft: #ecfdf3;
  --ck-ui-accent: #d68a16;
  --ck-ui-accent-soft: #fff7e6;
  --ck-ui-danger: #b91c1c;
  --ck-ui-danger-soft: #fef2f2;
  --ck-ui-radius-sm: .55rem;
  --ck-ui-radius: .75rem;
  --ck-ui-radius-lg: .95rem;
  --ck-ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --ck-ui-shadow-sm: 0 10px 28px rgba(15, 23, 42, .07);
  --ck-ui-ring: 0 0 0 4px rgba(20, 83, 45, .14);
}

html {
  background: var(--ck-ui-bg);
  color: var(--ck-ui-text);
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  background: var(--ck-ui-bg);
  color: var(--ck-ui-text);
  font-family: var(--ck-ui-font);
  letter-spacing: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, svg, video, canvas {
  max-width: 100%;
}

h1, h2, h3, h4,
.ck-login-card-head h2,
.ck-register-heading h1,
.tenant-dashboard-hero h1,
.pos-terminal-title-row h1,
.pos-cart-header h2,
.doc-hero h1,
.doc-detail-number,
.superadmin-shell main > header h1 {
  font-family: var(--ck-ui-display);
  letter-spacing: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 0 !important;
  box-shadow: var(--ck-ui-ring) !important;
}

:where(button, input, select, textarea) {
  font: inherit;
}

:where(button, [role="button"], input, select, textarea, .ck-btn, .doc-quick-btn, .doc-action-btn) {
  touch-action: manipulation;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  max-width: 100%;
  min-height: 2.65rem;
}

:where(.ck-btn, .ck-btn-primary, .ck-btn-gold, .ck-primary-button, .ck-secondary-button, .ck-launch-button,
.doc-quick-btn, .doc-action-btn, .doc-filter-btn, .doc-filter-reset, .doc-filter-new-btn,
.pos-terminal-actions a, .pos-checkout-button, .pos-method-button, .superadmin-shell button, .superadmin-shell .ck-btn) {
  align-items: center;
  border-radius: var(--ck-ui-radius) !important;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0 !important;
  min-height: 2.65rem;
}

.ck-btn-primary,
.ck-primary-button,
.pos-checkout-button,
.doc-filter-btn,
.doc-filter-new-btn {
  background: var(--ck-ui-primary) !important;
  color: #fff !important;
}

.ck-btn-primary:hover,
.ck-primary-button:hover,
.pos-checkout-button:hover,
.doc-filter-btn:hover,
.doc-filter-new-btn:hover {
  background: var(--ck-ui-primary-600) !important;
  transform: translateY(-1px);
}

.ck-btn-gold,
.ck-launch-button {
  background: linear-gradient(135deg, #f3ad2e, var(--ck-ui-accent)) !important;
  color: #111827 !important;
}

.tenant-main main[data-app-content],
.content-area > .flex-1 {
  width: 100%;
  max-width: 100%;
}

.tenant-main main[data-app-content] > *,
.content-area > .flex-1 > * {
  max-width: 100%;
}

.tenant-main > header {
  min-width: 0;
}

.tenant-main > header > *,
.tenant-main > header form,
.tenant-main > header select {
  min-width: 0;
}

.tenant-nav-link i,
.tenant-nav-link svg,
.superadmin-shell .sidebar nav svg {
  flex: 0 0 auto;
  height: 1.05rem !important;
  width: 1.05rem !important;
}

.tenant-nav-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.ck-card, .tenant-dashboard-hero, .tenant-dashboard-subscription, .doc-section-card, .doc-aside-card,
.doc-table-card, .doc-stat-card, .prod-setup-disclosure, .pos-products-panel, .pos-cart-panel,
.dataTables_wrapper) {
  border-color: var(--ck-ui-line) !important;
  border-radius: var(--ck-ui-radius-lg) !important;
  box-shadow: var(--ck-ui-shadow-xs) !important;
}

:where(.ck-card, .doc-section-card, .doc-aside-card, .doc-table-card, .doc-stat-card, .dataTables_wrapper) {
  background: var(--ck-ui-surface) !important;
}

.dataTables_wrapper {
  overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin: .25rem 0;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  margin-left: .4rem;
}

table,
.dataTables_wrapper table,
.doc-table,
.superadmin-shell table {
  width: 100%;
}

:where(.dataTables_wrapper, .doc-table-wrap, .super-dashboard-table-wrap, .super-tenants-table-wrap,
.super-users-table-wrap, .super-billing-table-wrap, .super-settings-table-wrap, .super-ops-table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table th,
table td {
  overflow-wrap: anywhere;
}

table thead th {
  white-space: nowrap;
}

.doc-page,
.doc-detail-page,
.pos-shell {
  min-width: 0;
}

.doc-page .doc-hero,
.doc-detail-hero,
.pos-terminal-title-row,
.pos-cart-header,
.tenant-dashboard-hero,
.super-dashboard-hero,
.super-tenants-hero,
.super-users-hero,
.super-billing-hero,
.super-settings-hero,
.super-ops-hero {
  gap: 1rem;
}

.doc-page .doc-hero-actions,
.doc-detail-hero-actions,
.pos-terminal-actions {
  min-width: 0;
}

.doc-page .doc-quick-btn,
.doc-detail-hero-actions > *,
.pos-terminal-actions a {
  min-width: 0;
  white-space: normal;
}

.doc-modal-backdrop,
.pos-payment-overlay {
  padding: 1rem;
}

.doc-modal,
.pos-payment-modal,
.swal2-popup {
  max-width: calc(100vw - 2rem) !important;
}

.pos-shell {
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 27rem);
}

.pos-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(9.75rem, 1fr));
}

.pos-product-card {
  min-width: 0;
}

.pos-product-name,
.pos-product-card strong,
.pos-cart-item strong {
  overflow-wrap: anywhere;
}

.pos-cart-panel,
.pos-products-panel {
  min-width: 0;
}

/* POS order controls. Resume must remain available when the cart is empty. */
.pos-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}

.pos-hold-btn,
.pos-resume-btn {
  gap: .45rem;
  min-width: 0;
  min-height: 2.85rem !important;
  border-radius: var(--ck-ui-radius) !important;
  padding: .65rem .8rem !important;
  font-size: .84rem !important;
  font-weight: 850 !important;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.pos-hold-btn svg,
.pos-resume-btn svg {
  flex: 0 0 auto;
  height: 1rem !important;
  width: 1rem !important;
}

.pos-hold-btn span,
.pos-resume-btn span {
  min-width: 0;
}

.pos-hold-btn {
  background: #fff7ed !important;
  border-color: #fed7aa !important;
  color: #9a3412 !important;
}

.pos-hold-btn:hover:not(:disabled) {
  background: #ffedd5 !important;
  border-color: #fdba74 !important;
  color: #7c2d12 !important;
}

.pos-resume-btn {
  background: var(--ck-ui-primary-soft) !important;
  border-color: rgba(20, 83, 45, .24) !important;
  color: var(--ck-ui-primary) !important;
}

.pos-resume-btn:hover {
  background: #dcfce7 !important;
  border-color: rgba(20, 83, 45, .38) !important;
  color: #052e16 !important;
}

.pos-hold-btn:disabled {
  background: #f8fafc !important;
  border-color: var(--ck-ui-line) !important;
  color: var(--ck-ui-subtle) !important;
  cursor: not-allowed;
  opacity: 1;
}

.swal2-popup .swal2-select#heldSel {
  width: 100%;
  max-width: 100%;
  min-height: 3rem;
  margin: .75rem 0 0;
  border: 1px solid var(--ck-ui-line-strong);
  border-radius: var(--ck-ui-radius);
  color: var(--ck-ui-text);
  font-weight: 700;
}

.ck-login-page,
.ck-register-page {
  background: var(--ck-ui-bg);
}

.ck-login-shell,
.ck-register-shell {
  width: min(100% - 2rem, 76rem);
}

.ck-login-card,
.ck-register-card,
.ck-login-story,
.ck-register-aside {
  border-radius: var(--ck-ui-radius-lg) !important;
}

.ck-login-input,
.ck-field input,
.ck-field select,
.ck-field textarea,
.ck-register-card input,
.ck-register-card select,
.ck-register-card textarea {
  min-width: 0;
}

.ck-login-stepper,
.ck-register-progress,
.ck-plan-grid,
.ck-register-grid {
  min-width: 0;
}

.superadmin-shell {
  min-width: 320px;
}

.superadmin-shell .content-area {
  min-width: 0;
}

.superadmin-shell .sidebar nav a {
  align-items: center;
  border-radius: var(--ck-ui-radius-sm) !important;
  display: flex;
  gap: .55rem;
  min-height: 2.55rem;
}

.superadmin-shell .sidebar nav a svg {
  margin-right: 0 !important;
}

.superadmin-shell .card,
.superadmin-shell :is(.super-dashboard-card, .super-tenants-card, .super-users-card, .super-billing-card,
.super-settings-card, .super-ops-card) {
  border-radius: var(--ck-ui-radius-lg) !important;
  overflow: hidden;
}

.superadmin-shell :is(input, select, textarea) {
  border-radius: var(--ck-ui-radius-sm) !important;
  min-height: 2.55rem;
}

.ck-trial-banner {
  flex-wrap: wrap;
}

.ck-trial-banner-text {
  min-width: 12rem;
}

/* Dashboard-only balance pass: prevents the chart card from stretching into a
   large empty panel when the Keylite AI card has more content. */
.tenant-dashboard-page {
  gap: 1rem;
}

.tenant-dashboard-insights {
  align-items: start !important;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 30rem) !important;
}

.tenant-dashboard-chart-card {
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tenant-dashboard-chart {
  height: clamp(18rem, 28vw, 23rem) !important;
  min-height: 18rem;
  padding: .85rem 1rem 1rem !important;
}

.tenant-dashboard-chart canvas {
  display: block;
  height: 100% !important;
  max-height: 100%;
  width: 100% !important;
}

.tenant-dashboard-ai-card {
  align-self: start;
  max-height: clamp(30rem, 72vh, 39rem);
  overflow-y: auto !important;
  scrollbar-color: rgba(244, 166, 35, .42) rgba(255, 255, 255, .08);
}

.tenant-dashboard-ai-card::-webkit-scrollbar {
  width: .45rem;
}

.tenant-dashboard-ai-card::-webkit-scrollbar-thumb {
  background: rgba(244, 166, 35, .42);
  border-radius: 999px;
}

.tenant-dashboard-ai-body {
  flex: 0 0 auto !important;
  margin: .85rem 0 .75rem !important;
}

.tenant-dashboard-card-head {
  min-height: 4.25rem;
}

.tenant-dashboard-card-head > div {
  min-width: 0;
}

.tenant-dashboard-card-head h2 {
  line-height: 1.15;
}

.tenant-dashboard-card-head a {
  flex: 0 0 auto;
}

.ck-ai-dark-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ck-ai-dark-kpi,
.ck-ai-dark-list li,
.ck-ai-dark-forecast li {
  min-width: 0;
}

.ck-ai-dark-list li span,
.ck-ai-dark-forecast li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Products page polish pass. Kept under tenant-products-* to avoid touching
   inventory, POS, dashboard, or documents layouts. */
.tenant-products-page {
  gap: 1rem;
  min-width: 0;
}

.tenant-products-hero,
.tenant-products-card,
.tenant-products-import,
.tenant-products-metrics article,
.tenant-products-metric-link {
  min-width: 0;
}

.tenant-products-hero {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem) !important;
}

.tenant-products-hero h1 {
  max-width: 42rem;
  text-wrap: balance;
}

.tenant-products-hero p:not(.tenant-products-kicker) {
  max-width: 50rem;
}

.tenant-products-hero aside strong,
.tenant-products-metrics strong {
  overflow-wrap: anywhere;
}

.tenant-products-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.tenant-products-metrics article,
.tenant-products-metric-link {
  border-radius: var(--ck-ui-radius-lg) !important;
  box-shadow: var(--ck-ui-shadow-xs) !important;
}

.prod-setup-disclosure,
.tenant-products-card,
.tenant-products-import {
  border-color: var(--ck-ui-line) !important;
  border-radius: var(--ck-ui-radius-lg) !important;
  box-shadow: var(--ck-ui-shadow-xs) !important;
}

.prod-setup-disclosure {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  overflow: clip;
}

.prod-setup-summary {
  align-items: center;
  background: #fff;
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: .75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  list-style: none;
  min-height: 4.65rem;
  padding: .85rem 1rem;
  text-align: left;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
  width: 100%;
}

.prod-setup-summary::-webkit-details-marker {
  display: none;
}

.prod-setup-summary:hover {
  background: var(--ck-ui-soft);
  border-color: var(--ck-ui-line);
}

.prod-setup-summary[aria-expanded="true"] {
  border-bottom-color: var(--ck-ui-line);
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .02);
}

.prod-setup-summary-icon,
.prod-setup-summary-caret {
  align-items: center;
  border-radius: var(--ck-ui-radius);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.6rem;
  justify-content: center;
  width: 2.6rem;
}

.prod-setup-summary-icon {
  background: var(--ck-ui-primary-soft);
  color: var(--ck-ui-primary);
}

.prod-setup-summary-caret {
  background: #f8fafc;
  border: 1px solid var(--ck-ui-line);
  color: var(--ck-ui-muted);
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.prod-setup-summary[aria-expanded="true"] .prod-setup-summary-caret {
  background: var(--ck-ui-primary);
  color: #fff;
  transform: rotate(180deg);
}

.prod-setup-summary svg {
  height: 1.1rem;
  width: 1.1rem;
}

.prod-setup-summary > span:nth-child(2),
.prod-setup-summary > span:nth-child(2) strong,
.prod-setup-summary > span:nth-child(2) small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-setup-summary > span:nth-child(2) strong {
  color: var(--ck-ui-text);
  font-size: .98rem;
  font-weight: 900;
}

.prod-setup-summary > span:nth-child(2) small {
  color: var(--ck-ui-muted);
  font-size: .78rem;
  font-weight: 700;
  margin-top: .12rem;
}

.prod-setup-body {
  animation: ckMenuReveal .18s ease-out;
  padding: 1rem;
}

@keyframes ckMenuReveal {
  from {
    opacity: 0;
    transform: translateY(-.35rem);
  }

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

.prod-setup-action-menu {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.prod-setup-action-menu a {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--ck-ui-line);
  border-radius: var(--ck-ui-radius);
  color: var(--ck-ui-text);
  display: grid;
  gap: .35rem;
  min-height: 7rem;
  padding: .9rem;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.prod-setup-action-menu a:hover {
  background: #fafffc;
  border-color: rgba(20, 83, 45, .28);
  box-shadow: var(--ck-ui-shadow-sm);
  transform: translateY(-1px);
}

.prod-setup-action-menu a:active {
  transform: translateY(0);
}

.prod-setup-action-menu a > span {
  align-items: center;
  background: var(--ck-ui-primary-soft);
  border-radius: var(--ck-ui-radius-sm);
  color: var(--ck-ui-primary);
  display: inline-flex;
  height: 2.2rem;
  justify-content: center;
  width: 2.2rem;
}

.prod-setup-action-menu a:nth-child(3) > span {
  background: var(--ck-ui-accent-soft);
  color: #9a5b09;
}

.prod-setup-action-menu a:nth-child(4) > span {
  background: var(--ck-ui-danger-soft);
  color: var(--ck-ui-danger);
}

.prod-setup-action-menu svg {
  height: 1rem;
  width: 1rem;
}

.prod-setup-action-menu strong,
.prod-setup-action-menu small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prod-setup-action-menu strong {
  color: var(--ck-ui-text);
  font-size: .9rem;
  font-weight: 900;
  line-height: 1.15;
}

.prod-setup-action-menu small {
  color: var(--ck-ui-muted);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
}

.tenant-products-create-grid {
  grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr) !important;
  align-items: start;
}

.tenant-products-card-head {
  min-height: 4.25rem;
}

.tenant-products-card-head > div,
.tenant-products-import > div,
.tenant-products-filterbar label {
  min-width: 0;
}

.tenant-products-card-head h2,
.tenant-products-import h2 {
  line-height: 1.15;
}

.tenant-products-card-head > span,
.tenant-products-card-head > button,
.tenant-products-card-head > a {
  flex: 0 0 auto;
}

.tenant-products-form label,
.tenant-products-filterbar label {
  color: var(--ck-ui-muted);
  font-size: .8rem;
  font-weight: 800;
}

.tenant-products-form input,
.tenant-products-form select,
.tenant-products-form textarea,
.tenant-products-filterbar input,
.tenant-products-filterbar select,
.tenant-products-import-actions input,
.tenant-products-import-actions select {
  min-width: 0;
}

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

.tenant-products-variant-row {
  grid-template-columns: minmax(10rem, 1.15fr) minmax(8rem, 1fr) repeat(3, minmax(6.5rem, .8fr)) !important;
  overflow-x: auto;
  padding-bottom: .15rem;
}

.tenant-products-secondary,
.tenant-products-form .ck-btn,
.tenant-products-filter-actions button,
.tenant-products-filter-actions a,
.tenant-products-import-actions a,
.tenant-products-import-actions button {
  min-height: 2.55rem;
}

.tenant-products-filterbar {
  grid-template-columns: minmax(16rem, 1.5fr) repeat(5, minmax(8.75rem, 1fr)) !important;
  gap: .75rem !important;
  padding: 1rem;
}

.tenant-products-search-box {
  min-width: 0;
}

.tenant-products-search-box input {
  min-width: 0;
  width: 100%;
}

.tenant-products-filter-actions {
  align-items: center;
  gap: .55rem !important;
}

.tenant-products-filter-actions a,
.tenant-products-filter-actions button {
  white-space: nowrap;
}

.tenant-products-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tenant-products-table {
  min-width: 58rem;
  table-layout: auto;
}

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

.tenant-products-table td:nth-child(2) {
  min-width: 13rem;
}

.tenant-products-table td:nth-child(2) strong,
.tenant-products-table code {
  overflow-wrap: anywhere;
}

.tenant-products-thumb {
  aspect-ratio: 1;
  object-fit: cover;
}

.tenant-products-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  min-width: max-content;
  white-space: normal !important;
}

.tenant-products-row-actions button,
.tenant-products-row-actions a {
  margin-right: 0 !important;
  min-height: 2.15rem;
  border: 1px solid var(--ck-ui-line);
  border-radius: var(--ck-ui-radius-sm);
  background: #fff;
  padding: .4rem .6rem;
  text-decoration: none !important;
}

.tenant-products-import {
  align-items: flex-start;
}

.tenant-products-import-actions,
.tenant-products-import-actions form {
  min-width: 0;
}

.tenant-products-import-actions form {
  align-items: center;
}

.tenant-products-import-actions input[type="file"] {
  max-width: 18rem;
}

.tenant-products-pagination {
  gap: .75rem;
  padding: 1rem;
}

.tenant-products-pagination > div {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tenant-products-pagination a,
.tenant-products-pagination strong {
  align-items: center;
  border-radius: var(--ck-ui-radius-sm);
  display: inline-flex;
  min-height: 2.25rem;
  padding: .4rem .65rem;
}

.tenant-products-modal {
  padding: 1rem;
}

.tenant-products-modal-shell {
  max-width: calc(100vw - 2rem);
}

.tenant-products-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.tenant-products-image-edit {
  min-width: 0;
}

@media (max-width: 1180px) {
  .pos-shell {
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  }

  .tenant-dashboard-insights {
    grid-template-columns: 1fr !important;
  }

  .tenant-dashboard-ai-card {
    max-height: none;
  }

  .tenant-products-hero,
  .tenant-products-create-grid {
    grid-template-columns: 1fr !important;
  }

  .prod-setup-action-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-products-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .tenant-products-filterbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .tenant-products-search-label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1023px) {
  .tenant-main main[data-app-content] {
    padding: .9rem !important;
  }

  .tenant-sidebar {
    width: min(18rem, 88vw) !important;
  }

  .pos-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .pos-products-panel,
  .pos-cart-panel {
    max-height: none;
  }

  .pos-cart-panel {
    position: static;
  }

  .pos-order-actions {
    position: sticky;
    bottom: 4.75rem;
    z-index: 3;
    border: 1px solid var(--ck-ui-line);
    border-radius: var(--ck-ui-radius-lg);
    background: rgba(255, 255, 255, .94);
    padding: .55rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
    backdrop-filter: blur(12px);
  }

  .superadmin-shell {
    height: auto !important;
    min-height: 100vh;
    overflow: auto !important;
  }
}

@media (max-width: 760px) {
  .ck-login-shell,
  .ck-register-shell {
    width: min(100% - 1rem, 42rem);
  }

  .ck-login-story,
  .ck-register-aside {
    display: none !important;
  }

  .ck-login-card,
  .ck-register-card {
    padding: 1rem !important;
  }

  .ck-login-stepper,
  .ck-register-progress {
    overflow-x: auto;
    padding-bottom: .25rem;
  }

  .ck-register-grid,
  .ck-plan-grid,
  .doc-form-row,
  .doc-filter-form {
    grid-template-columns: 1fr !important;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    width: 100%;
  }

  .dataTables_wrapper .dataTables_filter label,
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length label {
    width: 100%;
  }

  .dataTables_wrapper .dataTables_filter input {
    margin: .4rem 0 0 !important;
    min-width: 0;
  }

  .doc-page .doc-hero-actions,
  .doc-detail-hero-actions,
  .pos-terminal-actions {
    grid-template-columns: 1fr !important;
  }

  .doc-page .doc-quick-btn,
  .doc-detail-hero-actions > *,
  .pos-terminal-actions a {
    width: 100%;
  }

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

  .tenant-dashboard-card-head {
    align-items: stretch;
    min-height: 0;
  }

  .tenant-dashboard-card-head a {
    width: 100%;
  }

  .tenant-dashboard-chart {
    height: 18rem !important;
  }

  .ck-ai-dark-kpis {
    grid-template-columns: 1fr;
  }

  .tenant-products-hero {
    padding: 1rem !important;
  }

  .prod-setup-summary {
    min-height: 4.25rem;
    padding: .8rem;
  }

  .prod-setup-summary > span:nth-child(2) small {
    white-space: normal;
  }

  .prod-setup-body {
    padding: .8rem;
  }

  .prod-setup-action-menu {
    grid-template-columns: 1fr;
  }

  .prod-setup-action-menu a {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 4.5rem;
  }

  .prod-setup-action-menu a small {
    grid-column: 2;
  }

  .tenant-products-metrics,
  .tenant-products-filterbar,
  .tenant-products-form-grid,
  .tenant-products-variant-row,
  .tenant-products-image-edit {
    grid-template-columns: 1fr !important;
  }

  .tenant-products-card-head,
  .tenant-products-import {
    align-items: stretch !important;
    flex-direction: column;
    min-height: 0;
  }

  .tenant-products-card-head > button,
  .tenant-products-card-head > a,
  .tenant-products-import-actions,
  .tenant-products-import-actions form,
  .tenant-products-import-actions a,
  .tenant-products-import-actions button,
  .tenant-products-import-actions select,
  .tenant-products-import-actions input,
  .tenant-products-filter-actions,
  .tenant-products-filter-actions a,
  .tenant-products-filter-actions button {
    width: 100%;
  }

  .tenant-products-filter-actions,
  .tenant-products-import-actions,
  .tenant-products-import-actions form {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-products-table {
    min-width: 52rem;
  }

  .tenant-products-modal {
    align-items: flex-end !important;
    padding: 0;
  }

  .tenant-products-modal-shell {
    border-radius: 1rem 1rem 0 0 !important;
    max-height: 94vh;
    max-width: 100vw;
    width: 100% !important;
  }

  .superadmin-shell .sidebar nav {
    gap: .45rem;
  }
}

@media (max-width: 520px) {
  .tenant-main > header {
    align-items: stretch;
    flex-direction: column;
    gap: .55rem;
    height: auto !important;
    padding-bottom: .75rem;
    padding-top: .75rem;
  }

  .tenant-main > header > div {
    width: 100%;
  }

  .ck-trial-banner {
    align-items: stretch;
  }

  .ck-trial-banner-cta {
    width: 100%;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .pos-product-card {
    min-height: 12.5rem;
    padding: .7rem;
  }

  .tenant-products-hero h1 {
    font-size: clamp(1.7rem, 9vw, 2.45rem) !important;
    line-height: 1.05;
  }

  .tenant-products-metrics {
    gap: .65rem;
  }

  .tenant-products-metrics article,
  .tenant-products-metric-link {
    padding: .85rem;
  }

  .tenant-products-pagination {
    align-items: stretch !important;
    flex-direction: column;
  }

  .tenant-products-pagination > div,
  .tenant-products-pagination a,
  .tenant-products-pagination strong {
    justify-content: center;
    width: 100%;
  }

  .pos-search-box input {
    min-height: 2.8rem;
  }

  .doc-modal-backdrop,
  .pos-payment-overlay {
    align-items: flex-end !important;
    padding: 0;
  }

  .doc-modal,
  .pos-payment-modal {
    border-radius: 1rem 1rem 0 0 !important;
    max-height: 94vh;
    max-width: 100vw !important;
    width: 100% !important;
  }

  .superadmin-shell main > header {
    padding: .85rem 1rem !important;
  }

  .superadmin-shell main > header > div {
    flex-wrap: wrap;
    gap: .5rem;
  }
}

@media (max-width: 380px) {
  .pos-product-grid {
    grid-template-columns: 1fr;
  }

  .ck-login-submit,
  .ck-primary-button,
  .ck-secondary-button,
  .ck-launch-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
