/* Afrira manager app. Same colours as the staff app; phone first, sidebar on wide screens. */
.mg-body { background: #F5F7F8; font-size: 15px; }
.mg-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.mg-head { background: #0E6F78; color: #fff; padding: 18px 20px 16px; }
.mg-mark { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.mg-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.mg-head h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.mg-head-side { font-size: 14px; font-weight: 600; white-space: nowrap; }
.mg-head a, .mg-head button { color: #fff; }
.mg-main { flex: 1; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1120px; margin: 0 auto; box-sizing: border-box; }

.mg-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid #DDE3E7; padding-bottom: env(safe-area-inset-bottom); }
.mg-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 10px; color: #4A5A66; text-decoration: none; font-size: 12px; font-weight: 600; }
.mg-tab svg { width: 24px; height: 24px; }
.mg-tab.is-on { color: #0E6F78; }
.mg-tab.is-on svg { stroke-width: 2.4; }
.mg-tab-badge { position: relative; }
.mg-tab-badge b { position: absolute; top: -4px; right: -10px; background: #B3261E; color: #fff; border-radius: 9px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; text-align: center; padding: 0 4px; box-sizing: border-box; }

.mg-card { background: #fff; border: 1px solid #DDE3E7; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mg-card h2 { margin: 0; font-size: 16px; font-weight: 700; }
.mg-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mg-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mg-stat { background: #fff; border: 1px solid #DDE3E7; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; color: #13212B; text-decoration: none; }
.mg-stat span { font-size: 13px; color: #4A5A66; }
.mg-stat b { font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.mg-stat small { font-size: 13px; color: #4A5A66; }
.mg-warn { color: #8A4B00 !important; }
.mg-bad { color: #B3261E !important; }
.mg-good { color: #1A7F37 !important; }
.mg-teal { color: #0E6F78 !important; font-weight: 600; }
.mg-muted { color: #4A5A66; font-size: 13px; }
.mg-p { margin: 0; }

.mg-month { display: flex; align-items: center; gap: 8px; }
.mg-month button { background: rgba(255, 255, 255, 0.16); border: 0; border-radius: 8px; width: 34px; height: 30px; font-size: 18px; cursor: pointer; }
.mg-month button:disabled { opacity: 0.35; cursor: default; }

.mg-bars { display: flex; flex-direction: column; gap: 10px; }
.mg-bar-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 70px; align-items: center; gap: 8px; font-size: 13px; }
.mg-bar-row span:first-child { color: #4A5A66; }
.mg-bar { height: 14px; background: #E3E9EC; border-radius: 7px; overflow: hidden; }
.mg-bar div { height: 100%; background: #0E6F78; border-radius: 7px; }
.mg-bar-row b { text-align: right; }

.mg-alert { border-color: #F1C6C2; background: #FFF7F6; }
.mg-alert h2 { color: #8A1C12; }
.mg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mg-list > li { border-top: 1px solid #EEF1F3; }
.mg-list > li:first-child { border-top: 0; }
.mg-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; background: none; border: 0; text-align: left; color: #13212B; font: inherit; text-decoration: none; cursor: pointer; }
.mg-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mg-row-main b { font-size: 15px; }
.mg-row-end { text-align: right; flex: none; font-weight: 700; }
.mg-chev { color: #9AA7B0; flex: none; }
.mg-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 6px; background: #FCF0C3; color: #6B4A00; vertical-align: 1px; }
.mg-pill-red { background: #FDECEA; color: #8A1C12; }
.mg-pill-grey { background: #E6ECEF; color: #33444F; }
.mg-count { background: #B3261E; color: #fff; border-radius: 10px; font-size: 13px; font-weight: 700; padding: 1px 9px; }

.mg-seg { display: grid; grid-template-columns: 1fr 1fr; background: #E3E9EC; border-radius: 12px; padding: 4px; gap: 4px; }
.mg-seg button { border: 0; background: none; border-radius: 9px; padding: 9px; font: inherit; font-weight: 600; color: #33444F; cursor: pointer; }
.mg-seg button.is-on { background: #fff; color: #0E6F78; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.mg-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.mg-chip { flex: none; text-decoration: none; border: 1px solid #CBD4DA; background: #fff; border-radius: 18px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; color: #33444F; cursor: pointer; }
.mg-chip.is-on { background: #0E6F78; border-color: #0E6F78; color: #fff; }

.mg-prod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.mg-big { font-size: 30px; font-weight: 700; line-height: 1; text-align: right; }
.mg-big small { display: block; font-size: 12px; font-weight: 600; color: #4A5A66; margin-top: 4px; }
.mg-mat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 0; }

.mg-avatar { flex: none; width: 40px; height: 40px; border-radius: 20px; background: #E2F3F4; color: #0E6F78; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.mg-date { flex: none; width: 42px; text-align: center; line-height: 1.1; }
.mg-date b { display: block; font-size: 18px; }
.mg-date span { font-size: 12px; color: #4A5A66; text-transform: uppercase; }
.mg-rev .mg-row-main b, .mg-rev .mg-row-end { text-decoration: line-through; color: #787C82; }
.mg-detail { padding: 0 0 14px 54px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mg-detail img { max-width: 100%; max-height: 360px; border-radius: 10px; border: 1px solid #DDE3E7; align-self: flex-start; }
.mg-detail audio { width: 100%; max-width: 360px; }
.mg-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.mg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #0E6F78; background: #fff; color: #0E6F78; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.mg-btn-primary { background: #0E6F78; color: #fff; }
.mg-btn-danger { border-color: #B3261E; color: #B3261E; }
.mg-btn-danger.mg-btn-primary { background: #B3261E; color: #fff; }
.mg-btn-block { width: 100%; }
.mg-btn:disabled { opacity: 0.5; cursor: default; }
.mg-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: #0E6F78; font-weight: 600; cursor: pointer; text-decoration: none; }

.mg-form { display: flex; flex-direction: column; gap: 6px; }
.mg-form label { font-size: 13px; font-weight: 600; color: #33444F; margin-top: 6px; }
.mg-form input, .mg-form select, .mg-form textarea { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 12px; border: 1px solid #CBD4DA; border-radius: 10px; background: #fff; font: inherit; color: #13212B; }
.mg-form input:focus, .mg-form select:focus, .mg-form textarea:focus { outline: 2px solid #0E6F78; outline-offset: 0; border-color: #0E6F78; }
.mg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mg-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FDECEA; color: #8A1C12; font-weight: 600; font-size: 14px; }
.mg-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FCF6E1; color: #6B4A00; font-size: 14px; }

.mg-lines { display: flex; flex-direction: column; gap: 8px; }
.mg-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 40px 36px; align-items: center; gap: 8px; font-size: 14px; }
.mg-line input { min-height: 40px; text-align: right; }
.mg-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #F2F4F5; color: #4A5A66; font-size: 18px; cursor: pointer; }

.mg-back { align-self: flex-start; }
.mg-sheet-bg { position: fixed; inset: 0; background: rgba(19, 33, 43, 0.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.mg-sheet { background: #F5F7F8; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; }
.mg-sheet h2 { margin: 0; font-size: 20px; }
.mg-toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: #13212B; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); }
.mg-empty { color: #4A5A66; margin: 0; padding: 8px 0; }

/* customer form and details */
.mg-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mg-sheet-wide { max-width: 680px; }
.mg-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.mg-dl dt { color: #4A5A66; }
.mg-dl dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .mg-three, .mg-sheet .mg-two { grid-template-columns: 1fr; } }

/* change log */
.mg-head-link { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.mg-chg { font-size: 14px; overflow-wrap: anywhere; }
.mg-old { color: #8A1C12; text-decoration: line-through; }
.mg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#mg-clist .mg-row { cursor: default; align-items: flex-start; }

@media (min-width: 900px) {
	.mg-app { flex-direction: row; }
	.mg-tabs { position: sticky; top: 0; height: 100vh; width: 210px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid #DDE3E7; box-sizing: border-box; }
	.mg-tabs::before { content: "AFRIRA · MANAGER"; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: #0E6F78; padding: 0 12px 16px; }
	.mg-tab { flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 12px; border-radius: 10px; }
	.mg-tab.is-on { background: #E2F3F4; }
	.mg-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
	.mg-head { padding: 22px 32px 20px; }
	.mg-head .mg-mark { display: none; }
	.mg-main { padding: 22px 32px 40px; }
	.mg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.mg-wide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
	.mg-wide > div { display: flex; flex-direction: column; gap: 14px; }
	.mg-sheet-bg { align-items: center; }
	.mg-sheet { border-radius: 18px; }
	.mg-toast { bottom: 28px; }
}
@media (max-width: 899px) { .mg-col { display: contents; } }
