/* MobilePro POS Pakistan — shared UI system (cards, forms, tables, badges, alerts) */

:root{
  --mp-sidebar-bg: #0b1220;
  --mp-sidebar-bg-2: #0e1830;
  --mp-sidebar-border: rgba(255,255,255,.08);
  --mp-sidebar-text: rgba(255,255,255,.82);
  --mp-sidebar-muted: rgba(255,255,255,.55);
  --mp-sidebar-hover: rgba(255,255,255,.08);
  --mp-sidebar-active: rgba(59,130,246,.20);
  --mp-content-bg: #f6f7fb;
  --mp-card-shadow: 0 10px 30px rgba(2,6,23,.06);
  --mp-radius: 16px;
  --mp-radius-sm: 12px;
  --mp-radius-xs: 10px;
  --mp-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --mp-text: #0f172a;
  --mp-text-muted: rgba(15,23,42,.58);
  --mp-border: rgba(15,23,42,.09);
  --mp-primary: #2563eb;
  --mp-success: #059669;
  --mp-danger: #dc2626;
  --mp-warning: #d97706;
  --mp-focus-ring: rgba(37,99,235,.22);
}

html{
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body{
  background: var(--mp-content-bg);
  font-family: var(--mp-font-sans);
  color: var(--mp-text);
  line-height: 1.55;
}

/* WhatsApp (wa.me deep links — no API) */
.btn-mp-whatsapp{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  background: linear-gradient(180deg, #25d366, #128c7e) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  color: #fff !important;
  font-weight: 650;
  box-shadow: 0 2px 10px rgba(18, 140, 126, 0.28);
}
.btn-mp-whatsapp:hover,
.btn-mp-whatsapp:focus{
  filter: brightness(1.05);
  color: #fff !important;
}
.btn-mp-whatsapp.disabled,
.btn-mp-whatsapp:disabled{
  opacity: .52 !important;
  pointer-events: none;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.mp-app .dropdown-item.mp-dropdown-wa{
  color: #047857 !important;
  font-weight: 650;
}
.mp-app .dropdown-item.mp-dropdown-wa:hover{
  background: rgba(37, 211, 102, 0.14);
}

.mp-content .h4, .mp-content .h5, .mp-content h4, .mp-content h5{
  letter-spacing: -0.02em;
  color: var(--mp-text);
}

.mp-content .text-secondary{
  color: var(--mp-text-muted) !important;
}

.mp-app{
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.mp-sidebar{
  width: 272px;
  flex: 0 0 272px;
  background: linear-gradient(180deg, var(--mp-sidebar-bg), var(--mp-sidebar-bg-2));
  border-right: 1px solid var(--mp-sidebar-border);
  color: var(--mp-sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.mp-sidebar__brand{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem .75rem 1rem;
  border-bottom: 1px solid var(--mp-sidebar-border);
}

.mp-sidebar__logo{
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(59,130,246,.18);
  color: #cfe4ff;
  font-size: 1.25rem;
}

.mp-sidebar__brand-title{
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.1;
}
.mp-sidebar__brand-subtitle{
  font-size: .8rem;
  color: var(--mp-sidebar-muted);
}

.mp-nav{
  padding: .75rem .5rem 1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.mp-nav__section{
  padding: .75rem .75rem .25rem .75rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mp-sidebar-muted);
}

.mp-nav__link{
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  margin: 0 .25rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--mp-sidebar-text);
  border: 1px solid transparent;
}
.mp-nav__link i{
  width: 18px;
  text-align: center;
  opacity: .95;
}
.mp-nav__link:hover{
  background: var(--mp-sidebar-hover);
  color: #fff;
}
.mp-nav__link--active{
  background: var(--mp-sidebar-active);
  border-color: rgba(59,130,246,.25);
}
.mp-nav__link--danger{
  color: rgba(255,255,255,.78);
}
.mp-nav__link--danger:hover{
  background: rgba(239,68,68,.14);
  color: #fff;
}
.mp-nav__spacer{
  flex: 1;
}

/* Main */
.mp-main{
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
}

.mp-topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15,23,42,.06);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.mp-topbar__banner{
  border-bottom: 1px solid rgba(234,179,8,.35);
}
.mp-topbar__row{
  padding: .75rem 1rem;
}

.mp-topbar__left{
  display: flex;
  align-items: center;
  gap: .75rem;
}
.mp-topbar__title{
  font-weight: 600;
  color: #0f172a;
}

.mp-content{
  padding: 1.25rem clamp(0.85rem, 2vw, 1.5rem);
}

.mp-card{
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  box-shadow: var(--mp-card-shadow);
  overflow: hidden;
  background: #fff;
}

.mp-main .card .card-header{
  padding: 0.85rem 1.15rem;
  font-weight: 650;
  color: var(--mp-text);
}
.mp-main .card .card-body{
  padding: 1rem 1.15rem 1.15rem;
}
.mp-main .card .card-footer{
  padding: 0.85rem 1.15rem;
}

/* Bootstrap polish */
.card .card-header,
.card .card-footer{
  background: rgba(248,250,252,.94);
  border-color: var(--mp-border);
}

.card.mp-card .card-header.bg-transparent{
  background: transparent !important;
}

.btn{
  border-radius: var(--mp-radius-sm);
  font-weight: 650;
  letter-spacing: .01em;
  padding: 0.5rem 1rem;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn.btn-sm{
  border-radius: var(--mp-radius-xs);
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}
.btn-lg{
  border-radius: var(--mp-radius-sm);
  padding: 0.62rem 1.25rem;
}

.btn-primary{
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: rgba(37,99,235,.62);
  box-shadow: 0 8px 16px rgba(37,99,235,.16);
}
.btn-primary:hover, .btn-primary:focus-visible{
  background: linear-gradient(180deg, #4f8ffb 0%, #1d4ed8 100%);
  border-color: rgba(29,78,216,.85);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37,99,235,.22);
}

.btn-secondary{
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-color: rgba(15,23,42,.14);
  color: #334155;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.btn-secondary:hover, .btn-secondary:focus-visible{
  background: #f1f5f9;
  border-color: rgba(15,23,42,.2);
  color: #0f172a;
  transform: translateY(-1px);
}

.btn-success{
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  border-color: rgba(5,150,105,.65);
  color: #fff;
  box-shadow: 0 8px 16px rgba(5,150,105,.14);
}
.btn-success:hover, .btn-success:focus-visible{
  background: linear-gradient(180deg, #4ade80 0%, #047857 100%);
  border-color: rgba(4,120,87,.85);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger{
  background: linear-gradient(180deg, #fb7185 0%, #dc2626 100%);
  border-color: rgba(220,38,38,.58);
  color: #fff;
  box-shadow: 0 8px 16px rgba(220,38,38,.12);
}
.btn-danger:hover, .btn-danger:focus-visible{
  background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
  border-color: rgba(185,28,28,.88);
  color: #fff;
  transform: translateY(-1px);
}

.btn-warning{
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border-color: rgba(217,119,6,.55);
  color: #422006;
  box-shadow: 0 8px 16px rgba(217,119,6,.12);
}
.btn-warning:hover, .btn-warning:focus-visible{
  background: linear-gradient(180deg, #fcd34d 0%, #b45309 100%);
  border-color: rgba(180,83,9,.75);
  color: #271203;
  transform: translateY(-1px);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
.btn-outline-success:hover{
  transform: translateY(-1px);
}
.btn:active{
  transform: translateY(0);
}

.btn:focus-visible{
  box-shadow: 0 0 0 .2rem var(--mp-focus-ring);
}

/* Standalone print/receipt views use class "secondary" instead of btn-outline-secondary */
.btn.secondary{
  display: inline-block;
  padding: 0.48rem 0.95rem;
  border-radius: var(--mp-radius-sm);
  font-weight: 650;
  font-size: 0.9rem;
  border: 1px solid rgba(15,23,42,.14);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: #334155 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn.secondary:hover{
  background: #f1f5f9;
  border-color: rgba(15,23,42,.2);
  color: #0f172a !important;
  transform: translateY(-1px);
}

.card.mp-card{
  transition: transform .12s ease, box-shadow .12s ease;
}
.card.mp-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(2,6,23,.08);
}

.mp-main .form-control,
.mp-main .form-select{
  border-radius: var(--mp-radius-sm);
  border-color: rgba(15,23,42,.12);
  padding: 0.52rem 0.85rem;
  font-size: 0.9375rem;
}
.mp-main textarea.form-control{
  min-height: calc(2.5rem + 2px);
}
.mp-main .form-control:focus,
.mp-main .form-select:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 3px var(--mp-focus-ring);
}
.mp-main .form-label{
  font-weight: 650;
  font-size: 0.8125rem;
  color: var(--mp-text);
  margin-bottom: 0.4rem;
}
.mp-main .form-label.mp-required::after,
.mp-main label.mp-required::after{
  content: " *";
  color: #dc2626;
  font-weight: 700;
}
.mp-main .invalid-feedback, .mp-main .valid-feedback{
  font-size: 0.8125rem;
  margin-top: 0.3rem;
}
.mp-main .form-control.is-invalid, .mp-main .form-select.is-invalid{
  border-color: rgba(220,38,38,.55);
}
.mp-main .form-control.is-invalid:focus{
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}
.mp-main .input-group-text{
  border-radius: var(--mp-radius-sm);
  border-color: rgba(15,23,42,.12);
  background: #f8fafc;
  color: var(--mp-text-muted);
  font-size: 0.875rem;
}

.mp-form-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mp-border);
}

/* Tables */
.mp-main .table{
  --bs-table-striped-bg: rgba(15,23,42,.028);
  --bs-table-hover-bg: rgba(59,130,246,.05);
  margin-bottom: 0;
}
.mp-main .table thead th{
  font-size: 0.72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(15,23,42,.62);
  border-bottom-width: 1px;
  border-bottom-color: var(--mp-border);
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
  white-space: nowrap;
}
.mp-main .table tbody td{
  padding: 0.72rem 0.75rem;
  vertical-align: middle;
  border-bottom-color: rgba(15,23,42,.06);
}
.mp-main .table tbody tr:last-child td{
  border-bottom: 0;
}
.mp-main .table td.text-end,
.mp-main .table th.text-end{
  font-variant-numeric: tabular-nums;
}

.mp-main .btn-group-sm > .btn{
  padding: 0.28rem 0.5rem;
  border-radius: var(--mp-radius-xs);
}

.mp-empty, .mp-main .table-empty{
  text-align: center;
  padding: 2rem 1rem;
  color: var(--mp-text-muted);
  font-size: 0.9rem;
}
.mp-empty i, .mp-main .table-empty i{
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.35;
}

/* Alerts */
.mp-main .alert{
  border: 1px solid transparent;
  border-radius: var(--mp-radius-sm);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 10px rgba(2,6,23,.04);
  border-left-width: 4px;
}
.mp-main .alert-success{
  border-left-color: #059669;
  background: linear-gradient(90deg, rgba(16,185,129,.08), #fff 40%);
  border-color: rgba(16,185,129,.22);
  color: #065f46;
}
.mp-main .alert-danger{
  border-left-color: #dc2626;
  background: linear-gradient(90deg, rgba(248,113,113,.1), #fff 40%);
  border-color: rgba(248,113,113,.28);
  color: #7f1d1d;
}
.mp-main .alert-warning{
  border-left-color: #d97706;
  background: linear-gradient(90deg, rgba(251,191,36,.14), #fff 35%);
  border-color: rgba(251,191,36,.35);
  color: #78350f;
}
.mp-main .alert-info{
  border-left-color: #0284c7;
  background: linear-gradient(90deg, rgba(56,189,248,.1), #fff 40%);
  border-color: rgba(56,189,248,.28);
  color: #0c4a6e;
}

/* Badges — base + semantic status helpers (add classes alongside Bootstrap badges where useful) */
.badge{
  border-radius: 999px;
  padding: 0.35em 0.65em;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: .03em;
  vertical-align: middle;
}

.mp-badge{
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}

.badge.mp-badge--paid,
.mp-badge--paid{
  background: linear-gradient(180deg, #34d399, #059669) !important;
  color: #fff !important;
}

.badge.mp-badge--partial,
.mp-badge--partial{
  background: linear-gradient(180deg, #fcd34d, #d97706) !important;
  color: #422006 !important;
}

.badge.mp-badge--unpaid,
.mp-badge--unpaid{
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid rgba(15,23,42,.12);
}

.badge.mp-badge--pending,
.mp-badge--pending{
  background: rgba(245,158,11,.18) !important;
  color: #92400e !important;
  border: 1px solid rgba(245,158,11,.35);
}

.badge.mp-badge--in_progress,
.mp-badge--in_progress{
  background: rgba(59,130,246,.14) !important;
  color: #1e40af !important;
  border: 1px solid rgba(59,130,246,.28);
}

.badge.mp-badge--ready,
.mp-badge--ready{
  background: rgba(16,185,129,.14) !important;
  color: #065f46 !important;
  border: 1px solid rgba(16,185,129,.35);
}

.badge.mp-badge--delivered,
.mp-badge--delivered{
  background: rgba(15,23,42,.88) !important;
  color: #f8fafc !important;
}

.badge.mp-badge--active,
.mp-badge--active{
  background: rgba(16,185,129,.16) !important;
  color: #047857 !important;
  border: 1px solid rgba(16,185,129,.35);
}

.badge.mp-badge--inactive,
.mp-badge--inactive{
  background: rgba(148,163,184,.2) !important;
  color: #475569 !important;
}

.badge.mp-badge--low_stock,
.mp-badge--low_stock{
  background: rgba(249,115,22,.14) !important;
  color: #9a3412 !important;
  border: 1px solid rgba(249,115,22,.35);
}

/* Dropdowns & modals (app shell) */
.mp-app .dropdown-menu{
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-sm);
  box-shadow: 0 14px 42px rgba(2,6,23,.12);
  padding: 0.35rem;
}
.mp-app .dropdown-item{
  border-radius: var(--mp-radius-xs);
  font-weight: 550;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
}
.mp-app .dropdown-item:active{
  background: rgba(37,99,235,.1);
  color: #1e3a8a;
}

.mp-app .modal-content{
  border-radius: var(--mp-radius);
  border: 1px solid var(--mp-border);
  box-shadow: 0 24px 48px rgba(2,6,23,.14);
}
.mp-app .modal-header{
  border-bottom-color: var(--mp-border);
}
.mp-app .modal-footer{
  border-top-color: var(--mp-border);
}

/* DataTables */
.mp-main div.dt-container .dt-layout-row:not(.dt-layout-table),
.mp-main div.dataTables_wrapper .dataTables_length,
.mp-main div.dataTables_wrapper .dataTables_filter{
  padding-bottom: 0.35rem;
}
div.dataTables_wrapper .dataTables_filter input,
div.dataTables_wrapper .dataTables_length select,
.mp-main div.dt-container .dt-search input,
.mp-main div.dt-container .dt-length select{
  border-radius: var(--mp-radius-sm) !important;
  border-color: rgba(15,23,42,.12) !important;
}

/* Mobile Purchases — layout, single search (server), DT controls, softer rows */
.mp-purchases-page{
  max-width: 100%;
}
.mp-purchases-toolbar{
  background: rgba(248, 250, 252, 0.92);
  border-color: var(--mp-border) !important;
}
.mp-purchases-toolbar .form-control,
.mp-purchases-toolbar .input-group-text{
  border-radius: var(--mp-radius-sm);
}
.mp-purchases-table-shell{
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}
.mp-purchases-page div.dt-container{
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0 0.15rem 0;
}
.mp-purchases-page div.dt-container .dt-layout-row{
  flex-wrap: wrap;
  align-items: center !important;
  gap: 0.5rem 0.75rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}
.mp-purchases-page div.dt-container .dt-layout-row.dt-layout-table{
  margin-left: -0.15rem;
  margin-right: -0.15rem;
  padding-left: 0;
  padding-right: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mp-purchases-page table.dataTable{
  min-width: 1080px;
  margin-bottom: 0;
}
.mp-purchases-page div.dt-container .dt-length,
.mp-purchases-page div.dt-container .dt-info,
.mp-purchases-page div.dt-container .dt-paging{
  margin-top: 0.15rem;
}
.mp-purchases-page div.dt-container .dt-length label{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 600;
  white-space: nowrap;
}
.mp-purchases-page div.dt-container .dt-length select{
  min-width: 5.25rem !important;
  padding: 0.4rem 2.1rem 0.4rem 0.65rem !important;
  font-weight: 650;
  font-size: 0.875rem;
  line-height: 1.25;
  display: inline-block;
  vertical-align: middle;
}
.mp-purchases-page table.mp-table-purchases.table-striped > tbody > tr:nth-of-type(odd) > *{
  --bs-table-accent-bg: transparent;
  background-color: rgba(248, 250, 252, 0.72) !important;
  box-shadow: none;
}
.mp-purchases-page table.mp-table-purchases.table-striped > tbody > tr:nth-of-type(even) > *{
  --bs-table-accent-bg: transparent;
  background-color: #fff !important;
}
.mp-purchases-page table.mp-table-purchases > tbody > tr:hover > *{
  background-color: rgba(241, 245, 249, 0.98) !important;
}
.mp-purchases-page .mp-purchase-actions-col{
  min-width: 10.5rem;
  width: 1%;
  vertical-align: middle;
  padding-left: 0.75rem !important;
  padding-right: 1rem !important;
}
.mp-purchases-page .mp-purchase-actions{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  max-width: 100%;
}
.mp-purchases-page .mp-purchase-actions .btn{
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.28rem 0.55rem;
  line-height: 1.2;
  border-radius: var(--mp-radius-xs);
}
.mp-device-details{
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 16rem;
}
.mp-device-details__line{
  font-weight: 600;
  color: var(--mp-text);
}
.mp-device-details__line--muted{
  font-weight: 550;
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.78rem;
}

/* Mobile Sales list */
.mp-sales-page{
  max-width: 100%;
  min-width: 0;
}
.mp-sales-table-outer{
  min-width: 0;
  max-width: 100%;
}
/* Horizontal scroll: single scrollport (Bootstrap + alias) — keeps Actions reachable */
.mp-sales-table-scroll,
.sales-table-wrapper{
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
  overscroll-behavior-x: contain;
}
.mp-sales-table-scroll .dt-container,
.sales-table-wrapper .dt-container{
  max-width: 100%;
}
.mp-sales-toolbar{
  background: rgba(248, 250, 252, 0.92);
  border-color: var(--mp-border) !important;
}
.mp-sales-page div.dt-container{
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0 0.15rem 0;
}
.mp-sales-page div.dt-container .dt-layout-row{
  flex-wrap: wrap;
  align-items: center !important;
  gap: 0.5rem 0.75rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}
/* Do not scroll here — nested overflow breaks sticky Actions + clips last column */
.mp-sales-page div.dt-container .dt-layout-row.dt-layout-table{
  margin-left: -0.15rem;
  margin-right: -0.15rem;
  padding-left: 0;
  padding-right: 0;
  overflow-x: visible;
}
.mp-sales-page div.dt-container .dt-length label{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 600;
  white-space: nowrap;
}
.mp-sales-page div.dt-container .dt-length select{
  min-width: 5.25rem !important;
  padding: 0.4rem 2.1rem 0.4rem 0.65rem !important;
  font-weight: 650;
  font-size: 0.875rem;
  line-height: 1.25;
}
.mp-sales-page table.mp-table-sales.table-striped > tbody > tr:nth-of-type(odd) > *{
  --bs-table-accent-bg: transparent;
  background-color: rgba(248, 250, 252, 0.65) !important;
  box-shadow: none;
}
.mp-sales-page table.mp-table-sales.table-striped > tbody > tr:nth-of-type(even) > *{
  --bs-table-accent-bg: transparent;
  background-color: #fff !important;
}
.mp-sales-page table.mp-table-sales > tbody > tr:hover > *{
  background-color: rgba(241, 245, 249, 0.98) !important;
}
.mp-sales-page table.mp-table-sales > tbody > tr.mp-sales-row--cancelled > *{
  box-shadow: inset 3px 0 0 rgba(248, 113, 113, 0.85);
}
/* DataTables often sets width:100% + implicit fixed layout — force auto so last column is not squeezed to 0 */
/* Fit laptop main column: fluid width + auto layout (sticky Actions still guards the right edge) */
.mp-sales-page table.sales-table.dataTable,
.mp-sales-page table.mp-table-sales.dataTable{
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  min-width: 0 !important;
  margin-bottom: 0;
}
@media (max-width: 991.98px){
  .mp-sales-page table.sales-table.dataTable,
  .mp-sales-page table.mp-table-sales.dataTable{
    width: auto !important;
    max-width: none !important;
    min-width: 920px !important;
  }
}
.mp-sales-page .mp-sale-amount{
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
  font-size: 0.8rem;
}
.mp-sales-page .mp-sale-pta-col{
  white-space: nowrap;
}
.mp-sales-page .mp-sale-pta-col .mp-badge{
  white-space: nowrap;
}
/* Merged: method + payment badge + record status */
.mp-sales-page .mp-sale-paystatus-col{
  min-width: 5.75rem;
  max-width: 7.25rem;
  vertical-align: middle;
}
.mp-sales-page .mp-sale-paystatus-col .mp-sale-pay-meth{
  font-size: 0.62rem !important;
  letter-spacing: 0.04em !important;
  font-weight: 700 !important;
  line-height: 1.2;
}
.mp-sales-page .mp-sale-paystatus-col .mp-badge{
  font-size: 0.62rem;
  padding: 0.12rem 0.38rem;
  max-width: 100%;
}
.mp-sales-page .mp-sale-paystatus-col .mt-1{
  margin-top: 0.2rem !important;
}
.mp-sales-page .mp-sale-date-col{
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.mp-sales-page .mp-sale-date-ymd{
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}
.mp-sales-page .mp-sale-date-time{
  font-size: 0.68rem;
  line-height: 1.2;
  opacity: 0.92;
}
.mp-sales-page .mp-sale-col-mobile{
  max-width: 11.5rem;
}
.mp-sales-page .mp-sale-col-mobile .mp-sale-mobile-sub{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11rem;
}
/* Actions: always reserved width + sticky on right edge of scroll area (never “missing”) */
.mp-sales-page thead th.mp-sale-actions-col,
.mp-sales-page thead th.sales-actions,
.mp-sales-page tbody td.mp-sale-actions-col,
.mp-sales-page tbody td.sales-actions{
  min-width: 104px;
  width: auto;
  vertical-align: middle;
  padding-left: 0.45rem !important;
  padding-right: 0.65rem !important;
  white-space: nowrap !important;
  text-align: right;
  position: sticky;
  right: 0;
  z-index: 3;
  box-shadow: -8px 0 14px -8px rgba(15, 23, 42, 0.18);
}
.mp-sales-page thead th.mp-sale-actions-col,
.mp-sales-page thead th.sales-actions{
  z-index: 5;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}
.mp-sales-page tbody td.mp-sale-actions-col,
.mp-sales-page tbody td.sales-actions{
  background: #fff;
}
.mp-sales-page table.table-striped > tbody > tr:nth-of-type(odd) > td.mp-sale-actions-col,
.mp-sales-page table.table-striped > tbody > tr:nth-of-type(odd) > td.sales-actions{
  background: rgba(248, 250, 252, 0.98);
}
.mp-sales-page table.table-striped > tbody > tr:nth-of-type(even) > td.mp-sale-actions-col,
.mp-sales-page table.table-striped > tbody > tr:nth-of-type(even) > td.sales-actions{
  background: #fff;
}
.mp-sales-page table.table-striped > tbody > tr:hover > td.mp-sale-actions-col,
.mp-sales-page table.table-striped > tbody > tr:hover > td.sales-actions{
  background: rgba(241, 245, 249, 0.99) !important;
}
.mp-sales-page .mp-sale-actions{
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}
.mp-sales-page .mp-sale-actions .btn{
  flex: 0 0 auto;
  padding: 0.32rem 0.5rem;
  line-height: 1;
  border-radius: var(--mp-radius-xs);
}
.mp-sales-page .mp-sale-imei{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.3;
}
.mp-sales-page .mp-sale-mobile-sub{
  font-size: 0.78rem;
  color: rgba(15, 23, 42, 0.62);
  font-weight: 600;
}
.mp-sales-page td .mp-sale-profit{
  font-size: 0.8rem;
}
.mp-sale-profit{
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.mp-sale-profit--pos{ color: #047857; }
.mp-sale-profit--neg{ color: #b91c1c; }
.mp-sale-profit--zero{ color: #64748b; }

.mp-badge--sale-pay-paid{
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.32);
}
.mp-badge--sale-pay-partial{
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.38);
}
.mp-badge--sale-pay-due{
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.32);
}
.mp-badge--sale-rec-active{
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}
.mp-badge--sale-rec-cancelled{
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.3);
}
.mp-badge--sale-rec-returned{
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
}
.mp-badge--sale-rec-pending{
  background: rgba(100, 116, 139, 0.18);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.28);
}

/* Print helpers */
@media print {
  body{ background:#fff; }
  .mp-sidebar, .mp-topbar{ display:none !important; }
  .mp-content{ padding:0 !important; }
  .mp-card{ box-shadow:none !important; }
}

.mp-stat-icon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}
.mp-stat-icon--primary{ background: rgba(59,130,246,.14); color: #2563eb; }
.mp-stat-icon--info{ background: rgba(14,165,233,.14); color: #0284c7; }
.mp-stat-icon--warning{ background: rgba(245,158,11,.16); color: #b45309; }
.mp-stat-icon--danger{ background: rgba(239,68,68,.14); color: #dc2626; }

/* Auth */
.mp-bg-auth{
  background: radial-gradient(1200px 800px at 20% 10%, rgba(59,130,246,.25), transparent 60%),
              radial-gradient(900px 600px at 90% 40%, rgba(16,185,129,.18), transparent 55%),
              #0b1220;
}
.mp-auth-card{
  border-radius: 18px;
}
.mp-logo{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(59,130,246,.12);
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

/* Responsive sidebar — collapsed below 992px; toggle in topbar */
@media (max-width: 991.98px){
  .mp-app{
    overflow-x: hidden;
  }
  .mp-sidebar{
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: min(272px, 88vw);
    flex: 0 0 auto;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 1050;
    box-shadow: 12px 0 40px rgba(2,6,23,.28);
  }
  body.mp-sidebar-open{
    overflow: hidden;
  }
  body.mp-sidebar-open .mp-sidebar{
    transform: translateX(0);
  }
  body.mp-sidebar-open::before{
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.55);
    z-index: 1040;
    pointer-events: auto;
  }
}
@media (min-width: 992px){
  .mp-sidebar-toggle{
    display: none !important;
  }
}

/* Appearance (from Global Settings) */
body.mp-theme-indigo{
  --mp-sidebar-active: rgba(99,102,241,.22);
}
body.mp-theme-teal{
  --mp-sidebar-active: rgba(20,184,166,.22);
}
body.mp-theme-emerald{
  --mp-sidebar-active: rgba(16,185,129,.22);
}
body.mp-theme-slate{
  --mp-sidebar-active: rgba(148,163,184,.22);
}
body.mp-sidebar-light .mp-sidebar{
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border-right: 1px solid #e2e8f0;
  color: #0f172a;
}
body.mp-sidebar-light .mp-sidebar__brand-subtitle,
body.mp-sidebar-light .mp-nav__section,
body.mp-sidebar-light .mp-sidebar__brand-title{
  color: #334155;
}
body.mp-sidebar-light .mp-nav__link{
  color: #334155;
}
body.mp-sidebar-light .mp-nav__link:hover{
  background: rgba(15,23,42,.06);
}
body.mp-compact .mp-content{
  padding-top: .75rem;
}
body.mp-compact .mp-nav__link{
  padding: .35rem .65rem;
  font-size: .875rem;
}

/* -------------------------------------------------------------------------- */
/* Login page (auth/login.php) — standalone SaaS-style layout                 */
/* -------------------------------------------------------------------------- */

body.mp-login-body{
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mp-login-page{
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,.35), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(14,165,233,.22), transparent 50%),
    linear-gradient(155deg, #020617 0%, #0f172a 38%, #1e3a8a 72%, #1d4ed8 100%);
  padding: 0;
}

.mp-login-hero__mark{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #e0f2fe;
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 12px 40px rgba(2,6,23,.35);
}

.mp-login-hero__brand{
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 2px 24px rgba(2,6,23,.35);
}

.mp-login-hero__tagline{
  font-size: clamp(.95rem, 2.5vw, 1.05rem);
  font-weight: 500;
  color: rgba(226,232,240,.92);
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

.mp-login-hero__features{
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(148,163,184,.95);
}

.mp-login-card{
  border-radius: 1.35rem;
  box-shadow:
    0 4px 6px -1px rgba(2,6,23,.06),
    0 24px 48px -12px rgba(2,6,23,.28),
    0 0 0 1px rgba(255,255,255,.08) inset;
  background: #fff;
}

.mp-login-card__title{
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.mp-login-card__subtitle{
  color: #64748b;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 28rem;
}

.mp-login-alert{
  border-radius: 12px;
  border: none;
  font-size: .9375rem;
  padding: .75rem 1rem;
}

.mp-login-label{
  font-weight: 600;
  font-size: .875rem;
  color: #334155;
  margin-bottom: .35rem;
}

.mp-login-input-group .input-group-text{
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-right: 0;
  color: #64748b;
  border-radius: 12px 0 0 12px;
  padding-left: 1rem;
  padding-right: .75rem;
}

.mp-login-input-group .form-control{
  border: 1px solid #e2e8f0;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  padding-top: .65rem;
  padding-bottom: .65rem;
  font-size: 1rem;
}

.mp-login-input-group:has(.mp-login-toggle) .form-control{
  border-radius: 0;
}

.mp-login-input-group .form-control:focus{
  border-color: #93c5fd;
  box-shadow: none;
}

.mp-login-input-group:focus-within .input-group-text{
  border-color: #93c5fd;
}

.mp-login-input-group:focus-within .form-control{
  border-color: #93c5fd;
}

.mp-login-input-group .form-control:focus{
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.mp-login-toggle{
  border: 1px solid #e2e8f0;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #f8fafc;
  color: #64748b;
  padding: 0 1rem;
}

.mp-login-toggle:hover,
.mp-login-toggle:focus{
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}

.mp-login-input-group:focus-within .mp-login-toggle{
  border-color: #93c5fd;
}

.mp-login-forgot{
  font-size: .875rem;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}

.mp-login-forgot:hover{
  color: #1d4ed8;
  text-decoration: underline;
}

.mp-login-submit{
  border-radius: 12px;
  font-weight: 600;
  padding-top: .85rem;
  padding-bottom: .85rem;
  letter-spacing: .01em;
  box-shadow: 0 10px 28px rgba(37,99,235,.35);
}

.mp-login-submit:hover{
  box-shadow: 0 14px 32px rgba(37,99,235,.42);
}

.mp-login-footer{
  color: rgba(255,255,255,.78);
  font-size: .875rem;
}

.mp-login-footer strong{
  color: #fff;
  font-weight: 600;
}

@media (max-width: 575.98px){
  .mp-login-card .card-body{
    padding: 1.35rem !important;
  }
  .mp-login-hero__mark{
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* Wide tables: use .table-responsive / .mp-table-wrap (see Responsive system below) */

/* ---------- Dashboard (premium layout) ---------- */
.mp-dash{
  max-width: 1400px;
  margin-inline: auto;
}
.mp-dash-hero{
  background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(241,245,249,.9));
  border: 1px solid rgba(15,23,42,.07);
}
.mp-dash-hero .letter-spacing{
  letter-spacing: .12em;
}
.mp-dash-section-title{
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
@media (min-width: 576px){
  .mp-dash-section-title{
    flex-direction: row;
    align-items: baseline;
    gap: .65rem;
  }
}
.mp-dash-section-title__label{
  font-weight: 700;
  font-size: .95rem;
  color: #0f172a;
}
.mp-dash-section-title__hint{
  font-size: .8rem;
  color: rgba(15,23,42,.55);
}

.mp-dash-kpi-link{
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}
.mp-dash-kpi-link:focus-visible{
  outline: 2px solid rgba(37,99,235,.55);
  outline-offset: 2px;
  border-radius: var(--mp-radius);
}
.mp-dash-kpi{
  position: relative;
  overflow: hidden;
}
.mp-dash-kpi--accent{
  border-color: rgba(37,99,235,.14);
  background: linear-gradient(165deg, rgba(59,130,246,.06), #fff 42%);
}
.mp-dash-kpi-label{
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: rgba(15,23,42,.55);
  margin-bottom: .35rem;
}
.mp-dash-kpi-value{
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0f172a;
  line-height: 1.15;
}
.mp-dash-kpi-value--sm{
  font-size: 1.35rem;
}
.mp-dash-kpi-meta{
  margin-top: .35rem;
  font-size: .78rem;
  color: rgba(15,23,42,.55);
}
.mp-dash-kpi-foot{
  margin-top: .85rem;
  padding-top: .65rem;
  border-top: 1px dashed rgba(15,23,42,.1);
  font-size: .78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.mp-dash-kpi-icon{
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.mp-dash-kpi-icon--blue{ background: rgba(37,99,235,.12); color: #1d4ed8; }
.mp-dash-kpi-icon--green{ background: rgba(16,185,129,.14); color: #047857; }
.mp-dash-kpi-icon--rose{ background: rgba(244,63,94,.12); color: #be123c; }
.mp-dash-kpi-icon--cyan{ background: rgba(6,182,212,.14); color: #0e7490; }
.mp-dash-kpi-icon--amber{ background: rgba(245,158,11,.16); color: #b45309; }
.mp-dash-kpi-icon--teal{ background: rgba(20,184,166,.14); color: #0f766e; }
.mp-dash-kpi-icon--indigo{ background: rgba(99,102,241,.14); color: #4338ca; }
.mp-dash-kpi-icon--orange{ background: rgba(249,115,22,.14); color: #c2410c; }
.mp-dash-kpi-icon--slate{ background: rgba(100,116,139,.14); color: #334155; }

.mp-dash-kpi-link:hover .mp-dash-kpi{
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(2,6,23,.1);
  border-color: rgba(37,99,235,.16);
}

.mp-dash-action{
  font-weight: 650 !important;
  border-radius: 14px !important;
}

.mp-dash-empty{
  text-align: center;
  padding: 2.25rem 1rem;
  color: rgba(15,23,42,.52);
  font-size: .9rem;
}
.mp-dash-empty i{
  font-size: 2rem;
  display: block;
  margin-bottom: .6rem;
  opacity: .35;
}

.mp-dash-table-card .card-header a:hover{
  text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Stock / purchase list — professional badges & compact tables              */
/* -------------------------------------------------------------------------- */

.mp-badge{
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* PTA */
.mp-badge--pta-approved{
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}
.mp-badge--pta-nonpta{
  background: rgba(249, 115, 22, 0.2);
  color: #9a3412;
  border-color: rgba(234, 88, 12, 0.45);
}
.mp-badge--pta-cpid{
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
}
.mp-badge--pta-jv{
  background: rgba(88, 28, 135, 0.16);
  color: #581c87;
  border-color: rgba(109, 40, 217, 0.35);
}
.mp-badge--pta-factory{
  background: rgba(20, 184, 166, 0.18);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.38);
}
.mp-badge--pta-unknown{
  background: rgba(100, 116, 139, 0.16);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.28);
}
.mp-badge--pta-locked{
  background: rgba(220, 38, 38, 0.14);
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.32);
}

/* Sale status */
.mp-badge--sale-available{
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.32);
}
.mp-badge--sale-sold{
  background: rgba(51, 65, 85, 0.2);
  color: #1e293b;
  border-color: rgba(51, 65, 85, 0.35);
}
.mp-badge--sale-returned{
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.4);
}
.mp-badge--sale-exchanged{
  background: rgba(59, 130, 246, 0.16);
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.32);
}
.mp-badge--sale-damaged{
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.32);
}
.mp-badge--sale-unknown{
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.35);
}

/* Condition */
.mp-badge--cond-new{
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.32);
}
.mp-badge--cond-likenew{
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}
.mp-badge--cond-used{
  background: rgba(100, 116, 139, 0.16);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.28);
}
.mp-badge--cond-openbox{
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.38);
}
.mp-badge--cond-refurb{
  background: rgba(139, 92, 246, 0.16);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.32);
}
.mp-badge--cond-damaged{
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}
.mp-badge--cond-unknown{
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.3);
}

.mp-badge--pay-due{
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.38);
}
.mp-badge--pay-clear{
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.mp-table-stock thead th{
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.55);
  border-bottom-width: 1px;
  white-space: nowrap;
  vertical-align: middle;
}
.mp-table-stock td{
  vertical-align: middle;
}
.mp-table-stock .mp-imei{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.mp-table-stock .mp-amount{
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.mp-stock-actions .btn{
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.2rem 0.45rem;
  line-height: 1.2;
}

/* Warranty claim workflow status badges */
.mp-wc-badge{
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.2;
}
.mp-wc-badge--pending{
  background: rgba(234, 179, 8, 0.22);
  color: #a16207;
  border-color: rgba(217, 119, 6, 0.38);
}
.mp-wc-badge--approved{
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.32);
}
.mp-wc-badge--rejected{
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.32);
}
.mp-wc-badge--sent-supplier{
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.32);
}
.mp-wc-badge--recv-supplier{
  background: rgba(139, 92, 246, 0.16);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.32);
}
.mp-wc-badge--repaired{
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}
.mp-wc-badge--replaced{
  background: rgba(20, 184, 166, 0.16);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.32);
}
.mp-wc-badge--returned{
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
  border-color: rgba(22, 101, 52, 0.28);
}
.mp-wc-badge--completed{
  background: rgba(21, 128, 61, 0.2);
  color: #14532d;
  border-color: rgba(20, 83, 45, 0.35);
}
.mp-wc-badge--cancelled{
  background: rgba(148, 163, 184, 0.22);
  color: #64748b;
  border-color: rgba(239, 68, 68, 0.28);
}
.mp-wc-badge--unknown{
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.32);
}

/* ========================================================================== */
/* Responsive system — desktop / tablet / mobile (CodeCanyon-ready)            */
/* Breakpoints: 1200 · 992 · 768 · 576                                        */
/* ========================================================================== */

html{
  overflow-x: hidden;
}

.mp-app{
  width: 100%;
  max-width: 100vw;
}

.mp-main{
  width: 100%;
  max-width: 100%;
}

/* --- Reusable layout helpers --- */
.mp-table-wrap,
.mp-main .table-responsive,
.table-responsive.mp-table-wrap{
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.mp-main .table td.text-end,
.mp-main .table th.text-end,
.mp-main .table .mp-amount,
.mp-main .table .mp-sale-amount,
.mp-table-stock .mp-amount{
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

.mp-content > .d-flex.flex-wrap.align-items-center.justify-content-between.mb-3,
.mp-content > .d-flex.flex-wrap.gap-2.align-items-center.justify-content-between.mb-3{
  gap: 0.75rem;
}

.mp-filter-bar,
.mp-purchases-toolbar form,
.mp-sales-page .card-body > form.row,
.mp-main .card-body > form.row.g-2.align-items-end,
.mp-main .card-body > form.row.g-2.mb-3{
  --mp-filter-gap: 0.5rem;
}

.mp-actions{
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.mp-mobile-stack{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mp-kpi-grid > [class*="col-"]{
  min-width: 0;
}

.mp-card-grid > [class*="col-"]{
  min-width: 0;
}

.mp-form-grid .row > [class*="col-"]{
  min-width: 0;
}

/* Sticky actions column inside horizontal scroll areas */
.mp-table-wrap .mp-sale-actions-col,
.mp-table-wrap .sales-actions,
.mp-table-wrap .mp-purchase-actions-col,
.mp-table-wrap th.text-end.text-nowrap:last-child,
.mp-table-wrap td.text-end.text-nowrap:last-child,
.mp-table-wrap th.mp-actions-col,
.mp-table-wrap td.mp-actions-col{
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -6px 0 12px -6px rgba(15, 23, 42, 0.12);
}

.mp-table-wrap thead th.mp-sale-actions-col,
.mp-table-wrap thead th.sales-actions,
.mp-table-wrap thead th.mp-purchase-actions-col,
.mp-table-wrap thead th.mp-actions-col{
  z-index: 3;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.mp-table-wrap table.table-striped > tbody > tr:nth-of-type(odd) > td.mp-sale-actions-col,
.mp-table-wrap table.table-striped > tbody > tr:nth-of-type(odd) > td.sales-actions,
.mp-table-wrap table.table-striped > tbody > tr:nth-of-type(odd) > td.mp-purchase-actions-col,
.mp-table-wrap table.table-striped > tbody > tr:nth-of-type(odd) > td.mp-actions-col{
  background: rgba(248, 250, 252, 0.98);
}

/* DataTables — layout + mobile */
.mp-main div.dt-container{
  width: 100%;
  max-width: 100%;
}

.mp-main div.dt-container .dt-layout-row:not(.dt-layout-table){
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center !important;
}

.mp-main div.dt-container .dt-layout-row.dt-layout-table{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.mp-main div.dt-container .dt-search,
.mp-main div.dt-container .dt-length,
.mp-main div.dt-container .dt-info,
.mp-main div.dt-container .dt-paging{
  flex: 1 1 auto;
  min-width: 0;
}

.mp-main div.dt-container .dt-search input{
  max-width: 100%;
  min-width: 8rem;
}

.mp-main div.dt-container .dt-paging .pagination{
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
}

/* Topbar */
.mp-topbar__title{
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: 1.35;
  min-width: 0;
}
.mp-topbar__title .text-secondary{
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin-left: 0 !important;
  margin-top: 0.1rem;
}

@media (min-width: 768px){
  .mp-topbar__title .text-secondary{
    display: inline;
    margin-left: 0.5rem !important;
    margin-top: 0;
  }
}

/* Dashboard KPI grid: 1 / 2 / 4 columns */
.mp-kpi-grid{
  --mp-kpi-cols: 1;
}
@media (min-width: 768px){
  .mp-kpi-grid{
    --mp-kpi-cols: 2;
  }
}
@media (min-width: 1200px){
  .mp-kpi-grid{
    --mp-kpi-cols: 4;
  }
}

.mp-dash-kpi-value{
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
}

.mp-dash-action{
  min-height: 2.85rem;
}

/* Forms — full width inputs on narrow screens */
@media (max-width: 767.98px){
  .mp-main .form-control,
  .mp-main .form-select,
  .mp-main .input-group{
    max-width: 100%;
  }

  .mp-main .card-body > form.row .col-auto,
  .mp-main .card-body > form.row .d-flex.gap-2{
    width: 100%;
  }

  .mp-main .card-body > form.row .btn,
  .mp-filter-bar .btn,
  .mp-purchases-toolbar .btn{
    flex: 1 1 auto;
    min-width: 0;
  }

  .mp-content > .d-flex.justify-content-between.mb-3 .btn,
  .mp-content > .d-flex.flex-wrap.gap-2.align-items-center.justify-content-between.mb-3 .btn{
    flex: 1 1 auto;
  }

  .mp-content > .d-flex.justify-content-between.mb-3,
  .mp-content > .d-flex.flex-wrap.gap-2.align-items-center.justify-content-between.mb-3{
    flex-direction: column;
    align-items: stretch !important;
  }

  .mp-content > .d-flex.justify-content-between.mb-3 > .d-flex,
  .mp-content > .d-flex.flex-wrap.gap-2.align-items-center.justify-content-between.mb-3 > .d-flex{
    width: 100%;
    justify-content: stretch !important;
  }

  .mp-dash-hero .card-body{
    padding: 1rem 1rem !important;
  }

  .mp-dash-hero .badge{
    width: 100%;
    text-align: center;
  }

  #salesTrendChart,
  #profitTrendChart{
    min-height: 220px !important;
    height: 220px !important;
  }
}

@media (max-width: 575.98px){
  .mp-content{
    padding: 0.85rem 0.75rem 1.25rem;
  }

  .mp-topbar__row{
    padding: 0.55rem 0.65rem;
  }

  .mp-main .card .card-body{
    padding: 0.85rem 0.9rem;
  }

  .mp-main div.dt-container .dt-layout-row:not(.dt-layout-table){
    flex-direction: column;
    align-items: stretch !important;
  }

  .mp-main div.dt-container .dt-search,
  .mp-main div.dt-container .dt-length{
    width: 100%;
  }

  .mp-main div.dt-container .dt-search input{
    width: 100% !important;
    min-width: 0;
  }

  .mp-main div.dt-container .dt-paging{
    width: 100%;
  }

  .mp-main div.dt-container .dt-paging .pagination{
    justify-content: center;
  }
}

/* Tablet: comfortable table min-widths */
@media (max-width: 991.98px){
  .mp-main .table-responsive > .table:not(.dataTable),
  .mp-table-wrap > .table:not(.dataTable){
    min-width: 640px;
  }

  .mp-main .table.table-sm{
    min-width: 720px;
  }
}

@media (max-width: 767.98px){
  .mp-main .table-responsive > .table:not(.dataTable),
  .mp-table-wrap > .table:not(.dataTable){
    min-width: 560px;
  }
}

/* Settings / license multi-column forms */
@media (max-width: 991.98px){
  .mp-settings-grid .col-lg-6,
  .mp-settings-grid .col-md-6{
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Login */
@media (max-width: 575.98px){
  .mp-login-page .container{
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .mp-login-hero__tagline{
    font-size: 0.95rem;
  }
  .mp-login-hero__features{
    font-size: 0.8rem;
  }
}

/* Print — app shell hidden; invoice pages use their own @media print */
@media print{
  .mp-app,
  body{
    overflow: visible !important;
  }
  body.mp-sidebar-open{
    overflow: visible !important;
  }
  body.mp-sidebar-open::before{
    display: none !important;
  }
  .mp-sidebar,
  .mp-topbar,
  .mp-sidebar-toggle,
  .no-print{
    display: none !important;
  }
  .mp-main{
    width: 100% !important;
    flex: none !important;
  }
  .mp-content{
    padding: 0 !important;
    max-width: none !important;
  }
  .mp-card{
    box-shadow: none !important;
    border: none !important;
  }
  .mp-table-wrap,
  .table-responsive{
    overflow: visible !important;
  }
  .mp-table-wrap .mp-sale-actions-col,
  .mp-table-wrap td.text-end.text-nowrap:last-child{
    position: static !important;
    box-shadow: none !important;
  }
}
