/* AYOUB & SONS ERP — visual skin mimicking the original VB6 desktop app:
   beveled toolbar strips, bold labels, bordered data grids, dark totals bars. */

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

.as-wrap { font-family: Tahoma, Arial, sans-serif; color: #222; max-width: 1200px; }

.as-form {
	background: #ece9e4;
	border: 2px solid #7d7d7d;
	box-shadow: 3px 3px 6px rgba(0,0,0,0.25);
	margin: 16px 0 32px;
}
.as-form-title {
	background: linear-gradient(#0a58a8, #08407e);
	color: #fff;
	font-weight: bold;
	font-size: 14px;
	padding: 8px 14px;
	letter-spacing: .5px;
	text-transform: uppercase;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.as-form-close {
	text-transform: none;
	font-weight: normal;
	font-size: 20px;
	line-height: 1;
	color: #fff;
	text-decoration: none;
	opacity: .85;
}
.as-form-close:hover { opacity: 1; }
.as-form-body { padding: 16px; }

.as-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	margin-bottom: 14px;
	border: 1px solid #8a8a8a;
	background: #ffd9a8;
}
.as-toolbar.-green  { background: #c6f5c6; }
.as-toolbar.-blue   { background: #a8c8ff; }
.as-toolbar.-gray   { background: #d4d4d4; }
.as-toolbar.-lav    { background: #cfd0ff; }
.as-toolbar.-white  { background: #ffffff; }

.as-field { display: flex; flex-direction: column; gap: 3px; }
.as-field label {
	font-weight: bold;
	font-size: 11px;
	text-transform: uppercase;
	color: #333;
}
.as-field input[type=text],
.as-field input[type=number],
.as-field input[type=date],
.as-field input[type=email],
.as-field select,
.as-field textarea {
	border: 1px solid #6b6b6b;
	background: #fff;
	padding: 5px 7px;
	font-size: 13px;
	font-family: inherit;
	min-width: 140px;
}
.as-field input.-invalid, .as-field select.-invalid {
	border-color: #d64545;
	background: #fff5f5;
}
.as-field input:disabled, .as-field input[readonly], .as-field select:disabled {
	background: #e4e4e4;
	color: #444;
	font-weight: bold;
}
.as-field.-amount input { background: #ffffc8; font-weight: bold; text-align: right; }
.as-field.-narrow input { min-width: 70px; }
.as-field.-wide input, .as-field.-wide textarea { min-width: 320px; }

.as-panels { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.as-panel {
	flex: 1 1 360px;
	border: 1px solid #8a8a8a;
	padding: 12px;
}
.as-panel.-debit  { background: #cfe4ff; }
.as-panel.-credit { background: #cdf5cd; }
.as-panel h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.as-panel .as-field { margin-bottom: 8px; }
.as-panel .as-field input, .as-panel .as-field select { width: 100%; }

.as-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}
.as-modal-overlay.-open { display: flex; }
.as-modal { width: 360px; max-width: 92vw; }
.as-modal .as-form { margin: 0; }
.as-modal .as-form-title { display: flex; justify-content: space-between; align-items: center; }
.as-modal-close { cursor: pointer; font-size: 16px; line-height: 1; }
.as-modal .as-field input { width: 100%; }
.as-modal .as-actions { display: flex; gap: 8px; margin-top: 4px; }

.as-grid-wrap { border: 1px solid #6b6b6b; margin-bottom: 14px; max-height: 420px; overflow: auto; background: #fff; }
table.as-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.as-grid thead th {
	position: sticky; top: 0;
	background: #1f3864; color: #fff;
	text-align: left; padding: 7px 8px;
	font-weight: bold; white-space: nowrap;
	border-right: 1px solid #33507e;
}
table.as-grid td { padding: 5px 8px; border-bottom: 1px solid #ddd; border-right: 1px solid #eee; white-space: nowrap; }
table.as-grid tbody tr:nth-child(even) { background: #f4f6fb; }
table.as-grid tbody tr:hover { background: #dbe8ff; cursor: pointer; }
table.as-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.as-grid tr.-selected { background: #ffe9a8 !important; }

.as-totals {
	display: flex; gap: 0; background: #3a3a3a; color: #fff;
	border: 1px solid #222; margin-bottom: 14px;
}
.as-totals .as-total-box { flex: 1; padding: 10px 14px; border-right: 1px solid #555; }
.as-totals .as-total-box:last-child { border-right: none; }
.as-totals .as-total-box .lbl { font-size: 10px; text-transform: uppercase; opacity: .8; display: block; }
.as-totals .as-total-box .val { font-size: 17px; font-weight: bold; font-variant-numeric: tabular-nums; }

.as-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid #bbb; }
.as-btn {
	font-family: inherit; font-weight: bold; font-size: 12.5px;
	padding: 9px 20px; border: 1px solid #444; cursor: pointer;
	background: #e6e6e6; box-shadow: inset 0 1px 0 #fff, 1px 1px 3px rgba(0,0,0,.3);
}
.as-btn:hover { filter: brightness(1.05); }
.as-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.as-btn.-save   { background: #2f9e44; color: #fff; }
.as-btn.-delete { background: #d64545; color: #fff; }
.as-btn.-print  { background: #1f6fd6; color: #fff; }
.as-btn.-add    { background: #1f6fd6; color: #fff; }
.as-btn.-plain  { background: #e6e6e6; color: #222; }

.as-msg { padding: 9px 12px; margin-bottom: 12px; font-weight: bold; border: 1px solid; display: none; }
.as-msg.-ok    { background: #e6fbe6; border-color: #2f9e44; color: #185c28; }
.as-msg.-error { background: #fde6e6; border-color: #d64545; color: #7a1f1f; }

/* Main menu ("MainMenu.frm" button dashboard) */
.as-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; }
.as-menu-btn {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	background: #1f3864; color: #fff; text-decoration: none;
	padding: 26px 10px; border: 1px solid #0e2143; font-weight: bold; text-transform: uppercase; font-size: 12.5px;
	box-shadow: 2px 2px 4px rgba(0,0,0,.3);
}
.as-menu-btn:hover { background: #2a4d85; color: #fff; }
.as-menu-btn .dashicons { font-size: 26px; width: 26px; height: 26px; }

.as-brand-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.as-brand-header img { max-height: 150px; border-radius: 50%; aspect-ratio: 1 / 1; object-fit: cover; }
.as-brand-header .as-company-name { font-size: 22px; font-weight: bold; color: #b31217; font-style: italic; }

.as-lookup-pop {
	position: absolute; z-index: 100; background: #fff; border: 1px solid #444;
	box-shadow: 2px 2px 8px rgba(0,0,0,.3); max-height: 260px; overflow: auto; display: none; min-width: 340px;
}
.as-lookup-pop table.as-grid thead { display: none; }

@media print {
	#wpadminbar, #adminmenumain, #wpfooter, .as-no-print { display: none !important; }
	#wpcontent, #wpbody-content { margin: 0 !important; padding: 0 !important; }
	body { background: #fff !important; }
}

/* Standalone app shell (front-end, no WordPress admin chrome) */
html, body.as-app-body, body.as-login-body { margin: 0; padding: 0; background: #eef1f6; font-family: Tahoma, Arial, sans-serif; }

body.as-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.as-login-box {
	background: #fff; border: 1px solid #ccc; border-top: 4px solid #08407e;
	box-shadow: 3px 3px 10px rgba(0,0,0,.15); padding: 30px 34px; width: 340px; text-align: center;
}
.as-login-logo { max-width: 140px; max-height: 140px; margin-bottom: 12px; }
.as-login-box h1 { font-size: 18px; color: #b31217; font-style: italic; margin: 0 0 18px; }
.as-login-box .as-field { text-align: left; margin-bottom: 12px; }
.as-login-box .as-field input { width: 100%; }
.as-login-box .as-msg { text-align: left; }

.as-shell { display: flex; min-height: 100vh; align-items: stretch; }

.as-sidebar {
	width: 232px; flex: 0 0 232px; background: #1f3864; color: #fff;
	display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
	box-shadow: 2px 0 6px rgba(0,0,0,.2);
}
.as-sidebar-brand {
	display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: bold;
	padding: 16px 16px; border-bottom: 1px solid rgba(255,255,255,.15); font-size: 14px; line-height: 1.25;
}
.as-sidebar-brand img { height: 36px; width: 36px; object-fit: contain; background: #fff; border-radius: 4px; flex-shrink: 0; }
.as-sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.as-sidebar-link {
	display: flex; align-items: center; gap: 10px; color: #cfd8ea; text-decoration: none;
	font-size: 12.5px; font-weight: bold; text-transform: uppercase; letter-spacing: .3px;
	padding: 11px 16px; border-left: 3px solid transparent;
}
.as-sidebar-link .dashicons { font-size: 18px; width: 18px; height: 18px; flex-shrink: 0; }
.as-sidebar-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.as-sidebar-link.-active { color: #fff; background: #08407e; border-left-color: #ffb020; }
.as-sidebar-user { border-top: 1px solid rgba(255,255,255,.15); padding: 12px 16px; font-size: 12px; color: #cfd8ea; }
.as-sidebar-user-name { font-weight: bold; color: #fff; margin-bottom: 2px; }
.as-sidebar-user-role a { color: #ffb020; }

.as-main { flex: 1; min-width: 0; }
.as-app-content { padding: 22px 26px 50px; }

@media (max-width: 900px) {
	.as-shell { flex-direction: column; }
	.as-sidebar { width: 100%; flex: 0 0 auto; height: auto; position: static; }
	.as-sidebar nav { display: flex; flex-wrap: wrap; }
	.as-sidebar-link { border-left: none; border-bottom: 3px solid transparent; }
	.as-sidebar-link.-active { border-left: none; border-bottom-color: #ffb020; }
}
