:root{
	--bg:#f3f6fb;
	--surface:#ffffff;
	--surface-2:#f8fafc;
	--text:#172033;
	--muted:#667085;
	--line:#d9e2f2;
	--brand:#bae90f;
	--brand-2:#acda08;
	--green:#1f9d63;
	--red:#e34c4c;
	--amber:#e6a700;
	--shadow:0 18px 40px rgba(22,34,61,.08);
	--radius:20px;
}
*{
	box-sizing:border-box
}
html,body{
	margin:0;
	padding:0;
	font-family:Inter,system-ui,sans-serif;
	background:var(--bg);
	color:var(--text)
}
button,input,select,textarea{
	font:inherit
}
body{
	min-height:100vh
}
.app-shell{
	display:grid;
	grid-template-columns:280px 1fr;
	min-height:100vh
}
.sidebar{
	background:#22272D;
	color:#fff;
	padding:28px 22px;
	display:flex;
	flex-direction:column;
	gap:24px
}
.brand{
	display:flex;
	align-items:center;
	gap:14px
}
.brand-mark{
	width:54px;
	height:54px;
	border-radius:18px;
	background:linear-gradient(135deg,#6ea0ff,#a78bfa);
	display:grid;
	place-items:center;
	font-weight:800;
	font-size:20px
}
.brand h1{
	font-size:16px;
	margin:0
}
.brand p{
	margin:4px 0 0;
	color:#c8d5ff;
	font-size:13px
}
.nav{
	display:grid;
	gap:10px
}
.nav-link {
	display: none;
}
.nav-link{
	border:none;
	background:#F1FF5C;
	color:#000;
	padding:14px 16px;
	border-radius:14px;
	text-align:left;
	cursor:pointer;
	font-weight:600
}
.nav-link.active,.nav-link:hover{
	background:#fff;
	color:#12203d
}
.sidebar-card{
	background:rgba(255,255,255,.08);
	border:1px solid rgba(255,255,255,.08);
	padding:18px;
	border-radius:18px
}
.sidebar-card h3{
	margin:0 0 10px;
	font-size:16px
}
.sidebar-card ul{
	margin:0;
	padding-left:18px;
	color:#d8e1ff;
	display:grid;
	gap:8px;
	font-size:14px
}
.main{
	padding:28px
}
.topbar{
	display:flex;
	justify-content:space-between;
	align-items:flex-start;
	gap:18px;
	margin-bottom:20px
}
.topbar h2{
	margin:0 0 6px;
	font-size:28px
}
.topbar p{
	margin:0;
	color:var(--muted)
}
.wrap-actions{
	display:flex;
	flex-wrap:wrap
}
.btn{
	border:none;
	border-radius:14px;
	padding:12px 16px;
	font-weight:700;
	cursor:pointer
}
.btn-primary{
	background:#F1FF5C;
	color:#000
}
.btn-primary:hover{
	background:var(--brand-2)
}
.btn-secondary{
	background:#eaf0ff;
	color:#111401
}
.btn-secondary:hover{
	background:#dfe8ff
}
.btn-danger{
	background:#fdecec;
	color:#bf2626
}
.view{
	display:none
}
.view.active{
	display:block
}
.stats-grid{
	display:grid;
	grid-template-columns:repeat(6,1fr);
	gap:16px;
	margin-bottom:18px
}
.stat-card,.panel{
	background:var(--surface);
	border:1px solid var(--line);
	box-shadow:var(--shadow);
	border-radius:var(--radius)
}
.stat-card{
	padding:18px
}
.stat-card span{
	display:block;
	color:var(--muted);
	font-size:13px
}
.stat-card strong{
	display:block;
	font-size:28px;
	margin:10px 0 8px
}
.stat-card small{
	color:var(--muted)
}
.panel{
	padding:20px
}
.panel-grid{
	display:grid;
	gap:18px
}
.panel-grid.two{
	grid-template-columns:repeat(2,1fr);
   align-items: stretch;
}
.panel-head{
	display:flex;
	justify-content:space-between;
	align-items:flex-end;
	gap:12px;
	margin-bottom:14px
}
.panel-head h3{
	margin:0;
	font-size:18px
}
.panel-head p{
	margin:0;
	color:var(--muted);
	font-size:13px
}
.chart-panel {
  display: flex;
  flex-direction: column;
}

.chart-panel .chart-wrap {
  flex: 1;
  min-height: 300px;
}
.merchant-summary{
	display:grid;
	grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
	gap:14px
}/* 🔥 FIX ANALYTICS SIZE EXACTLY LIKE DASHBOARD */
#analyticsView .chart-wrap {
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.merchant-card{
	background:var(--surface-2);
	border:1px solid var(--line);
	padding:16px;
	border-radius:16px
}
.merchant-card strong{
	display:block;
	margin-bottom:6px
}
.toolbar{
	margin-bottom:16px
}
.toolbar-grid {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;      /* 🔥 keep one line */
  align-items: center;
  overflow-x: auto;       /* 🔥 prevent breaking */
}
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Make search bigger */
#analyticsSearchInput {
  flex: 2;
  min-width: 250px;
}

