/* Base Typography - Mobile First */
html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Custom Slim Scrollbar for all pages */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #667eea rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

/* Page container for non-landing pages */
main:not(:has(.hero-gradient)) {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

main:not(:has(.hero-gradient)) > *:not(.hero-gradient):not(.features-section):not(.how-it-works-section):not(.cta-section) {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* Focus States */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-control:focus,
.form-select:focus {
  box-shadow: none;
  border-color: #ced4da;
}

/* Responsive Tables */
.table-responsive-custom {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
  .table-responsive-mobile {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive-mobile table {
    min-width: 600px;
  }
}

/* Card Responsiveness */
.card {
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.card-body {
  padding: 1rem;
}

@media (min-width: 768px) {
  .card-body {
    padding: 1.5rem;
  }
}

/* Shopkeeper Report Filters */
.report-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
}

.report-filter-pane-desktop-toggle-wrap {
  display: none;
}

.report-filter-desktop-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.report-filter-desktop-toggle .report-filter-expand-icon {
  display: none;
}

.report-filter-desktop-toggle.collapsed .report-filter-collapse-icon {
  display: none;
}

.report-filter-desktop-toggle.collapsed .report-filter-expand-icon {
  display: inline-block;
}

.report-filter-desktop-collapse {
  display: block;
}

@media (min-width: 992px) {
  .report-page-layout {
    grid-template-columns: 1fr 18rem;
    gap: 1.5rem;
    transition: grid-template-columns 0.8s cubic-bezier(.22, 1, .36, 1), gap 0.8s cubic-bezier(.22, 1, .36, 1);
  }

  .report-page-layout.report-page-layout-collapsed {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.report-list-section {
  order: 1;
}

@media (min-width: 992px) {
  .report-list-section {
    order: 0;
  }
}

.report-sidebar {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  order: 2;
  position: sticky;
  top: 1rem;
  height: fit-content;
  min-width: 0;
}

@media (min-width: 992px) {
  .report-sidebar {
    display: flex;
    order: 2;
    overflow: hidden;
    width: 100%;
    max-width: 18rem;
    transition: max-width 0.8s cubic-bezier(.22, 1, .36, 1);
  }

  .report-filter-pane-desktop-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 2.35rem;
    margin-bottom: 0.55rem;
    flex: 0 0 2.35rem;
  }

  .report-filter-desktop-toggle {
    display: inline-flex;
    flex: 0 0 2.35rem;
  }

  .report-filter-desktop-collapse {
    display: block !important;
    height: auto !important;
    overflow: visible;
  }

  .report-filter-desktop-collapse > * {
    transform: translateX(0);
    opacity: 1;
    transform-origin: right center;
    transition: transform 0.8s cubic-bezier(.22, 1, .36, 1), opacity 0.55s ease;
    will-change: transform, opacity;
  }

  .report-page-layout.report-page-layout-collapsed .report-sidebar {
    width: auto;
    max-width: 2.35rem;
  }

  .report-page-layout.report-page-layout-collapsed .report-filter-desktop-collapse > * {
    transform: translateX(1.1rem);
    opacity: 0;
    pointer-events: none;
  }

  .report-page-layout.report-page-layout-collapsed .report-filter-pane-desktop-toggle-wrap {
    margin-bottom: 0.55rem;
  }

  .report-filter-desktop-collapse.collapsing {
    display: block !important;
    height: auto !important;
    overflow: visible;
    transition: none !important;
  }

  .report-filter-desktop-collapse.collapse:not(.show) {
    display: block !important;
    visibility: visible !important;
  }
}

.report-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.report-filter-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
}

.report-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.report-filter-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.report-filter-actions {
  display: grid;
  gap: 0.5rem;
}

.report-filter-actions .btn {
  width: 100%;
  min-height: 2.7rem;
  border-radius: 0.7rem;
}

.report-sidebar [data-report-filter-form],
#reportAdvancedSearchPanel [data-report-filter-form] {
  gap: 0.75rem !important;
}

.report-sidebar .form-control,
.report-sidebar .form-select,
#reportAdvancedSearchPanel .form-control,
#reportAdvancedSearchPanel .form-select {
  min-height: 2.25rem;
}

#reportAdvancedSearchPanel {
  width: min(92vw, 28rem);
  z-index: 1205 !important;
}

