/* الخطوط من jsDelivr CDN (لا طلبات لـ Google Fonts أو الاستضافة) */
@font-face{
	font-family:'IBM Plex Sans Arabic';
	font-style:normal;
	font-weight:400;
	font-display:swap;
	src:url('https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans-arabic@5.0.8/files/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
}
@font-face{
	font-family:'IBM Plex Sans Arabic';
	font-style:normal;
	font-weight:500;
	font-display:swap;
	src:url('https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans-arabic@5.0.8/files/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
}
@font-face{
	font-family:'IBM Plex Sans Arabic';
	font-style:normal;
	font-weight:600;
	font-display:swap;
	src:url('https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans-arabic@5.0.8/files/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
}
@font-face{
	font-family:'IBM Plex Sans Arabic';
	font-style:normal;
	font-weight:700;
	font-display:swap;
	src:url('https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans-arabic@5.0.8/files/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2');
}
:root{--bg:#efefef;--card:#ffffff;--accent:#2b6cb0;--text:#222}
*{box-sizing:border-box;font-family:"IBM Plex Sans Arabic","Tajawal","Scheherazade New",sans-serif}
html,body{
	height:100%;
	margin:0;
	background:var(--bg);
	color:var(--text);
	touch-action:pan-y;
	overscroll-behavior-y:contain;
	overscroll-behavior-x:none;
}
.sticky-controls {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 200;
	background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
	transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
	opacity: 1;
	visibility: visible;
}
.logo-container {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 10px 10px 0;
	width: 100%;
}
.top-logo {
	height: 40px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}
.floating-burger-btn{
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
	font-size: 28px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 28px rgba(43,108,176,0.45);
	cursor: pointer;
	z-index: 240;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-burger-btn span{
	line-height: 1;
	display: block;
}
.floating-burger-btn:hover{
	transform: translateY(-3px);
	box-shadow: 0 16px 36px rgba(23,58,95,0.55);
	}
.floating-burger-btn:active{
	transform: translateY(0);
	box-shadow: 0 8px 18px rgba(23,58,95,0.5);
}
@media (max-width:600px){
	.floating-burger-btn{
		width: 56px;
		height: 56px;
		font-size: 24px;
		bottom: 18px;
		right: 18px;
	}
}
.sticky-controls::after{
	content:'';
	position:absolute;
	bottom:0;
	left:0;
	right:0;
	height:3px;
	background:linear-gradient(90deg,var(--accent) 0%,rgba(43,108,176,0.3) 100%);
}
.topbar{background:var(--accent);color:#fff;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;position:relative;z-index:199;margin-top:auto}
.topbar h1{margin:0;font-size:18px}
.install-btn{background:rgba(255,255,255,0.12);border:0;color:#fff;padding:8px 12px;border-radius:6px}
.sticky-controls.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.controls{
	display:flex;
	gap:6px;
	align-items:center;
	padding:6px 10px;
	flex-wrap:wrap;
	max-width:1400px;
	margin:0 auto;
}
.search-wrapper{
	position:relative;
	flex:1 1 100%;
	width:100%;
	display:flex;
	align-items:center;
	order:1;
}
#search{
	width:100%;
	padding:10px 12px 12px;
	padding-left:56px;
	border-radius:6px;
	border:2px solid #e1e8ed;
	font-size:16px;
	font-weight:600;
	background:#ffffff;
	transition:all 0.3s ease;
	box-shadow:0 2px 4px rgba(0,0,0,0.02);
	min-height:44px;
}
#search:focus{
	outline:none;
	border-color:var(--accent);
	box-shadow:0 0 0 3px rgba(43,108,176,0.1), 0 2px 8px rgba(0,0,0,0.05);
	background:#ffffff;
}
#search::placeholder{
	color:#94a3b8;
	font-weight:600;
	font-size:15px;
}
.clear-search{
	position:absolute;
	left:10px;
	top:50%;
	transform:translateY(-50%) scale(0.9);
	width:34px;
	height:34px;
	border-radius:50%;
	border:none;
	background:linear-gradient(135deg,#ff6b6b 0%,#f06595 100%);
	color:#fff;
	font-size:18px;
	font-weight:700;
	display:flex;
	align-items:center;
	justify-content:center;
	cursor:pointer;
	box-shadow:0 4px 12px rgba(240,101,149,0.4);
	transition:all 0.25s ease;
	opacity:0;
	pointer-events:none;
}
.clear-search span{
	line-height:1;
	transform:translateY(-1px);
}
.search-wrapper.has-value .clear-search{
	opacity:1;
	pointer-events:auto;
	transform:translateY(-50%) scale(1);
}
.summary-button{
	padding:6px 14px;
	background:linear-gradient(135deg,var(--accent) 0%,#1f4f82 100%);
	color:#fff;
	border:none;
	border-radius:6px;
	cursor:pointer;
	font-weight:600;
	font-size:14px;
	transition:all 0.3s ease;
	box-shadow:0 4px 12px rgba(43,108,176,0.3);
	position:relative;
	overflow:hidden;
	order:2;
	white-space:nowrap;
}
.summary-button::before{
	content:'';
	position:absolute;
	top:0;
	left:-100%;
	width:100%;
	height:100%;
	background:linear-gradient(90deg,transparent,rgba(255,255,255,0.2),transparent);
	transition:left 0.5s;
}
.summary-button:hover::before{
	left:100%;
}
.summary-button:hover{
	background:linear-gradient(135deg,#1f4f82 0%,#173a5f 100%);
	transform:translateY(-2px);
	box-shadow:0 6px 16px rgba(43,108,176,0.4);
}
.summary-button:active{
	transform:translateY(0);
	box-shadow:0 2px 8px rgba(43,108,176,0.3);
}
.bubble{
	background:linear-gradient(135deg,#ffd89b 0%,#ffecd2 100%);
	padding:6px 14px;
	border-radius:18px;
	font-weight:700;
	font-size:14px;
	color:#8b5a2b;
	box-shadow:0 4px 12px rgba(255,217,155,0.3);
	border:2px solid rgba(255,217,155,0.5);
	white-space:nowrap;
	transition:all 0.3s ease;
	order:3;
}
.bubble:hover{
	transform:scale(1.02);
	box-shadow:0 6px 16px rgba(255,217,155,0.4);
}
@media (max-width:600px){
	.controls{
		padding:8px 10px;
		gap:6px;
		align-items:stretch;
		flex-wrap:wrap;
	}
	.search-wrapper{
		width:100%;
		flex:1 1 100%;
	}
	#search{
		width:100%;
		padding:12px 14px;
		padding-left:66px;
		font-size:16px;
		font-weight:600;
		border-radius:6px;
		min-height:48px;
	}
	.clear-search{
		left:12px;
		width:36px;
		height:36px;
	}
	.summary-button{
		order:2;
		flex:1 1 calc(50% - 4px);
		min-width:0;
		padding:10px 14px;
		font-size:15px;
		border-radius:8px;
	}
	.bubble{
		order:3;
		flex:1 1 calc(50% - 4px);
		min-width:0;
		text-align:center;
		padding:10px 14px;
		font-size:17px;
		border-radius:20px;
	}
}
.cards{padding:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.card{
	background:var(--card);
	padding:12px;
	border-radius:12px;
	box-shadow:0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
	display:flex;
	flex-direction:column;
	gap:8px;
	border:1px solid rgba(0,0,0,0.06);
	transition:all 0.3s ease;
	position:relative;
	overflow:hidden;
}
.card::before{
	content:'';
	position:absolute;
	top:0;
	left:0;
	right:0;
	height:3px;
	background:linear-gradient(90deg,var(--accent) 0%,rgba(43,108,176,0.3) 100%);
	transform:scaleX(1);
}
.card::after{
	content:'';
	position:absolute;
	bottom:0;
	left:0;
	right:0;
	height:3px;
	background:linear-gradient(135deg,#ffd89b 0%,#ffecd2 100%);
	transform:scaleX(1);
}
.card:hover{
	transform:translateY(-2px);
	box-shadow:0 8px 20px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
	border-color:rgba(43,108,176,0.15);
}
.card .title{
	font-weight:700;
	font-size:17px;
	color:#1a202c;
	line-height:1.4;
	display:inline-flex;
	align-items:center;
	padding:6px 14px;
	background:linear-gradient(135deg,#ffd89b 0%,#ffecd2 100%);
	border-radius:18px;
	border:2px solid rgba(255,193,7,0.4);
	box-shadow:0 4px 12px rgba(255,193,7,0.25);
	white-space:nowrap;
	gap:6px;
}
.card .title.target-highlight{
	background:linear-gradient(135deg,#b6f0ce 0%,#2f855a 100%);
	border:2px solid rgba(47,133,90,0.35);
	color:#0c3c20;
	box-shadow:0 4px 12px rgba(47,133,90,0.35);
}
.highlight-material{
	color:#0b6623 !important;
}
@media (max-width:600px){
	.card .title{
		font-size:19px;
		padding:8px 16px;
		border-radius:20px;
	}
}
.card .info{
	font-size:18px;
	color:#4a5568;
	font-weight:500;
}
.price-info{
	display:flex;
	align-items:center;
	justify-content:flex-start;
	gap:4px;
}
.price-info .unit-price{
	font-size:18px;
	color:#0b6623;
	font-weight:500;
	margin-inline-start:auto;
}
.row{display:flex;gap:8px;align-items:center}
.input{
	flex:1;
	padding:10px;
	border:2px solid #2b6cb0;
	border-radius:6px;
	background:rgba(255,255,255,0.9);
	height:44px;
	font-size:16px;
	font-weight:700;
	color:#1f2937;
}
.input::placeholder {
	color: #aaa;
	opacity: 1;
	font-size: 14px;
}
.input[type=number]{appearance:textfield;-moz-appearance:textfield;}
.small{width:90px}
@media (max-width:600px){
	.input{
		height:48px;
		padding:12px;
		font-size:18px;
		font-weight:700;
	}
	.small{width:100px}
}
@media (min-width:900px){
	.card .title{font-size:16px;}
	.card .info{font-size:17px;}
	.price-info .unit-price{font-size:17px;}
	.input{font-size:15px;}
}

@media (min-width:600px) and (max-width:1024px){
	.card{
		gap:10px;
	}
	.card .title{
		white-space:normal;
		word-break:break-word;
		font-size:18px;
		line-height:1.5;
		display:flex;
		flex-wrap:wrap;
		justify-content:flex-start;
	}
	.card .info{
		font-size:17px;
	}
	.price-info{
		flex-direction:column;
		align-items:flex-start;
		gap:2px;
	}
	.price-info .unit-price{
		margin-inline-start:0;
		font-size:17px;
	}
	.row{
		flex-wrap:wrap;
		gap:10px;
	}
	.input{
		flex:1 1 calc(50% - 10px);
		min-width:140px;
	}
	.small{
		width:auto;
	}
}
@media (min-width:600px) and (max-width:1024px) and (orientation:landscape){
	.card .title{
		white-space:nowrap;
		flex-wrap:nowrap;
	}
	.price-info{
		flex-direction:row;
		align-items:center;
		gap:4px;
	}
	.price-info .unit-price{
		margin-inline-start:auto;
	}
}
.footer{padding:12px;text-align:center;color:#666}
.modal{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;z-index:400}
.modal.hidden{display:none}
.modal-content{background:#fff;padding:16px;border-radius:8px;width:95%;max-width:800px;max-height:90%;overflow:auto}
.summary-logo-container {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 0;
	border-bottom: 2px solid rgba(43,108,176,0.1);
}
.summary-logo {
	height: 40px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}
.summary-header{
	display:flex;
	align-items:center;
	justify-content:space-between;
	margin:0 0 16px 0;
	padding-bottom:12px;
	border-bottom:2px solid rgba(43,108,176,0.1);
}
.pharmacist-name{
	font-weight:700;
	font-size:20px;
	color:#1a202c;
}
.payment-display{
	font-weight:700;
	font-size:18px;
	color:var(--accent);
	direction:ltr;
	text-align:left;
}
.modal-content h2{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px 0}
.modal-content .pharmacist{font-weight:700;font-size:18px;color:#333}
.summary-table{width:100%;border-collapse:collapse;margin-bottom:16px}
.summary-table tbody tr:nth-child(odd){background:rgba(255,193,7,0.12)}
.summary-table tbody tr:nth-child(even){background:rgba(255,255,255,0.98)}
.summary-table td{padding:6px 6px;border-bottom:1px solid rgba(0,0,0,0.12)}
.summary-table tbody tr{border-bottom:1px solid rgba(0,0,0,0.12)}
.summary-table td:first-child{text-align:right;font-weight:700;padding-right:6px;font-size:15px}
.summary-table td:nth-child(2){text-align:left;white-space:nowrap;padding-left:6px;padding-right:6px}
.summary-index{
	display:inline-block;
	min-width:26px;
	margin-left:2px;
	margin-right:2px;
	color:#16a34a;
	font-weight:800;
	font-size:16px;
}
.summary-name{display:inline-block;}
.count-cell{display:inline-flex;gap:2px;align-items:center;justify-content:flex-start;direction:ltr}
.count-cell .plus{font-weight:700;color:rgba(0,0,0,0.6);padding:0 2px;display:inline-block;margin:0 4px}
.count-cell .bonus{min-width:28px;height:28px;text-align:center;padding:4px 6px;border:2px solid rgba(0,0,0,0.3);border-radius:50%;font-weight:600;display:flex;align-items:center;justify-content:center}
.count-cell .bonus.hidden{display:none}
.count-cell .qty{min-width:28px;height:28px;text-align:center;padding:4px 6px;border:2px solid rgba(0,0,0,0.3);border-radius:50%;font-weight:600;display:flex;align-items:center;justify-content:center}
.summary-footer{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-top:12px;flex-wrap:wrap}
.summary-footer #finalTotal{font-weight:700;}
.summary-actions{display:flex;gap:8px;flex-wrap:wrap}
.capture-frame{
	width:420px!important;
	max-width:420px!important;
	margin:0 auto;
	border-radius:24px;
	border:1px solid rgba(0,0,0,0.08);
	padding:16px 16px 24px;
	box-shadow:0 16px 40px rgba(0,0,0,0.15);
}
.capture-frame .summary-header{
	flex-direction:row;
	align-items:center;
	justify-content:space-between;
	gap:12px;
	width:100%;
}
.capture-frame .pharmacist-name{
	font-size:20px;
	white-space:nowrap;
	word-wrap:normal;
	word-break:normal;
	letter-spacing:normal;
	font-stretch:normal;
	display:inline-block;
	overflow:visible;
	text-overflow:clip;
}
.capture-frame .payment-display{
	font-size:18px;
	margin-inline-start:auto;
	padding-inline-start:0;
	align-self:flex-start;
	text-align:left;
}
.capture-frame .summary-footer{
	flex-direction:column;
	align-items:flex-start;
	gap:10px;
}
.capture-frame #finalTotal{
	width:100%;
	text-align:left;
	font-weight:600;
}
.capture-frame .summary-actions{
	width:100%;
	justify-content:flex-start;
}
.capture-frame .summary-actions button{
	min-width:120px;
}
.capture-frame .summary-table td:first-child{
	font-size:16px;
}
.capture-frame .summary-table td:nth-child(2){
	font-size:15px;
}
#finalTotal .total-amount{
	display:inline-flex;
	align-items:center;
	gap:4px;
	direction:ltr;
	font-weight:700;
}
#finalTotal .currency{
	font-size:0.95em;
	margin-inline-end:2px;
}
#finalTotal .amount{
	letter-spacing:0.02em;
}
.summary-actions button{
	padding:8px 16px;
	border:none;
	border-radius:6px;
	cursor:pointer;
	font-weight:600;
	font-size:14px;
	transition:all 0.3s ease;
	position:relative;
	overflow:hidden;
	min-width:90px;
	box-shadow:0 2px 6px rgba(0,0,0,0.1);
}
.summary-actions button::before{
	content:'';
	position:absolute;
	top:50%;
	left:50%;
	width:0;
	height:0;
	background:rgba(255,255,255,0.2);
	border-radius:50%;
	transform:translate(-50%,-50%);
	transition:width 0.6s,height 0.6s;
}
.summary-actions button:active::before{
	width:300px;
	height:300px;
}
.summary-actions button[disabled],
.summary-actions button[disabled]:hover,
.summary-actions button[disabled]:active{
	opacity:0.65;
	cursor:not-allowed;
	transform:none;
	box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
#shareImage{
	background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
	color:#fff;
}
#shareImage:hover{
	background:linear-gradient(135deg,#5568d3 0%,#653a8f 100%);
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(102,126,234,0.4);
}
#shareImage:active{
	transform:translateY(0);
	box-shadow:0 2px 6px rgba(102,126,234,0.3);
}
#closeSummary{
	background:linear-gradient(135deg,#f093fb 0%,#f5576c 100%);
	color:#fff;
}
#closeSummary:hover{
	background:linear-gradient(135deg,#e081f0 0%,#e4465a 100%);
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(245,87,108,0.4);
}
#closeSummary:active{
	transform:translateY(0);
	box-shadow:0 2px 6px rgba(245,87,108,0.3);
}
@media (max-width:600px){
	.summary-actions{
		width:100%;
		justify-content:stretch;
	}
	.summary-actions button{
		flex:1;
		min-width:0;
		padding:10px 16px;
		font-size:15px;
	}
	.summary-footer{
		flex-direction:column;
		align-items:stretch;
	}
	#finalTotal{
		text-align:center;
		margin-bottom:8px;
		font-size:18px;
		font-weight:700;
	}
}
@media (max-width:1024px){
	.cards{
		grid-template-columns:1fr;
		max-width:540px;
		margin:0 auto;
	}
}

/* increase spacing between top controls and first card on small screens */
@media (max-width:600px){
	main{padding-top:calc(205px + 40px + 2px)}
}

/* ensure main content is not hidden under fixed controls */
/* المسافة = ارتفاع الصورة (40px) + padding علوي (2px) + controls padding + controls height */
main{padding-top:calc(140px + 40px + 2px)}

/* Pharmacist input modal */
.pharmacist-modal{
	position:fixed;
	inset:0;
	background:rgba(0,0,0,0.6);
	backdrop-filter:blur(4px);
	-webkit-backdrop-filter:blur(4px);
	display:flex;
	align-items:center;
	justify-content:center;
	z-index:500;
}
.pharmacist-modal.hidden{display:none}
.pharmacist-modal-content{
	background:#fff;
	padding:24px;
	border-radius:16px;
	width:90%;
	max-width:420px;
	box-shadow:0 8px 32px rgba(0,0,0,0.2);
	animation:modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn{
	from{
		opacity:0;
		transform:translateY(-20px) scale(0.95);
	}
	to{
		opacity:1;
		transform:translateY(0) scale(1);
	}
}
.pharmacist-modal-content h3{
	margin:0 0 20px 0;
	font-size:20px;
	color:#1a202c;
	font-weight:700;
	text-align:center;
}
.pharmacist-input-wrapper{
	position:relative;
	width:100%;
	margin-bottom:14px;
}
.pharmacist-modal-content input{
	width:100%;
	padding:14px 16px;
	border:2px solid #e1e8ed;
	border-radius:10px;
	font-size:17px;
	font-weight:600;
	margin-bottom:0;
	background:#ffffff;
	transition:all 0.3s ease;
	box-shadow:0 2px 4px rgba(0,0,0,0.02);
}
#pharmacistInput, #paymentInput{
	padding-bottom:12px;
	line-height:1.4;
}
.length-warning{
	display:inline-block;
	position:absolute;
	bottom:-8px;
	left:12px;
	background:linear-gradient(135deg,#ff6b6b 0%,#f5576c 100%);
	color:#fff;
	padding:6px 12px;
	border-radius:8px;
	font-size:12px;
	font-weight:600;
	box-shadow:0 4px 12px rgba(245,87,108,0.4);
	white-space:nowrap;
	z-index:10;
	animation:warningFadeIn 0.3s ease;
	pointer-events:none;
}
.length-warning::before{
	content:'';
	position:absolute;
	top:-6px;
	left:16px;
	width:0;
	height:0;
	border-left:6px solid transparent;
	border-right:6px solid transparent;
	border-bottom:6px solid #f5576c;
}
.length-warning.hidden{
	display:none;
}
@keyframes warningFadeIn{
	from{
		opacity:0;
		transform:translateY(-4px) scale(0.9);
	}
	to{
		opacity:1;
		transform:translateY(0) scale(1);
	}
}
@media (min-width:900px){
	#pharmacistInput, #paymentInput{
		padding-bottom:16px;
	}
}
.pharmacist-modal-content input:focus{
	outline:none;
	border-color:var(--accent);
	box-shadow:0 0 0 3px rgba(43,108,176,0.1), 0 2px 8px rgba(0,0,0,0.05);
}
.pharmacist-modal-content input::placeholder{
	color:#94a3b8;
}
#paymentInput{
	margin-bottom:14px;
}
.pharmacist-actions{
	display:flex;
	gap:12px;
	justify-content:flex-end;
	margin-top:8px;
	flex-wrap: wrap;
}
.pharmacist-actions button{
	padding:16px 24px;
	border:none;
	border-radius:10px;
	cursor:pointer;
	font-weight:600;
	font-size:17px;
	transition:all 0.3s ease;
	min-width:100px;
	box-shadow:0 2px 8px rgba(0,0,0,0.1);
	min-height: 50px;
}
#confirmPharmacist{
	background:linear-gradient(135deg,var(--accent) 0%,#1f4f82 100%);
	color:#fff;
	order: 1;
}
#confirmPharmacist:hover{
	background:linear-gradient(135deg,#1f4f82 0%,#173a5f 100%);
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(43,108,176,0.4);
}
#confirmPharmacist:active{
	transform:translateY(0);
	box-shadow:0 2px 6px rgba(43,108,176,0.3);
}
#cancelPharmacist{
	background:linear-gradient(135deg,rgba(220,38,38,0.8) 0%,rgba(153,27,27,0.7) 100%);
	color:#fff;
	order: 3;
}
#cancelPharmacist:hover{
	background:linear-gradient(135deg,rgba(220,38,38,0.9) 0%,rgba(153,27,27,0.8) 100%);
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(220,38,38,0.4);
}
#cancelPharmacist:active{
	transform:translateY(0);
	box-shadow:0 2px 6px rgba(220,38,38,0.3);
}
#copyPharmacist{
	background:linear-gradient(135deg,#0b6623 0%,#064e1a 100%);
	color:#fff;
	order: 2;
}
#copyPharmacist:hover{
	background:linear-gradient(135deg,#064e1a 0%,#033d14 100%);
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(11,102,35,0.4);
}
#copyPharmacist:active{
	transform:translateY(0);
	box-shadow:0 2px 6px rgba(11,102,35,0.3);
}
@media (max-width:600px){
	.pharmacist-actions{
		flex-direction: row-reverse;
	}
	.pharmacist-actions button{
		flex: 1 1 calc(33.333% - 8px);
		min-width: 0;
		padding: 14px 8px;
		font-size: 17px;
		min-height: 48px;
	}
	#copyPharmacist{
		order: 2;
	}
	#confirmPharmacist{
		order: 3;
	}
	#cancelPharmacist{
		order: 1;
	}
}