/* Normal inputs */
.filter-row .input {
  flex: 1;
  min-width: 150px;
}

/* Buttons fixed size */
.filter-row .btn {
  flex: 0 0 auto;
}
/* 🔍 Search (largest) */
#searchInput {
  flex: 3;
  min-width: 450px;
}/* 🔍 Search wider */
#analyticsSearchInput {
  flex: 2;
  min-width: 250px;
}

/* All inputs uniform */
.filter-row .input {
  flex: 1;
  min-width: 150px;
}

/* Date inputs slightly smaller */
#analyticsDateFrom,
#analyticsDateTo {
  flex: 0 0 160px;
}

/* Buttons aligned nicely */
.filter-row .btn {
  flex: 0 0 auto;
}

/* 🔥 Align buttons to right on 2nd row */
.filter-row:last-child {
  justify-content: flex-end;
}

/* 📦 Normal dropdowns */
#modelFilter,
#certifiedBankFilter,
#statusFilter,
#bankTypeFilter {
  flex: 1;
  min-width: 200px;
}

/* 🎯 Ownership (SMALL) */
#ownershipFilter {
  flex: 0 0 90px;   /* 🔥 fixed small width */
  min-width: 90px;
  max-width: 100px;
}
.input{
	width:100%;
	border:1px solid var(--line);
	background:#fff;
	padding:12px 14px;
	border-radius:14px;
	color:var(--text)
}
.input:focus{
	outline:2px solid rgba(61,99,255,.18);
	border-color:var(--brand)
}
.file-input{
	padding:10px
}
.table-wrap{
	overflow:auto;
	border:1px solid var(--line);
	border-radius:18px
}
table{
	width:100%;
	border-collapse:collapse;
	background:#fff;
	min-width:1050px
}
thead{
	background:#eef3ff
}
th,td{
	padding:14px 12px;
	border-bottom:1px solid #edf1f8;
	text-align:left;
	vertical-align:top;
	max-width:450px;
}
tbody tr{
	cursor:pointer
}
tbody tr:hover{
	background:#f9fbff
}
.muted{
	color:var(--muted);
	font-size:12px
}
.badge{
	display:inline-flex;
	align-items:center;
	padding:7px 11px;
	border-radius:999px;
	font-size:12px;
	font-weight:700;
	text-transform: uppercase;
}
.badge.deployed{
	background:#eafaf1;
	color:#0f8b4c
}
.badge.pending{
	background:#fff6df;
	color:#a27200
}
.action-group{
	display:flex;
	gap:8px
}
.action-btn{
	border:none;
	border-radius:10px;
	padding:2px 6px;
	cursor:pointer;
	font-weight:700;
	background:#edf3ff;
	color:#2344ae
}
.action-btn.delete{
	background:#fdecec;
	color:#bf2626
}
.pagination{
	display:flex;
	justify-content:flex-end;
	align-items:center;
	gap:14px;
	margin-top:16px
}
.report-box{
	display:grid;
	gap:12px
}
.report-item{
	display:flex;
	justify-content:space-between;
	gap:12px;
	background:var(--surface-2);
	border:1px solid var(--line);
	padding:4px 6px;
	border-radius:14px;
	margin-top:3px;
	margin-bottom :3px;
}
.stack{
	display:grid;
	gap:12px
}
.note{
	background:#f9fbff;
	border:1px dashed #bfd0ff;
	border-radius:14px;
	padding:14px 16px
}
.note p{
	margin:6px 0 0;
	color:var(--muted)
}
.empty{
	padding:18px;
	text-align:center;
	color:var(--muted)
}
.modal-backdrop{
	position:fixed;
	inset:0;
	background:rgba(14,21,37,.58);
	display:grid;
	place-items:center;
	padding:24px;
	z-index:50
}
.modal-backdrop.hidden{
	display:none
}
.modal{
	width:min(860px,100%);
	max-height:92vh;
	overflow:auto;
	background:#fff;
	border-radius:24px;
	border:1px solid var(--line);
	box-shadow:0 24px 80px rgba(0,0,0,.18);
	padding:20px
}
.modal.wide{
	width:min(1160px,100%)
}
.modal-head{
	display:flex;
	justify-content:space-between;
	align-items:center;
	gap:12px;
	margin-bottom:14px
}
.icon-btn{
	border:none;
	background:#eef2ff;
	width:40px;
	height:40px;
	border-radius:12px;
	font-size:14px;
	cursor:pointer;
	color:#2944ae
}
.form-grid{
	display:grid;
	grid-template-columns:repeat(4,1fr);
	gap:14px
}
.field{
	display:grid;
	gap:8px
}
.field label{
	font-size:13px;
	font-weight:700;
	color:#43506a
}
.field.full{
	grid-column:1/-1
}
.modal-actions{
	grid-column:1/-1;
	display:flex;
	justify-content:flex-end;
	gap:12px;
	padding-top:8px
}
.details-grid{
	display:grid;
	grid-template-columns:repeat(3,1fr);
	gap:14px
}
.detail-item{
	background:var(--surface-2);
	border:1px solid var(--line);
	padding:14px 15px;
	border-radius:15px
}
.detail-item span{
	display:block;
	color:var(--muted);
	font-size:12px;
	margin-bottom:6px
}
.detail-item strong{
	display:block;
	word-break:break-word
}
@media (max-width:1400px){
	.stats-grid{
		grid-template-columns:repeat(3,1fr)
}
	.toolbar-grid{
		grid-template-columns:repeat(2,1fr)
}
	.form-grid{
		grid-template-columns:repeat(3,1fr)
}
}
@media (max-width:1100px){
	.app-shell{
		grid-template-columns:1fr
}
	.sidebar{
		padding-bottom:14px
}
	.panel-grid.two{
		grid-template-columns:1fr
}
	.topbar{
		flex-direction:column
}
}
@media (max-width:820px){
	.stats-grid{
		grid-template-columns:repeat(2,1fr)
}
	.toolbar-grid,.form-grid,.details-grid{
		grid-template-columns:1fr
}
	.main{
		padding:18px
}
}
@media print{
	.sidebar,.topbar-actions,.toolbar,.pagination,.action-group,.modal-backdrop{
		display:none !important
}
	.app-shell{
		display:block
}
	.main{
		padding:0
}
	.view{
		display:block !important
}
	#terminalsView,#settingsView{
		display:none !important
}
	.panel,.stat-card{
		box-shadow:none
}
}
.analytics-upload-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
.upload-dropzone {
	border: 2px dashed #cfd6e4;
	border-radius: 14px;
	padding: 18px;
	min-height: 150px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: #fafcff;
}
.upload-dropzone.dragover {
	border-color: #2563eb;
	background: #eff6ff;
}
.upload-dropzone label {
	font-weight: 700;
	margin-bottom: 10px;
	display: block;
}
@media (max-width: 960px) {
	.analytics-upload-grid {
		grid-template-columns: 1fr;
	}
}
.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #1c1b1b;
	border-top: 4px solid #007bff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin: auto;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