#reportAdvancedSearchPanel.offcanvas,
#reportAdvancedSearchPanel.offcanvas.offcanvas-start {
  position: fixed;
  left: 0;
  right: auto;
  bottom: 0;
  max-width: 100%;
  transform: translateX(-100%);
}

#reportAdvancedSearchPanel.offcanvas.show,
#reportAdvancedSearchPanel.offcanvas.showing {
  transform: none;
}

#reportAdvancedSearchPanel .offcanvas-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

#reportAdvancedSearchPanel [data-report-filter-form] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.report-mobile-pane-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  overflow: hidden;
}

/* Button Groups - Stack on Mobile */
@media (max-width: 575.98px) {
  .btn-group-responsive {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-group-responsive .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Responsive Spacing */
@media (max-width: 575.98px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  h1, .h1 {
    font-size: 1.75rem;
  }

  h2, .h2 {
    font-size: 1.5rem;
  }

  h3, .h3 {
    font-size: 1.25rem;
  }

  h4, .h4 {
    font-size: 1.1rem;
  }
}

/* Dashboard Stats Cards */
.stats-card {
  margin-bottom: 1rem;
  transition: transform 0.2s;
}

.stats-card:hover {
  transform: translateY(-5px);
}

@media (max-width: 767.98px) {
  .stats-card {
    margin-bottom: 1rem;
  }
}

/* Form Controls */
.form-control, .form-select {
  font-size: 1rem;
}

@media (max-width: 575.98px) {
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  textarea,
  select {
    font-size: 16px;
  }
}

/* Navbar Improvements */
@media (max-width: 575.98px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .navbar-nav {
    margin-top: 0.5rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0;
  }
}

/* Modal Responsiveness */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem;
  }
}

/* ========================================
   LANDING PAGE STYLES - MOBILE FIRST
   ======================================== */

.landing-page {
  background: #f6f8ff;
}

.hero-gradient {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #3c5cff 0%, #7a32d4 55%, #121f6f 100%);
}

.hero-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.18), transparent 38%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.16), transparent 40%);
}

.hero-gradient .container {
  position: relative;
  z-index: 1;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.landing-title {
  font-size: 2rem;
  line-height: 1.12;
  font-weight: 800;
}

.landing-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.landing-stats {
  display: grid;
  gap: 0.75rem;
}

.landing-stat-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  backdrop-filter: blur(6px);
}

.landing-stat-item strong {
  font-size: 0.95rem;
}

.landing-stat-item span {
  font-size: 0.8rem;
  opacity: 0.9;
}

.landing-cta-group {
  display: grid;
  gap: 0.7rem;
}

.landing-cta-primary,
.landing-cta-secondary {
  width: 100%;
  border-radius: 12px;
  font-weight: 700;
}

.landing-preview-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 0 20px 45px rgba(11, 22, 84, 0.35);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #26337a;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16c47f;
  box-shadow: 0 0 0 6px rgba(22, 196, 127, 0.16);
}

.preview-metric h3 {
  margin: 0;
  font-size: 2rem;
  color: #1f2e7c;
}

.preview-metric p {
  margin: 0.25rem 0 0.9rem;
  color: #5f6790;
}

.preview-list div {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #26337a;
  font-size: 0.92rem;
  padding: 0.35rem 0;
}

.preview-list i {
  color: #20c997;
}

.landing-trust {
  margin-top: -1.2rem;
}

.trust-tile {
  background: #fff;
  border: 1px solid #e9edff;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  color: #34418b;
  padding: 0.85rem 0.6rem;
  box-shadow: 0 8px 20px rgba(39, 52, 122, 0.08);
}

.features-section,
.how-it-works-section {
  background: transparent;
}

.landing-section-title {
  font-weight: 800;
  color: #212a63;
}

.online-store-highlight {
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  border: 1px solid #dbe4ff;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(50, 70, 160, 0.12);
}

.online-store-highlight-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1d4ed8, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.online-store-highlight h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1f2b70;
}

.online-store-highlight p {
  color: #5f6b9a;
}

.feature-card,
.step-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8edff;
  box-shadow: 0 10px 24px rgba(35, 48, 110, 0.08);
  padding: 1.15rem;
  height: 100%;
}

