/* =============================================================================
   ZenCampus Interactive Demo - App Shell Styles
   Mirrors the production Attendance-portal theme: Poppins, #6c5dd3 primary,
   white cards, ~16px radius, soft shadows.
   ========================================================================== */
:root {
	--primary: #6c5dd3;
	--primary-d: #5a4cc0;
	--success: #46bcaa;
	--success-d: #2fa394;
	--info: #4d69fa;
	--warning: #d9a526;
	--warning-bg: #ffcf52;
	--danger: #f35421;
	--pink: #e0719a;
	--body: #323232;
	--muted: #6c757d;
	--faint: #9aa0ad;
	--app-bg: #f3f4f8;
	--card: #ffffff;
	--line: #ebedf2;
	--fill: #f8f9fa;
	--sidebar-w: 248px;
	--topbar-h: 64px;
	--banner-h: 34px;
	--radius: 16px;
	--radius-sm: 11px;
	--shadow-sm: 0 6px 20px rgba(17, 15, 40, 0.05);
	--shadow: 0 12px 32px rgba(17, 15, 40, 0.10);
	--shadow-lg: 0 24px 60px rgba(17, 15, 40, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { padding-top: var(--banner-h); }
/* Embedded inside the landing-page mockup iframe: no standalone banner */
html.embedded { --banner-h: 0px; }
html.embedded #demo-banner { display: none; }
body {
	font-family: 'Poppins', system-ui, -apple-system, sans-serif;
	background: var(--app-bg);
	color: var(--body);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: rgba(108, 93, 211, 0.18); }

/* ---- Scrollbars ------------------------------------------------------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d7e0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b9bfcc; }
::-webkit-scrollbar-track { background: transparent; }

/* ===========================================================================
   LAYOUT
   ======================================================================== */
.app { display: flex; min-height: calc(100vh - var(--banner-h)); }

/* ---- Sidebar --------------------------------------------------------- */
.sidebar {
	width: var(--sidebar-w);
	flex-shrink: 0;
	background: #fff;
	border-right: 1px solid var(--line);
	position: fixed;
	top: var(--banner-h); left: 0; bottom: 0;
	display: flex;
	flex-direction: column;
	z-index: 40;
	transition: transform .28s ease;
}
.sidebar-brand {
	display: flex; align-items: center; gap: 10px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--line);
}
.brand-logo {
	width: 34px; height: 34px; border-radius: 9px;
	background: linear-gradient(135deg, #6c5dd3, #8b7ff0);
	color: #fff; display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 17px; box-shadow: 0 6px 14px rgba(108, 93, 211, .35);
}
.brand-name { font-weight: 700; font-size: 16px; color: #1f2128; letter-spacing: -.01em; }
.brand-sub { font-size: 10px; color: var(--faint); font-weight: 500; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group-label {
	font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--faint); padding: 14px 12px 6px;
}
.nav-item {
	display: flex; align-items: center; gap: 12px;
	width: 100%; text-align: left;
	padding: 10px 12px; margin-bottom: 2px;
	border-radius: 10px; font-size: 13.5px; font-weight: 500; color: #525560;
	transition: background .15s, color .15s; position: relative;
}
.nav-item .iconify { font-size: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--app-bg); color: #1f2128; }
.nav-item.active { background: rgba(108, 93, 211, .1); color: var(--primary); font-weight: 600; }
.nav-item.active::before {
	content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
	width: 3px; height: 22px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-badge {
	margin-left: auto; background: var(--danger); color: #fff;
	font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }
.sidebar-foot .upgrade {
	position: relative;
	background: linear-gradient(135deg, rgba(108, 93, 211, .1), rgba(139, 127, 240, .08));
	border: 1px solid rgba(108, 93, 211, .18); border-radius: 12px; padding: 13px;
}
/* Contextual CTA: hidden until the user has explored, then slides in; dismissible */
#demo-cta { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
#demo-cta.cta-show { opacity: 1; transform: none; }
.cta-close {
	position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 7px;
	display: flex; align-items: center; justify-content: center; color: var(--faint); transition: background .14s, color .14s;
}
.cta-close:hover { background: rgba(108, 93, 211, .12); color: var(--primary); }
.cta-close .iconify { font-size: 15px; }

/* ---- Main column ----------------------------------------------------- */
.main {
	flex: 1; min-width: 0;
	margin-left: var(--sidebar-w);
	display: flex; flex-direction: column;
}

/* ---- Topbar ---------------------------------------------------------- */
.topbar {
	height: var(--topbar-h);
	background: rgba(255, 255, 255, .85);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
	display: flex; align-items: center; gap: 16px;
	padding: 0 22px;
	position: sticky; top: var(--banner-h); z-index: 30;
}
.topbar-search {
	flex: 1; max-width: 460px; position: relative;
}
.topbar-search .field {
	display: flex; align-items: center; gap: 10px;
	background: var(--fill); border: 1px solid transparent;
	border-radius: 11px; padding: 9px 14px; transition: all .15s;
}
.topbar-search .field:focus-within {
	background: #fff; border-color: rgba(108, 93, 211, .45);
	box-shadow: 0 0 0 4px rgba(108, 93, 211, .08);
}
.topbar-search input {
	border: none; outline: none; background: transparent; flex: 1;
	font-family: inherit; font-size: 13.5px; color: var(--body);
}
.topbar-search input::placeholder { color: var(--faint); }
.topbar-search kbd {
	font-family: inherit; font-size: 10px; font-weight: 600; color: var(--faint);
	background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
	width: 40px; height: 40px; border-radius: 11px; color: var(--muted);
	display: flex; align-items: center; justify-content: center; position: relative;
	transition: background .15s, color .15s;
}
.icon-btn .iconify { font-size: 20px; }
.icon-btn:hover { background: var(--app-bg); color: #1f2128; }
.icon-btn .dot {
	position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
	background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.user-chip {
	display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px;
	border-radius: 30px; transition: background .15s;
}
.user-chip:hover { background: var(--app-bg); }
.user-chip .meta { text-align: left; line-height: 1.2; }
.user-chip .nm { font-size: 12.5px; font-weight: 600; color: #1f2128; }
.user-chip .rl { font-size: 10.5px; color: var(--faint); }

/* ---- Content area ---------------------------------------------------- */
.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { font-size: 13px; }
.page-title { font-size: 23px; font-weight: 700; color: #1f2128; letter-spacing: -.02em; margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ===========================================================================
   COMPONENTS
   ======================================================================== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 600; color: #1f2128; }
.card-sub { font-size: 11.5px; color: var(--faint); }

.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* ---- Grid helpers ---------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.col-2 { grid-template-columns: repeat(2, 1fr); }
.col-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .col-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .kpi-grid, .col-2, .col-3 { grid-template-columns: 1fr; } }

/* ---- KPI cards ------------------------------------------------------- */
.kpi {
	background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
	padding: 20px; display: flex; flex-direction: column; gap: 12px;
	transition: transform .18s, box-shadow .18s; cursor: pointer; border: 1px solid transparent;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(108, 93, 211, .12); }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.kpi .ic .iconify { font-size: 22px; }
.kpi .trend { font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.kpi .trend.up { color: var(--success-d); }
.kpi .trend.down { color: var(--danger); }
.kpi .val { font-size: 27px; font-weight: 700; color: #1f2128; line-height: 1; letter-spacing: -.02em; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .go { font-size: 11px; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transition: opacity .18s; }
.kpi:hover .go { opacity: 1; }

/* tint helpers */
.t-primary { background: rgba(108, 93, 211, .12); color: var(--primary); }
.t-success { background: rgba(70, 188, 170, .14); color: var(--success-d); }
.t-info { background: rgba(77, 105, 250, .12); color: var(--info); }
.t-warning { background: rgba(255, 207, 82, .2); color: var(--warning); }
.t-danger { background: rgba(243, 84, 33, .1); color: var(--danger); }
.t-pink { background: rgba(224, 113, 154, .14); color: var(--pink); }

/* ---- Badges ---------------------------------------------------------- */
.badge {
	display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
	border-radius: 20px; padding: 4px 11px; font-size: 11px; font-weight: 600; line-height: 1.3;
}
.badge .iconify { font-size: 12px; }
.badge.success { background: #eafaf7; color: var(--success-d); }
.badge.danger { background: rgba(243, 84, 33, .1); color: var(--danger); }
.badge.info { background: rgba(77, 105, 250, .12); color: var(--info); }
.badge.warning { background: rgba(255, 207, 82, .2); color: var(--warning); }
.badge.primary { background: rgba(108, 93, 211, .1); color: var(--primary); }
.badge.gray { background: rgba(108, 117, 125, .12); color: var(--muted); }

/* ---- Avatar ---------------------------------------------------------- */
.avatar {
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 36px; height: 36px; border-radius: 50%;
	background: rgba(108, 93, 211, .12); color: var(--primary); font-weight: 700; font-size: 13px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.blue { background: rgba(77, 105, 250, .12); color: var(--info); }
.avatar.teal { background: rgba(70, 188, 170, .14); color: var(--success-d); }
.avatar.orange { background: rgba(243, 84, 33, .1); color: var(--danger); }
.avatar.pink { background: rgba(224, 113, 154, .14); color: var(--pink); }

/* ---- Buttons --------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600;
	transition: all .15s; white-space: nowrap;
}
.btn .iconify { font-size: 16px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(108, 93, 211, .3); }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: var(--fill); color: var(--muted); }
.btn.ghost:hover { background: #eef0f5; color: #1f2128; }
.btn.outline { background: #fff; border: 1px solid var(--line); color: #1f2128; }
.btn.outline:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 7px 12px; font-size: 12px; }
.btn.danger { background: rgba(243, 84, 33, .1); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }

/* ---- Form fields ----------------------------------------------------- */
.field-wrap { position: relative; }
.input, .select {
	width: 100%; background: var(--fill); border: 1px solid transparent;
	border-radius: 10px; padding: 9px 13px; font-family: inherit; font-size: 13px;
	color: var(--body); outline: none; transition: all .15s;
}
.input:focus, .select:focus { background: #fff; border-color: rgba(108, 93, 211, .45); box-shadow: 0 0 0 4px rgba(108, 93, 211, .08); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa0ad' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }
.search-inline { display: flex; align-items: center; gap: 9px; background: var(--fill); border: 1px solid transparent; border-radius: 10px; padding: 8px 13px; transition: all .15s; }
.search-inline:focus-within { background: #fff; border-color: rgba(108, 93, 211, .45); box-shadow: 0 0 0 4px rgba(108, 93, 211, .08); }
.search-inline input { border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px; flex: 1; min-width: 80px; }
.label { font-size: 12px; font-weight: 600; color: #525560; margin-bottom: 6px; display: block; }

/* ---- Toolbar (filter row) -------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* ---- Tables ---------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl th {
	text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
	text-transform: uppercase; color: var(--faint); padding: 10px 14px; white-space: nowrap;
	border-bottom: 1px solid var(--line);
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--primary); }
.tbl th .iconify { font-size: 13px; vertical-align: -2px; }
.tbl td { padding: 13px 14px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--fill); }
.tbl tbody tr:last-child td { border-bottom: none; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-name { font-weight: 600; color: #1f2128; }
.cell-mono { font-weight: 600; color: var(--primary); font-size: 12px; }

/* ---- Pagination ------------------------------------------------------ */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pagination .info { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 5px; }
.pager button {
	min-width: 34px; height: 34px; border-radius: 9px; font-size: 13px; font-weight: 600;
	color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
	transition: all .15s; padding: 0 8px;
}
.pager button:hover:not(:disabled) { background: var(--app-bg); color: #1f2128; }
.pager button.active { background: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Progress bars --------------------------------------------------- */
.track { height: 8px; border-radius: 6px; background: #eef0f5; overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 6px; transition: width .8s cubic-bezier(.22,.61,.36,1); }

/* ---- Tabs ------------------------------------------------------------ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
	padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
	border-bottom: 2px solid transparent; white-space: nowrap; transition: all .15s;
}
.tab:hover { color: #1f2128; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Timetable grid -------------------------------------------------- */
.tt-grid { display: grid; grid-template-columns: 56px repeat(6, 1fr); gap: 7px; min-width: 720px; }
.tt-head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--faint); text-align: center; padding: 8px 0; }
.tt-period { font-size: 11px; font-weight: 700; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tt-period small { font-weight: 500; font-size: 8.5px; color: #c2c7d0; }
.tt-cell {
	border-radius: 10px; padding: 9px 8px; text-align: center; cursor: pointer;
	transition: transform .12s, box-shadow .12s; min-height: 54px;
	display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.tt-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tt-cell .sub { font-size: 11.5px; font-weight: 700; }
.tt-cell .tch { font-size: 9px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-recess { background: repeating-linear-gradient(45deg, #f3f4f8, #f3f4f8 6px, #eceef3 6px, #eceef3 12px); color: var(--faint); font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; border-radius: 10px; }

/* ---- Attendance marker ----------------------------------------------- */
.att-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 13px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 0 8px 8px 0; transition: background .12s, border-color .12s; }
.att-row:last-child { border-bottom: none; }
.att-row:hover { background: var(--fill); }
.att-row.st-present { border-left-color: var(--success); }
.att-row.st-absent { border-left-color: var(--danger); }
.att-row.st-late { border-left-color: var(--warning-bg); }
.att-toggle { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; gap: 2px; flex-shrink: 0; }
.att-toggle button {
	display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 86px;
	padding: 6px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); transition: all .14s;
}
.att-toggle button .iconify { font-size: 13px; }
.att-toggle button:hover:not(.on) { color: #1f2128; background: rgba(0,0,0,.03); }
.att-toggle button.on.present { background: var(--success); color: #fff; }
.att-toggle button.on.absent { background: var(--danger); color: #fff; }
.att-toggle button.on.late { background: var(--warning-bg); color: #7a5a00; }
.att-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #525560; padding: 6px 12px; border-radius: 20px; background: var(--fill); }
@media (max-width: 600px) {
	.att-toggle button { min-width: 0; padding: 7px 9px; }
	.att-toggle button span:not(.iconify) { display: none; }
}

/* ---- Charts ---------------------------------------------------------- */
.chart-line { width: 100%; height: 180px; display: block; }
.donut { display: flex; align-items: center; gap: 22px; }
.donut svg { flex-shrink: 0; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-val { margin-left: auto; font-weight: 700; color: #1f2128; }
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .nm { flex: 0 0 60px; font-size: 12px; font-weight: 600; color: #525560; }
.bar-row .pct { flex: 0 0 42px; text-align: right; font-size: 12px; font-weight: 700; }

/* ---- Activity feed --------------------------------------------------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-ic .iconify { font-size: 17px; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; font-weight: 600; color: #1f2128; }
.feed-desc { font-size: 11.5px; color: var(--faint); }
.feed-time { font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ---- Quick actions --------------------------------------------------- */
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa {
	display: flex; align-items: center; gap: 12px; padding: 14px;
	border-radius: 12px; background: var(--fill); transition: all .15s; text-align: left;
}
.qa:hover { background: #fff; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.qa .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa .ic .iconify { font-size: 18px; }
.qa .tx { font-size: 12.5px; font-weight: 600; color: #1f2128; }
.qa .sx { font-size: 10.5px; color: var(--faint); }

/* ===========================================================================
   OVERLAYS: search dropdown, notifications, user menu, modal, drawer, toast
   ======================================================================== */
.overlay-menu {
	position: absolute; background: #fff; border: 1px solid var(--line);
	border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60;
	opacity: 0; transform: translateY(-6px); pointer-events: none;
	transition: opacity .16s, transform .16s;
}
.overlay-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* search results */
.search-results { top: calc(100% + 8px); left: 0; right: 0; max-height: 420px; overflow-y: auto; padding: 8px; }
.search-section-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 5px; }
.search-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.search-row:hover, .search-row.active { background: var(--app-bg); }
.search-row .t { font-size: 13px; font-weight: 600; color: #1f2128; }
.search-row .s { font-size: 11px; color: var(--faint); }
.search-empty { padding: 28px 14px; text-align: center; color: var(--faint); font-size: 13px; }

/* notifications + user menu */
.dropdown { top: calc(100% + 10px); right: 0; width: 340px; }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dropdown-head .t { font-size: 14px; font-weight: 700; color: #1f2128; }
.dropdown-list { max-height: 360px; overflow-y: auto; }
.dropdown-foot { padding: 11px 16px; border-top: 1px solid var(--line); text-align: center; }
.dropdown-foot a { font-size: 12.5px; font-weight: 600; color: var(--primary); }
.notif { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); transition: background .12s; cursor: pointer; }
.notif:hover { background: var(--fill); }
.notif:last-child { border-bottom: none; }
.menu-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; font-size: 13px; color: #525560; transition: background .12s; }
.menu-item:hover { background: var(--fill); color: #1f2128; }
.menu-item .iconify { font-size: 18px; color: var(--faint); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 0; }

/* ---- Modal / Drawer scrim ------------------------------------------- */
.scrim {
	position: fixed; inset: 0; background: rgba(20, 18, 45, .45); backdrop-filter: blur(2px);
	z-index: 80; opacity: 0; pointer-events: none; transition: opacity .22s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.modal {
	position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.97);
	width: min(92vw, 560px); max-height: 88vh; overflow-y: auto;
	background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
	z-index: 90; opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.modal.wide { width: min(94vw, 720px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 14px; }
.modal-title { font-size: 17px; font-weight: 700; color: #1f2128; }
.modal-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 6px 24px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }

.drawer {
	position: fixed; top: 0; right: 0; bottom: 0; width: min(94vw, 460px);
	background: #fff; box-shadow: var(--shadow-lg); z-index: 90;
	transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
	display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

.close-x { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; transition: background .14s; }
.close-x:hover { background: var(--app-bg); color: #1f2128; }
.close-x .iconify { font-size: 19px; }

/* ---- Toasts ---------------------------------------------------------- */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
	display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 380px;
	background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 13px 16px;
	border-left: 4px solid var(--primary);
	transform: translateX(120%); opacity: 0; transition: transform .32s cubic-bezier(.22,.61,.36,1), opacity .32s;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast .ic .iconify { font-size: 17px; }
.toast .tx { flex: 1; }
.toast .tt { font-size: 13px; font-weight: 600; color: #1f2128; }
.toast .ts { font-size: 11.5px; color: var(--muted); }

/* ---- Loading skeleton & spinner -------------------------------------- */
.skeleton { background: linear-gradient(90deg, #eef0f5 25%, #f6f7fa 50%, #eef0f5 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(108, 93, 211, .15); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 70px 0; color: var(--muted); font-size: 13px; }

/* ---- Empty state ----------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 20px; text-align: center; }
.empty .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--app-bg); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.empty .ic .iconify { font-size: 30px; }
.empty .t { font-size: 15px; font-weight: 600; color: #1f2128; }
.empty .s { font-size: 13px; color: var(--muted); max-width: 320px; }

/* ---- Page transition ------------------------------------------------- */
.view-enter { animation: viewIn .34s cubic-bezier(.22,.61,.36,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Misc helpers ---------------------------------------------------- */
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 18px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 18px; }
.text-success { color: var(--success-d); } .text-danger { color: var(--danger); }
.text-warning { color: var(--warning); } .text-primary { color: var(--primary); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.chip-toggle { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.chip-toggle button { padding: 6px 13px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); transition: all .14s; }
.chip-toggle button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.info-grid .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 3px; }
.info-grid .v { font-size: 13.5px; font-weight: 500; color: #1f2128; }

.diff-box { background: var(--fill); border-radius: 12px; padding: 14px 16px; font-size: 13px; }
.diff-line { display: flex; gap: 10px; align-items: center; padding: 5px 0; }
.diff-before { color: var(--danger); text-decoration: line-through; }
.diff-after { color: var(--success-d); font-weight: 600; }

/* ---- Mobile sidebar -------------------------------------------------- */
.menu-toggle { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 960px) {
	.sidebar { transform: translateX(-100%); }
	.sidebar.open { transform: translateX(0); }
	.main { margin-left: 0; }
	.menu-toggle { display: flex; }
	.topbar-search kbd { display: none; }
	.sidebar-scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
}
@media (max-width: 600px) {
	.content { padding: 18px 14px 50px; }
	.user-chip .meta { display: none; }
	.dropdown { width: 300px; }
}

/* ===========================================================================
   POLISH & RESPONSIVE REFINEMENTS
   ======================================================================== */
/* Equal-height cards within any multi-column grid (kills ragged bottoms) */
.grid > .card { height: 100%; }

/* Profile: performance-by-subject rows */
.subj-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.subj-row:last-child { border-bottom: none; }
.subj-row .nm { flex: 0 0 132px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #1f2128; }
.subj-row .pct { flex: 0 0 38px; text-align: right; font-size: 12.5px; font-weight: 700; }

/* Profile: attendance streak sparkline */
.att-spark { display: flex; align-items: flex-end; gap: 6px; height: 104px; padding: 10px 0 4px; }
.att-spark .b { flex: 1; border-radius: 5px; min-height: 10px; }
.att-spark-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-top: 4px; }

/* Compact inline stat (used in section headers, e.g. Teachers) */
.statline { display: flex; align-items: center; gap: 13px; }
.statline .ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.statline .ic .iconify { font-size: 20px; }
.statline .v { font-size: 22px; font-weight: 700; color: #1f2128; line-height: 1.1; }
.statline .l { font-size: 12px; color: var(--muted); }

/* Tables scroll (not cramp) on small screens; hide secondary columns */
.tbl { min-width: 680px; }
@media (max-width: 880px) { .col-hide { display: none !important; } }

/* KPI cards: compact horizontal layout on phones (removes tall whitespace) */
@media (max-width: 720px) {
	.kpi { flex-direction: row; align-items: center; gap: 15px; padding: 17px 18px; }
	.kpi .top { flex: 0 0 auto; }
	.kpi .top .trend { display: none; }
	.kpi .go { display: none; }
	.kpi .val { font-size: 23px; }
}

/* Force multi-column grids to stack on tablet/phone even when an inline
   grid-template-columns (e.g. "1.6fr 1fr", "1fr 320px") is set on the element. */
@media (max-width: 820px) {
	.grid.col-2, .grid.col-3 { grid-template-columns: 1fr !important; }
	.qa-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Slightly tighter section rhythm on phones */
@media (max-width: 600px) {
	.page-title { font-size: 20px; }
	.card { padding: 18px; }
	.grid { gap: 14px; }
	.qa-grid { grid-template-columns: 1fr !important; }
}