.master-grid{
	display:grid;
	grid-template-columns:repeat(2,minmax(0,1fr));
	gap:18px;
	margin-top:18px;
}
.master-card .panel-head{
	align-items:flex-start;
}
.master-input-row{
	display:grid;
	grid-template-columns:1fr auto;
	gap:12px;
	margin-bottom:14px;
}
.master-table-wrap{
	max-height: 300px;
	overflow-y: auto;
	padding-right: 6px;
}
.master-table-wrap::-webkit-scrollbar {
	width: 6px;
}
.master-table-wrap::-webkit-scrollbar-thumb {
	background: #cfd6e4;
	border-radius: 10px;
}
.master-table{
	min-width:100%;
}
.master-table td:last-child,.master-table th:last-child{
	width:110px;
	text-align:right;
}
.master-data-summary{
	display:flex;
	align-items:center;
	gap:10px;
}
@media (max-width:1100px){
	.master-grid{
		grid-template-columns:1fr;
	}
}
@media (max-width:820px){
	.master-input-row{
		grid-template-columns:1fr;
	}
	.master-table td:last-child,.master-table th:last-child{
		text-align:left;
		width:auto;
	}
}
.timeline {
	margin-top: 20px;
	border-left: 3px solid #ddd;
	padding-left: 20px;
	max-height: 450px;
	overflow-y: auto;
	scroll-behavior: smooth;
	padding-right: 10px;
	/* space for scrollbar */
}
.timeline-item {
	position: relative;
	margin-bottom: 20px;
}
.timeline-dot {
	position: absolute;
	left: -10px;
	top: 5px;
	width: 12px;
	height: 12px;
	background: #007bff;
	border-radius: 50%;
}
.timeline-content {
	background: #f8f9fa;
	padding: 10px 15px;
	border-radius: 6px;
}
.timeline-content strong {
	display: block;
	margin-bottom: 5px;
}
.timeline-content .time {
	font-size: 12px;
	color: #777;
}
.timeline-wrapper {
	max-height: 450px;
	overflow-y: auto;
}
.master-table-wrap {
	max-height: 250px;
	/* 🔥 control height */
	overflow-y: auto;
	/* 🔥 vertical scroll */
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 5px;
}
.user-box {
	display: flex;
	align-items: center;
	gap: 15px;
}
/* User info */
.user-info {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f1f5f9;
	padding: 6px 12px;
	border-radius: 20px;
	font-weight: 600;
	color: #0f172a;
}
/* Icon */
.user-icon {
	background: #F1FF5C;
	color: #fff;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 14px;
}
/* Logout button */
.logout-btn {
	background: #ef4444;
	color: white;
	border: none;
	padding: 8px 14px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition: 0.3s;
}
.logout-btn:hover {
	background: #dc2626;
}
.log-table-wrapper {
	max-height: 750px;
	/* adjust as needed */
	overflow-y: auto;
	border: 1px solid #ddd;
	border-radius: 6px;
}
/* Optional: sticky header */
.log-table-wrapper thead th {
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 2;
}
#logSearchInput {
	width:30%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	outline: none;
	transition: all 0.2s ease;
	margin-bottom: 12px;
}
#logSearchInput:focus {
	border-color: #4a90e2;
	box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}