.feature-card h4,
.step-card h5 {
  color: #1f2b70;
  margin-top: 0.9rem;
  margin-bottom: 0.45rem;
}

.feature-card p,
.step-card p {
  color: #616b98;
  margin-bottom: 0;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.2rem;
}

.icon-gradient-1 {
  background: linear-gradient(145deg, #3f5dff, #7a36d9);
}

.icon-gradient-2 {
  background: linear-gradient(145deg, #ef4444, #f97316);
}

.icon-gradient-3 {
  background: linear-gradient(145deg, #0ea5e9, #22c55e);
}

.step-card {
  position: relative;
  padding-top: 2rem;
}

.step-number {
  position: absolute;
  top: -0.8rem;
  left: 1rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #4f46e5;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}

.cta-section {
  background: linear-gradient(130deg, #1f3bb3 0%, #7e2ad3 100%);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.2), transparent 40%);
  pointer-events: none;
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .landing-title {
    font-size: 2.8rem;
  }

  .landing-subtitle {
    font-size: 1.08rem;
  }

  .landing-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-cta-group {
    display: flex;
    flex-wrap: wrap;
  }

  .landing-cta-primary,
  .landing-cta-secondary {
    width: auto;
    min-width: 180px;
  }

  .landing-preview-card {
    padding: 1.4rem;
  }

  .landing-trust {
    margin-top: -1.6rem;
  }

  .online-store-highlight {
    padding: 1.3rem 1.4rem;
  }

  .online-store-highlight h3 {
    font-size: 1.3rem;
  }

  .feature-card,
  .step-card {
    padding: 1.5rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Icon from Bootstrap Icons */
.bi {
  vertical-align: middle;
}

/* Badge Adjustments */
.badge {
  font-size: 0.85em;
  padding: 0.35em 0.65em;
}

/* Scratch Card Specific */
.scratch-card {
  max-width: 500px;
  margin: 20px auto;
  padding: 20px;
}

@media (max-width: 575.98px) {
  .scratch-card {
    margin: 10px;
    padding: 15px;
    max-width: 100%;
  }
}

/* QR Code Container */
.qr-code-container {
  max-width: 400px;
  margin: 0 auto;
}

@media (max-width: 575.98px) {
  .qr-code-container {
    max-width: 100%;
  }

  .qr-code-container img {
    max-width: 280px;
    height: auto;
  }
}

/* Modal Z-Index Fix - Ensures modals appear above backdrop */
.modal {
  z-index: 1056;
}

.modal-backdrop {
  z-index: 1040;
}

.modal-dialog {
    z-index: 1055;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

@media (max-width: 575.98px) {
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 767.98px) {
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    margin: 0;
    padding: 20px;
  }
}

/* Touch-Friendly Targets */
@media (max-width: 767.98px) {
  .btn {
    /*min-height: 44px;*/
    min-width: 44px;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Improved Table on Mobile */
@media (max-width: 767.98px) {
  .table-sm-responsive {
    font-size: 0.875rem;
  }

  .table-sm-responsive th,
  .table-sm-responsive td {
    padding: 0.5rem 0.25rem;
  }
}

/* Utilities for Mobile */
@media (max-width: 767.98px) {
  .mobile-center {
    text-align: center !important;
  }

  .mobile-hide {
    display: none !important;
  }

  .mobile-show {
    display: block !important;
  }

  .mobile-full-width {
    width: 100% !important;
  }
}

/* Global Postback Loader */
.app-loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 35, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
}

.app-loader-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-loader-shell {
  min-width: 150px;
  padding: 1rem 1.1rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(102, 126, 234, 0.16);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.app-loader-spinner {
  width: 44px;
  height: 44px;
  display: inline-block;
  border-radius: 50%;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  animation: appLoaderSpin 0.8s linear infinite;
}

.app-loader-text {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

@keyframes appLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader-overlay {
    transition: none;
  }

  .app-loader-spinner {
    animation-duration: 1.5s;
  }
}

.shopkeeper-standard-add-btn {
  min-height: 2.75rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.9rem !important;
  border-radius: 0.65rem;
  font-weight: 600;
  line-height: 1;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

.shopkeeper-standard-add-btn i,
.shopkeeper-standard-add-btn span {
  color: #fff !important;
}


}