.floating-refresh-btn{
	position:fixed;
	bottom:24px;
	left:24px;
	width:64px;
	height:64px;
	border-radius:50%;
	border:none;
	background:linear-gradient(135deg,var(--accent) 0%,#1f4f82 100%);
	color:#fff;
	font-size:36px;
	font-weight:700;
	display:flex;
	align-items:center;
	justify-content:center;
	box-shadow:0 12px 28px rgba(43,108,176,0.45);
	cursor:pointer;
	z-index:240;
	transition:transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-refresh-btn span{
	line-height:1;
	transform:translateY(-2px);
}
.floating-refresh-btn:hover{
	transform:translateY(-3px);
	box-shadow:0 16px 36px rgba(23,58,95,0.55);
}
.floating-refresh-btn:active{
	transform:translateY(0);
	box-shadow:0 8px 18px rgba(23,58,95,0.5);
}
@media (max-width:600px){
	.floating-refresh-btn{
		width:56px;
		height:56px;
		font-size:30px;
		bottom:18px;
		left:18px;
	}
}
.refresh-message{
	position:fixed;
	bottom:100px;
	left:24px;
	width:min(320px,calc(100% - 48px));
	background:rgba(255,255,255,0.95);
	backdrop-filter:blur(14px);
	-webkit-backdrop-filter:blur(14px);
	border-radius:18px;
	box-shadow:0 18px 40px rgba(15,23,42,0.2);
	z-index:230;
	transition:opacity 0.25s ease, transform 0.25s ease;
	overflow:hidden;
}
.refresh-message.hidden{
	opacity:0;
	transform:translateY(12px);
	pointer-events:none;
}
.refresh-message iframe{
	width:100%;
	height:210px;
	border:0;
	display:block;
	background:transparent;
	overflow:hidden;
}
@media (max-width:600px){
	.refresh-message{
		bottom:90px;
		left:16px;
		width:calc(100% - 32px);
	}
}
#loadCopyMessageWrapper{
	position: fixed;
	bottom: 100px;
	left: 24px;
	width: min(320px, calc(100% - 48px));
	background: rgba(255,255,255,0.95);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-radius: 18px;
	box-shadow: 0 18px 40px rgba(15,23,42,0.2);
	z-index: 230;
	transition: opacity 0.25s ease, transform 0.25s ease;
	overflow: hidden;
}
#loadCopyMessageWrapper.hidden{
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
}
#loadCopyMessageWrapper iframe{
	width: 100%;
	height: 210px;
	border: 0;
	display: block;
	background: transparent;
	overflow: hidden;
}
@media (max-width:600px){
	#loadCopyMessageWrapper{
		bottom: 90px;
		left: 16px;
		width: calc(100% - 32px);
	}
}
.share-message{
	position:fixed;
	inset:0;
	display:flex;
	align-items:center;
	justify-content:center;
	padding:24px;
	background:rgba(0,0,0,0.35);
	backdrop-filter:blur(2px);
	-webkit-backdrop-filter:blur(2px);
	z-index:600;
	transition:opacity 0.25s ease;
}
.share-message.hidden{
	opacity:0;
	pointer-events:none;
}
.share-message-content{
	width:min(320px,calc(100% - 48px));
	background:linear-gradient(135deg,#2b6cb0 0%,#1f4f82 100%);
	color:#fff;
	border-radius:18px;
	box-shadow:0 18px 40px rgba(15,23,42,0.25);
	display:flex;
	flex-direction:column;
	gap:12px;
	padding:22px 24px;
	text-align:center;
}
.share-message-content p{
	margin:0;
	font-size:16px;
	font-weight:600;
	line-height:1.5;
}
.share-message-content button{
	border:none;
	border-radius:999px;
	padding:10px;
	font-size:15px;
	font-weight:700;
	cursor:pointer;
	background:rgba(255,255,255,0.15);
	color:#fff;
	transition:transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow:0 8px 18px rgba(15,23,42,0.25);
}
.share-message-content button:hover{
	transform:translateY(-2px);
}
.share-message-content button:active{
	transform:translateY(0);
}
@media (max-width:600px){
	.share-message{
		padding:16px;
	}
	.share-message-content{
		width:100%;
	}
}
.share-preparing{
	position:fixed;
	inset:0;
	display:flex;
	align-items:center;
	justify-content:center;
	padding:24px;
	background:rgba(3,11,27,0.55);
	backdrop-filter:blur(10px);
	-webkit-backdrop-filter:blur(10px);
	z-index:650;
	transition:opacity 0.2s ease;
}
.share-preparing.hidden{
	opacity:0;
	pointer-events:none;
}
.share-preparing-card{
	width:min(360px,calc(100% - 48px));
	background:linear-gradient(135deg,#2b6cb0 0%,#1f4f82 100%);
	color:#fff;
	border-radius:22px;
	padding:28px 32px;
	box-shadow:0 24px 48px rgba(15,23,42,0.35);
	text-align:center;
	display:flex;
	flex-direction:column;
	align-items:center;
	gap:18px;
	font-family:"IBM Plex Sans Arabic","Tajawal","Scheherazade New",sans-serif;
}
.share-preparing-card p{
	margin:0;
	font-size:20px;
	font-weight:700;
	letter-spacing:0.01em;
}
.share-preparing-warning{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	font-size:52px;
	line-height:1;
	color:#fef08a;
	text-shadow:0 4px 12px rgba(0,0,0,0.35);
}
.share-preparing-warning.hidden{display:none;}
.share-preparing-spinner{
	--uib-size:54px;
	--uib-speed:.9s;
	--uib-color:#fff;
	position:relative;
	display:flex;
	align-items:center;
	justify-content:flex-start;
	width:var(--uib-size);
	height:var(--uib-size);
}
.share-preparing-spinner.hidden{
	display:none;
}
.share-preparing-dot{
	position:absolute;
	top:0;
	left:0;
	display:flex;
	align-items:center;
	justify-content:flex-start;
	width:100%;
	height:100%;
}
.share-preparing-dot::before{
	content:'';
	width:20%;
	height:20%;
	border-radius:50%;
	background-color:var(--uib-color);
	transform:scale(0);
	opacity:0.5;
	animation:sharePreparingPulse calc(var(--uib-speed)*1.111) ease-in-out infinite;
	box-shadow:0 0 16px rgba(18,31,53,0.25);
}
.share-preparing-dot:nth-child(2){transform:rotate(45deg);}
.share-preparing-dot:nth-child(2)::before{animation-delay:calc(var(--uib-speed)*-0.875);}
.share-preparing-dot:nth-child(3){transform:rotate(90deg);}
.share-preparing-dot:nth-child(3)::before{animation-delay:calc(var(--uib-speed)*-0.75);}
.share-preparing-dot:nth-child(4){transform:rotate(135deg);}
.share-preparing-dot:nth-child(4)::before{animation-delay:calc(var(--uib-speed)*-0.625);}
.share-preparing-dot:nth-child(5){transform:rotate(180deg);}
.share-preparing-dot:nth-child(5)::before{animation-delay:calc(var(--uib-speed)*-0.5);}
.share-preparing-dot:nth-child(6){transform:rotate(225deg);}
.share-preparing-dot:nth-child(6)::before{animation-delay:calc(var(--uib-speed)*-0.375);}
.share-preparing-dot:nth-child(7){transform:rotate(270deg);}
.share-preparing-dot:nth-child(7)::before{animation-delay:calc(var(--uib-speed)*-0.25);}
.share-preparing-dot:nth-child(8){transform:rotate(315deg);}
.share-preparing-dot:nth-child(8)::before{animation-delay:calc(var(--uib-speed)*-0.125);}
@keyframes sharePreparingPulse{
	0%,100%{
		transform:scale(0);
		opacity:0.5;
	}
	50%{
		transform:scale(1);
		opacity:1;
	}
}
@media (max-width:600px){
	.share-preparing{
		padding:16px;
	}
	.share-preparing-card{
		width:100%;
		padding:24px;
	}
	.share-preparing-card p{
		font-size:18px;
	}
	.summary-index{
		margin-left:1px;
		margin-right:2px;
		min-width:22px;
		font-size:15px;
	}
	.summary-table td:first-child{padding-right:4px;}
	.summary-table td:nth-child(2){padding-left:4px;padding-right:4px;}
}

/* Side Menu */
.side-menu{
	position: fixed;
	inset: 0;
	z-index: 700;
	pointer-events: none;
}
.side-menu.hidden{
	display: none;
}
.side-menu-overlay{
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.side-menu:not(.hidden) .side-menu-overlay{
	opacity: 1;
	pointer-events: auto;
}
.side-menu-content{
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: min(250px, 70%);
	background: #fff;
	box-shadow: -4px 0 20px rgba(0,0,0,0.15);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.side-menu:not(.hidden) .side-menu-content{
	transform: translateX(0);
	pointer-events: auto;
}
.side-menu-header{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 2px solid rgba(43,108,176,0.1);
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
}
.side-menu-header h3{
	margin: 0;
	font-size: 20px;
	font-weight: 700;
}
.close-side-menu{
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(255,255,255,0.2);
	color: #fff;
	border-radius: 50%;
	font-size: 24px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	line-height: 1;
}
.close-side-menu:hover{
	background: rgba(255,255,255,0.3);
	transform: scale(1.1);
}
.saved-copies-list{
	flex: 1;
	overflow-y: auto;
	padding: 12px;
}
.saved-copy-item{
	padding: 14px 16px;
	margin-bottom: 8px;
	background: #f8f9fa;
	border-radius: 10px;
	border: 2px solid #e1e8ed;
	cursor: pointer;
	transition: all 0.3s ease;
}
.saved-copy-item:hover{
	background: #e9ecef;
	border-color: var(--accent);
	transform: translateX(-4px);
	box-shadow: 0 4px 12px rgba(43,108,176,0.15);
}
.saved-copy-item:active{
	transform: translateX(-2px);
}
.saved-copy-name{
	font-weight: 600;
	font-size: 16px;
	color: #1a202c;
	margin-bottom: 4px;
}
.saved-copy-date{
	font-size: 15px;
	color: #6b7280;
}
.no-copies{
	text-align: center;
	padding: 40px 20px;
	color: #9ca3af;
	font-size: 16px;
}
.no-copies.hidden{
	display: none;
}

/* واجهة التسجيل الأولي */
.registration-overlay{
	position: fixed;
	inset: 0;
	z-index: 900;
	background: linear-gradient(135deg, #2b6cb0 0%, #1f4f82 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.registration-overlay.hidden{
	display: none;
}
.registration-content{
	background: #fff;
	padding: 24px;
	border-radius: 16px;
	width: 90%;
	max-width: 420px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.2);
	animation: modalSlideIn 0.3s ease;
}
.registration-content h3{
	margin: 0 0 20px 0;
	font-size: 20px;
	color: #1a202c;
	font-weight: 700;
	text-align: center;
}
.registration-fields{
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 20px;
}
.registration-fields input{
	width: 100%;
	padding: 14px 16px;
	border: 2px solid #e1e8ed;
	border-radius: 10px;
	font-size: 17px;
	font-weight: 600;
	background: #fff;
	transition: all 0.3s ease;
}
.registration-fields input:focus{
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}
.registration-submit{
	width: 100%;
	padding: 16px 24px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
	font-weight: 700;
	font-size: 17px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px rgba(43,108,176,0.3);
}
.registration-submit:hover:not(:disabled){
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(43,108,176,0.4);
}
.registration-submit:disabled{
	opacity: 0.5;
	cursor: not-allowed;
}

/* زر GPS العائم */
.floating-gps-btn{
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 28px rgba(43,108,176,0.45);
	cursor: pointer;
	z-index: 240;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-gps-btn .gps-icon{
	line-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}
.floating-gps-btn .gps-icon svg{
	width: 28px;
	height: 28px;
	stroke: #fff;
	color: #fff;
}
.floating-gps-btn:hover{
	transform: translateX(-50%) translateY(-3px);
	box-shadow: 0 16px 36px rgba(23,58,95,0.55);
}
.floating-gps-btn:active{
	transform: translateX(-50%) translateY(0);
}
/* وهج أخضر (Ripple) عند حالة ما بعد الدخول وقبل الخروج */
.floating-gps-btn.gps-active{
	animation: gps-ripple 1.8s ease-out infinite;
}
.floating-gps-btn.gps-active::before{
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid rgba(11, 102, 35, 0.5);
	animation: gps-ripple-ring 1.8s ease-out infinite;
	pointer-events: none;
}
@keyframes gps-ripple{
	0%, 100%{ box-shadow: 0 12px 28px rgba(43,108,176,0.45), 0 0 0 0 rgba(11, 102, 35, 0.4); }
	50%{ box-shadow: 0 12px 28px rgba(43,108,176,0.45), 0 0 0 12px rgba(11, 102, 35, 0); }
}
@keyframes gps-ripple-ring{
	0%{ transform: scale(0.8); opacity: 0.8; }
	100%{ transform: scale(1.4); opacity: 0; }
}
@media (max-width:600px){
	.floating-gps-btn{
		width: 56px;
		height: 56px;
		bottom: 18px;
	}
	.floating-gps-btn .gps-icon svg{
		width: 24px;
		height: 24px;
	}
}

/* نافذة الدخول/الخروج (بنفس ستايل تهيئة الفاتورة) */
.gps-modal{
	position: fixed;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	pointer-events: auto;
}
.gps-modal.hidden{
	display: none;
}
.gps-modal-overlay{
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.gps-modal-content{
	position: relative;
	background: #fff;
	padding: 24px;
	border-radius: 16px;
	width: 90%;
	max-width: 420px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.2);
	animation: modalSlideIn 0.3s ease;
}
.gps-modal-content h3{
	margin: 0 0 20px 0;
	font-size: 20px;
	color: #1a202c;
	font-weight: 700;
	text-align: center;
}
.gps-modal-actions{
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}
.gps-btn{
	padding: 16px 24px;
	border: none;
	border-radius: 10px;
	font-weight: 700;
	font-size: 17px;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 100px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.gps-btn-entry{
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
}
.gps-btn-entry:hover:not(:disabled){
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(43,108,176,0.4);
}
.gps-btn-exit{
	background: linear-gradient(135deg, #0b6623 0%, #064e1a 100%);
	color: #fff;
}
.gps-btn-exit:hover:not(:disabled){
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(11,102,35,0.4);
}
.gps-btn:disabled{
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

/* رسالة فشل GPS (تبقى حتى الضغط موافق) */
.gps-fail-message{
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0,0,0,0.4);
	backdrop-filter: blur(4px);
	z-index: 850;
	transition: opacity 0.25s ease;
}
.gps-fail-message.hidden{
	display: none;
}
.gps-fail-content{
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	max-width: 360px;
	box-shadow: 0 12px 32px rgba(0,0,0,0.2);
	text-align: center;
}
.gps-fail-text{
	margin: 0 0 20px 0;
	font-size: 17px;
	font-weight: 600;
	color: #1a202c;
	line-height: 1.5;
}
.gps-fail-ok{
	display: block;
	width: 100%;
	padding: 14px 24px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent) 0%, #1f4f82 100%);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gps-fail-ok:hover{
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(43,108,176,0.4);
}

/* Toast Notification */
.toast-notification{
	position: fixed;
	top: 100px;
	left: 50%;
	transform: translateX(-50%) translateY(-20px);
	z-index: 800;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-notification:not(.hidden){
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}
.toast-content{
	background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
	color: #006421;
	padding: 16px 24px;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(11,102,35,0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 18px;
	min-width: 200px;
}
.toast-message{
	text-align: center;
}
@media (max-width:600px){
	.toast-notification{
		top: 90px;
		left: 16px;
		right: 16px;
		transform: translateY(-20px);
	}
	.toast-notification:not(.hidden){
		transform: translateY(0);
	}
	.toast-content{
		width: 100%;
		min-width: 0;
		padding: 14px 20px;
		font-size: 23px;
		color: #006421;
		border: 2px solid rgba(0, 112, 28, 0.8);
	}
}