.permissions-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin-top: 10px;
}
.perm-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 5px 7px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 14px;
}
.perm-card:hover {
	background: #f9fbff;
	border-color: #4a90e2;
}
.perm-card input {
	width: 10px;
	height: 18px;
	cursor: pointer;
}
.report-box {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}
.report-item:hover {
	box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.report-label {
	font-size: 12px;
	color: #3f3d3d;
	margin-bottom: 4px;
}
.report-value {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}
.btn.btn-success {
	background-color: #f1ff5c !important;
	color: #000000 !important;
}
.badge.in-stock {
  background: #e4963d;
  color: white;
}

.badge.deployed {
  background: #28a745;
  color: white;
}

.badge.defective {
  background: #dc3545;
  color: white;
}
.list-item {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px;
  border-bottom:1px solid #eee;
}

.list-item .clickable {
  cursor:pointer;
}

.list-item.clickable:hover {
  background:#f5f5f5;
}
.disabled-comment {
  background-color: #F0F0F0;  /* light grey */
  color: #777;                /* faded text */
  border: 1px solid #ddd;
  cursor: not-allowed;
}

.editable-comment {
  background-color: #fff;     /* normal white */
  color: #000;
  border: 1px solid #4CAF50;  /* highlight when editing */
}
.status-select {
  font-weight: bold;
  border-radius: 20px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

/* Colors */
.status-in-stock {
  background: #f39c12;
  color: #fff;
}

.status-deployed {
  background: #28a745;
  color: #fff;
}

.status-defective {
  background: #e74c3c;
  color: #fff;
}
.switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#ownershipSwitch {
  width: 40px;
  height: 20px;
  appearance: none;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: 0.3s;
}

#ownershipSwitch::before {
  content: '';
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}

