/* SI Studio Manager — mobile app shell (parent + staff). Layered over public.css / public-theme.css. */
html, body.sism-app { margin: 0; padding: 0; background: #f4f5f8; }
body.sism-app {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #101828;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	min-height: 100vh;
}
.sism-app *, .sism-app *::before, .sism-app *::after { box-sizing: border-box; }

/* Top bar */
.sism-app-bar {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
	background: var(--app-brand); color: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.sism-app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sism-app-brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: #fff; }
.sism-app-mono { width: 36px; height: 36px; border-radius: 9px; background: rgba(255, 255, 255, .2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.sism-app-brand strong { display: block; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sism-app-brand small { display: block; font-size: 12px; opacity: .85; }
.sism-app-menu-btn { background: transparent; border: 0; color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.sism-app-menu-btn:focus-visible { outline: 2px solid #fff; }
.sism-app-menu-btn .dashicons { font-size: 26px; width: 26px; height: 26px; }

/* "More" sheet */
.sism-app-sheet { position: fixed; inset: 0; z-index: 30; background: rgba(16, 24, 40, .45); display: flex; align-items: flex-end; }
.sism-app-sheet[hidden] { display: none; }
.sism-app-sheet nav { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 10px 8px calc(14px + env(safe-area-inset-bottom)); }
.sism-app-sheet a { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 12px; color: #101828; text-decoration: none; font-size: 16px; }
.sism-app-sheet a.is-active, .sism-app-sheet a:active { background: #f2f4f7; }
.sism-app-sheet .dashicons { color: var(--app-brand); }

/* Content */
.sism-app-main { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.sism-app-main.has-nav { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.sism-app .sism { max-width: none !important; margin: 0 !important; font-size: 15px; }
.sism-app .sism-card { border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.sism-app .sism-card h3 { font-size: 16px; margin: 0 0 8px; }
.sism-app .sism-grid-2 { display: block; }
.sism-app .sism-btn { min-height: 44px; }
.sism-app input[type=text], .sism-app input[type=date], .sism-app input[type=email], .sism-app input[type=tel], .sism-app select, .sism-app textarea { font-size: 16px; min-height: 44px; width: 100%; }
.sism-app label { display: block; margin-bottom: 10px; }
.sism-app .sism-btn-block { width: 100%; }
.sism-app .sism-btn-danger { background: #d92d20 !important; border-color: #d92d20 !important; color: #fff !important; }

/* Parent portal inside the app: the shell's bottom bar replaces the tab row */
.sism-app-parent .sism-tabs { display: none !important; }
.sism-app-parent .sism-portal-head { border-radius: 16px; margin-bottom: 12px; }
.sism-app-parent .sism-table, .sism-app-parent table { font-size: 14px; }
.sism-app-parent .sism-scroll, .sism-app-parent table { display: block; overflow-x: auto; }

/* Bottom navigation */
.sism-app-nav {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
	display: flex; justify-content: space-around;
	background: #fff; border-top: 1px solid #e4e7ec;
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.sism-app-nav a {
	flex: 1 1 0; min-width: 0;
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	padding: 6px 2px; border-radius: 10px;
	color: #667085; text-decoration: none; font-size: 11px; font-weight: 500;
}
.sism-app-nav a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sism-app-nav .dashicons { font-size: 22px; width: 22px; height: 22px; }
.sism-app-nav a.is-active { color: var(--app-brand); }
.sism-app-nav a:focus-visible { outline: 2px solid var(--app-brand); }

/* Staff app pieces */
.sism-app-hello { margin: 4px 2px 12px; }
.sism-app-hello h2 { margin: 0; font-size: 22px; }
.sism-app-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid #f0f1f4; color: inherit; text-decoration: none; }
.sism-app-row:first-of-type { border-top: 0; }
.sism-app-card h3 + .sism-app-row { border-top: 0; }
.sism-app-row form { margin: 0; flex: none; }
.sism-app .sism-app-row .sism-badge { white-space: nowrap; flex: none; }
.sism-app-row-main { flex: 1 1 auto; min-width: 0; }
.sism-app-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sism-app-done { color: #12b76a; }
.sism-app-late { color: #b42318; font-weight: 600; }
.sism-app-back { display: inline-flex; align-items: center; gap: 4px; color: var(--app-brand); text-decoration: none; font-weight: 600; min-height: 44px; }
.sism-app-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 12px; }
.sism-app-tile { background: #fff; border-radius: 16px; padding: 14px 16px; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.sism-app-tile strong { display: block; font-size: 26px; color: var(--app-brand); }
.sism-app-tile.is-warn strong { color: #dc6803; }
.sism-app-tile span { font-size: 13px; color: #475467; }
.sism-app-clock { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sism-app-clock form { display: flex; gap: 8px; align-items: center; margin: 0; }
.sism-app-clock select { width: auto; flex: 1 1 auto; min-width: 0; }
.sism-app-clock form { flex: 1 1 100%; justify-content: flex-end; max-width: 100%; }
.sism-app-clock .sism-btn { white-space: nowrap; flex: none; }
.sism-app-clock.is-on { border-left: 4px solid #12b76a; }

/* Attendance */
.sism-app-roster-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sism-app-student { padding: 12px 0; border-top: 1px solid #f0f1f4; }
.sism-app-extra { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: 13px; }
.sism-app-extra a { color: var(--app-brand); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; gap: 3px; }
.sism-app-medical { color: #b42318; display: inline-flex; align-items: center; gap: 3px; }
.sism-app-extra .dashicons { font-size: 16px; width: 16px; height: 16px; }
.sism-app-marks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 6px; }
.sism-app-mark { margin: 0 !important; }
.sism-app-mark input { position: absolute; opacity: 0; pointer-events: none; }
.sism-app-mark span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #d0d5dd; border-radius: 10px; font-size: 14px; font-weight: 600; color: #344054; background: #fff; cursor: pointer; }
.sism-app-mark input:focus-visible + span { outline: 2px solid var(--app-brand); outline-offset: 1px; }
.sism-mark-present input:checked + span { background: #12b76a; border-color: #12b76a; color: #fff; }
.sism-mark-late input:checked + span { background: #f79009; border-color: #f79009; color: #fff; }
.sism-mark-absent input:checked + span { background: #d92d20; border-color: #d92d20; color: #fff; }
.sism-mark-excused input:checked + span { background: #667085; border-color: #667085; color: #fff; }
.sism-app-note { font-size: 14px !important; min-height: 38px !important; }
.sism-app-sticky { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; padding: 8px 0; }

@media (min-width: 700px) {
	.sism-app-main { padding-top: 22px; }
	.sism-app-parent .sism-grid-2 { display: grid; }
}

.sism-app .sism a:not(.sism-btn):not(.sism-app-row):not(.sism-app-tile):not(.sism-app-back) { color: var(--app-brand); text-decoration: none; font-weight: 600; }