/* ✅ PAID */
#ownershipSwitch:checked {
  background: #28a745;
}

#ownershipSwitch:checked::before {
  transform: translateX(20px);
}

/* Label colors */
#ownershipLabel.free {
  color: #888;
}

#ownershipLabel.paid {
  color: #28a745;
  font-weight: bold;
}
/* Ownership colors */
.badge.ownership-paid {
  background: #28a745;
  color: #fff;
}

.badge.ownership-free {
  background: #95a5a6;
  color: #fff;
}
/* SMALL BADGE ONLY FOR DETAILS VIEW */
.badge-sm {
  width: 60px;
  height: 28px;              /* 🔥 control height */
  font-size: 10px;
  border-radius: 10px;
  font-weight: 500;

  display: inline-flex;
  justify-content: center;
  align-items: center;

  padding: 0;                /* 🔥 remove extra padding */
  line-height: 1;            /* 🔥 prevent extra vertical space */
}
#ownershipChart {
  display: block;
}
#exportJsonBtn {
  display: none;
}
.full-width {
  width: 100%;
}
.panel-grid.two .full-width {
  grid-column: span 2;
}
/* 🔹 COMMON REPORT CONTAINER FIX */
.report-box {
  display: block;
}

/* 🔹 STANDARD ROW (USE THIS EVERYWHERE) */
.report-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  box-sizing: border-box;
}

/* 🔹 COLUMNS */
.col-serial {
  width: 30%;
  font-weight: 600;
}

.col-merchant {
  width: 45%;
  text-align: left;
}

.col-date {
  width: 25%;
  text-align: right;
  color: #777;
}

/* 🔹 OPTIONAL HOVER */
.report-line:hover {
  background: #f8f9fb;
}

/* 🔹 EMPTY STATE */
.empty {
  font-size: 12px;
  color: #999;
  padding: 10px 0;
}
#recentDeploymentReport,
#recentWithdrawReport {
  max-height: 260px;   /* ~8 rows */
  overflow-y: auto;
  padding-right: 6px;
}

/* smooth scrollbar */
#recentDeploymentReport::-webkit-scrollbar,
#recentWithdrawReport::-webkit-scrollbar {
  width: 6px;
}

#recentDeploymentReport::-webkit-scrollbar-thumb,
#recentWithdrawReport::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.section-divider {
  width: 100%;
  height: 1px;
  background: #a4a692;
  margin: 20px 0;
  opacity: 0.8;
}
.ownership-paid {
  background: #28a745;
  color: #fff;
}

.ownership-free {
  background: #aaa;
  color: #fff;
}
.highlight-filter {
  background-color: #fff3cd;   /* light yellow */
  border: 1px solid #ffeeba;
}

.highlight-filter:focus {
  outline: none;
  border-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}
.badge.matched {
    background: #198754;
    color: #fff;
}

.badge.unmatched {
    background: #dc3545;
    color: #fff;
}

.badge.matched-old {
    background: #ff0000;
    color: #fff;
}
#analyticsModeLabel{
    font-size:15px;
    color:#6b7280;
    font-weight:500;
}
.live-switch .live-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #00c853;
}

.live-switch .live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00ff5e;
  box-shadow: 0 0 8px #00ff5e;
  animation: liveBlink 1s infinite;
}

@keyframes liveBlink {

  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.3;
    transform: scale(1.4);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.chart-row{
  display:flex;
  gap:20px;
  width:100%;
}

.chart-panel.half{
  flex:1;
}
.terminal-left{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.terminal-model{
  font-size:12px;
  color:#777;
  padding-left:28px;
}.custom-btn {
   width: 200px;
  padding: 2px;
  margin: 2px;
  height: 50px;
}.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stock-terminal-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding: 14px 18px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;

    width: 100%;
}

.stock-terminal-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stock-terminal-details {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.stock-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-date-box {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
}

.stock-terminal-icon {
    font-size: 24px;
}

.stock-label {
    font-weight: 600;
    color: #6b7280;
}

.stock-value {
    font-weight: 700;
    color: #111827;
}

.model-value {
  color: #eb2525;
}

.stock-terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-action-btn {
  width: 36px;
  height: 34px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

.stock-action-btn.edit {
  background: #eef4ff;
}

.stock-action-btn.delete {
  background: #fff1f2;
}

.stock-action-btn:hover {
  transform: scale(1.05);
}

#inStockList {
  max-height: 720px;
  overflow-y: auto;
  padding-right: 8px;
}#inStockList::-webkit-scrollbar {
  width: 8px;
}

#inStockList::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#inStockList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#inStockList::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
#defectiveList {
  max-height: 720px;
  overflow-y: auto;
  padding-right: 8px;
}
#defectiveList::-webkit-scrollbar {
  width: 8px;
}

#defectiveList::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#defectiveList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#defectiveList::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.stock-date-box {
  min-width: 140px;
  text-align: right;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.stock-date-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stock-date-value {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.defective-date-box {
  background: #fff7ed;
  border-color: #fed7aa;
}

.defective-date-box .stock-date-value {
  color: #c2410c;
}
.ownership-outright {
  background: #00b13e;
  color: #0f0f0f;
}

.ownership-rental {
  background: #eb830c;
  color: #070707;
}
#deployedOwnershipSummary::-webkit-scrollbar,
#ownershipDecisionHistory::-webkit-scrollbar {
  width: 8px;
}

#deployedOwnershipSummary::-webkit-scrollbar-thumb,
#ownershipDecisionHistory::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#deployedOwnershipSummary::-webkit-scrollbar-track,
#ownershipDecisionHistory::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.badge.dispatched,
.status-dispatched {
  background: #dbeafe;
  color: #1d4ed8;
}
.scroll-report-box {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.scroll-report-box::-webkit-scrollbar {
  width: 6px;
}

.scroll-report-box::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.scroll-report-box::-webkit-scrollbar-thumb {
  background: #b8b8b8;
  border-radius: 10px;
}

.scroll-report-box::-webkit-scrollbar-thumb:hover {
  background: #888;
}
.paper-rolls-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 16px;
  align-items: start;
}

.paper-roll-list,
.paper-roll-history {
  margin-top: 14px;
  max-height: 650px;
  overflow-y: auto;
}

.paper-roll-terminal-card {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.paper-roll-terminal-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.selected-terminal-box {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

@media (max-width: 1100px) {
  .paper-rolls-grid {
    grid-template-columns: 1fr;
  }
}
.paper-roll-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paper-roll-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.paper-roll-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.paper-roll-field span {
  line-height: 1.2;
}

.paper-roll-field input,
.paper-roll-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.paper-roll-field textarea {
  resize: vertical;
  min-height: 84px;
}

.paper-roll-submit-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.selected-terminal-box {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
  overflow-x: auto;
}

.selected-terminal-box .report-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

@media (max-width: 900px) {
  .paper-roll-form-row {
    grid-template-columns: 1fr;
  }
}
.paper-roll-stock-section {
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.paper-roll-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.paper-roll-stock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.paper-roll-stock-tile {
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.paper-roll-stock-tile span {
  display: block;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 6px;
}

.paper-roll-stock-tile strong {
  display: block;
  font-size: 34px;
  color: #111827;
  line-height: 1;
}

.paper-roll-stock-tile small {
  display: block;
  margin-top: 6px;
  color: #64748b;
}

.paper-roll-stock-tile.total {
  background: #f1ff5c;
}

.paper-roll-stock-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.paper-roll-stock-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.paper-roll-stock-history {
  margin-top: 10px;
}

.paper-roll-stock-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

@media (max-width: 1100px) {
  .paper-roll-stock-stats {
    grid-template-columns: 1fr;
  }

  .paper-roll-stock-form {
    grid-template-columns: 1fr;
  }
}
.paper-roll-stock-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.paper-roll-stock-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.paper-roll-stock-check input {
  width: 18px;
  height: 18px;
  accent-color: #111827;
}

.paper-roll-stock-check:has(input:checked) {
  border-color: #111827;
  background: #f1ff5c;
}

@media (max-width: 900px) {
  .paper-roll-stock-checks {
    grid-template-columns: 1fr;
  }
}
#paperRollStockEntryList {
  display: grid;
  gap: 8px;
  min-height: 430px; /* shows around 5 entries */
  overflow-y: auto;
  padding-right: 6px;
  max-height: 220px;
  overflow-y: auto;
}

#paperRollStockEntryList::-webkit-scrollbar {
  width: 6px;
}

#paperRollStockEntryList::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

#paperRollStockEntryList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#paperRollStockEntryList::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.paper-roll-stock-entry {
  min-height: 56px;
}
.history-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.history-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.history-left-panel,
.history-right-panel {
  min-height: 550px;
}

.dba-change-card {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.dba-change-card strong {
  display: block;
  color: #111827;
  margin-bottom: 6px;
}

.dba-change-arrow {
  margin: 10px 0;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
}

.dba-old {
  color: #dc2626;
  font-weight: 700;
}

.dba-new {
  color: #16a34a;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .history-two-column {
    grid-template-columns: 1fr;
  }

  .history-search-row {
    flex-direction: column;
  }
}
/* ✅ Terminal History + DBA Assignment scroll fix */
.timeline-box,
.dba-assignment-scroll {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
}

/* optional: nice scrollbar */
.timeline-box::-webkit-scrollbar,
.dba-assignment-scroll::-webkit-scrollbar {
  width: 8px;
}

.timeline-box::-webkit-scrollbar-track,
.dba-assignment-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.timeline-box::-webkit-scrollbar-thumb,
.dba-assignment-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.timeline-box::-webkit-scrollbar-thumb:hover,
.dba-assignment-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
@media print {

  /* Page setup */
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  /* Hide common app layout */
  body.printing-current-view .sidebar,
  body.printing-current-view .topbar,
  body.printing-current-view .nav,
  body.printing-current-view .nav-link,
  body.printing-current-view .modal-backdrop,
  body.printing-current-view button,
  body.printing-current-view .btn,
  body.printing-current-view .action-group,
  body.printing-current-view .pagination,
  body.printing-current-view #globalLoader {
    display: none !important;
  }

  /* Hide all views first */
  body.printing-current-view .view {
    display: none !important;
  }

  /* Print only active view */
  body.printing-current-view .view.active {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }

  /* Remove large app spacing */
  body.printing-current-view .main,
  body.printing-current-view .content,
  body.printing-current-view .app,
  body.printing-current-view main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Avoid blank pages from fixed/min heights */
  body.printing-current-view *,
  body.printing-current-view *::before,
  body.printing-current-view *::after {
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  body.printing-current-view .panel,
  body.printing-current-view .card,
  body.printing-current-view .report-card,
  body.printing-current-view .chart-card,
  body.printing-current-view .paper-roll-stock-section,
  body.printing-current-view .history-left-panel,
  body.printing-current-view .history-right-panel {
    page-break-inside: avoid;
    break-inside: avoid;
    min-height: 0 !important;
  }

  /* Scroll areas should print content naturally, not create empty pages */
  body.printing-current-view .scroll-report-box,
  body.printing-current-view .timeline-box,
  body.printing-current-view .dba-assignment-scroll,
  body.printing-current-view #paperRollStockEntryList,
  body.printing-current-view #paperRollTerminalList,
  body.printing-current-view #paperRollHistoryList {
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Charts/tables fit page */
  body.printing-current-view canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  body.printing-current-view table {
    width: 100% !important;
    border-collapse: collapse !important;
    page-break-inside: auto;
  }

  body.printing-current-view tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
.paper-roll-stock-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  align-items: start;
}

.paper-roll-stock-left,
.paper-roll-stock-right {
  min-width: 0;
}

.paper-roll-stock-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paper-roll-stock-chart-card,
.paper-roll-top-merchants-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.paper-roll-pie-wrap {
  height: 260px;
  position: relative;
}

.paper-roll-top-merchants {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.paper-roll-top-merchant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.paper-roll-top-merchant-row:last-child {
  border-bottom: none;
}

.paper-roll-top-merchant-name {
  font-weight: 700;
  color: #111827;
  font-size: 13px;
  line-height: 1.3;
}

.paper-roll-top-merchant-meta {
  color: #6b7280;
  font-size: 12px;
  margin-top: 3px;
}

.paper-roll-top-merchant-qty {
  flex-shrink: 0;
  min-width: 54px;
  text-align: right;
  font-weight: 800;
  color: #111827;
}

@media (max-width: 1100px) {
  .paper-roll-stock-layout {
    grid-template-columns: 1fr;
  }
}
.paper-roll-stock-entry-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 12px 14px;
}

.paper-roll-entry-area {
  min-width: 80px;
  color: #111827;
}

.paper-roll-entry-note {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-roll-entry-by {
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .paper-roll-stock-entry-line {
    flex-wrap: wrap;
  }

  .paper-roll-entry-note,
  .paper-roll-entry-by {
    white-space: normal;
  }
}
.stat-card {
  transition: 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.analytics-click-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.analytics-click-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
.analytics-filter-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #475569;
}

.analytics-filter-summary strong {
  color: #111827;
  font-weight: 800;
}
.select2-container .select2-selection--single {
    height: 42px !important;
    padding-top: 5px;
    border-radius: 10px !important;
}
.status-removed {
  background: #333;
  color: #fff;
}

.status-swap {
  background: #7c3aed;
  color: #fff;
}

.badge.removed {
  background: #333;
  color: #fff;
}

.badge.swap {
  background: #7c3aed;
  color: #fff;
}
.removed-tag {
  background: #333;
  color: #fff;
  margin-left: 4px;
}

.swap-tag {
  background: #3a73ed;
  color: #fff;
  margin-left: 4px;
}
.new-tag {
  background: #16a34a;
  color: #fff;
}


.details-edit-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-filter {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.badge-filter-btn {
  border: 1px solid #ddd;
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.badge-filter-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #16a34a;
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}