:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #202844;
  background: #e8edf5;
  --ink: #202844;
  --muted: #525f79;
  --line: #d4dced;
  --surface: #f9faff;
  --field: #fff;
  --field-edge: #b8c6de;
  --blue: #c8defb;
  --blue-dark: #48428d;
  --teal: #17664f;
  --focus: #5e50b5;
  --surface-shadow: 0 8px 24px #273e6a0c;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 730; }
h2 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.025em; }
a { color: var(--blue-dark); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

button, .button, input, select { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: .55rem .95rem;
  border: 0;
  border-radius: .7rem;
  background: #e5eaf5;
  color: #2c4168;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 180ms ease, background-color 150ms ease;
}
button:hover:not(:disabled), .button:hover { background: #d6e1f5; }
button:disabled { opacity: .56; cursor: default; }
.primary { background: var(--blue); color: #111a32; }
.primary:hover:not(:disabled), .button.primary:hover { background: #b5cffa; }

label { display: grid; min-width: 0; gap: .4rem; color: #334260; font-size: .94rem; font-weight: 600; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .62rem .75rem;
  border: 1px solid var(--field-edge);
  border-radius: .65rem;
  color: var(--ink);
  background-color: var(--field);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.layout :is(input:not([type="checkbox"]), select):focus-visible {
  border-color: var(--focus);
  outline: 1px solid var(--focus);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--page-tint);
}
select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #63759a 50%),
                    linear-gradient(135deg, #63759a 50%, transparent 50%);
  background-position: right 1rem center, right .73rem center;
  background-repeat: no-repeat;
  background-size: .3rem .3rem;
}
input[readonly] { background: #edf1f7; }
input::placeholder { color: #667791; }
form, fieldset { display: grid; gap: 1rem; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
form > button { justify-self: start; }
small, .optional { color: var(--muted); font-weight: 400; font-size: .875rem; }
label:has(.optional) { display: block; }
label:has(.optional) input { display: block; margin-top: .4rem; }

.layout {
  --page-action: #c2b8fa;
  --page-action-hover: #afa4f3;
  --page-action-alt: #8cdeef;
  --page-tint: #ece8fd;
  --page-ink: #4d4294;
  --page-glow: #e2ddfa;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  width: min(calc(100% - 1.5rem), 1550px);
  min-height: calc(100vh - 1.5rem);
  min-height: calc(100dvh - 1.5rem);
  margin: .75rem auto;
  border: 1px solid #cbd5e8;
  border-radius: 1.8rem;
  background: radial-gradient(ellipse 90% 42rem at 100% 4%, var(--page-glow), transparent),
              radial-gradient(ellipse 75% 34rem at 0 86%, #dfedf6, transparent), #f2f4fa;
}
.layout[data-page="students"] {
  --page-action: #d0b9fa; --page-action-hover: #c6a6f3; --page-action-alt: #edb4dc;
  --page-tint: #f2e8f9; --page-ink: #713f85; --page-glow: #efdef3;
}
.layout[data-page="classes"] {
  --page-action: #9de6de; --page-action-hover: #8bdacf; --page-action-alt: #a8e4b7;
  --page-tint: #e1f4ee; --page-ink: #21645b; --page-glow: #dbf1ee;
}
.layout[data-page="cameras"] {
  --page-action: #f6d197; --page-action-hover: #f0bc81; --page-action-alt: #efb1ac;
  --page-tint: #faecdf; --page-ink: #815026; --page-glow: #f7e7dd;
}
.layout .primary { background: linear-gradient(125deg, var(--page-action), var(--page-action-alt)); box-shadow: inset 0 1px #ffffff55; }
.layout .primary:hover:not(:disabled), .layout .button.primary:hover { background: var(--page-action-hover); }
.app-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) auto minmax(6rem, 1fr);
  align-items: center;
  gap: 1rem;
  padding: .75rem clamp(1rem, 3.5vw, 3.6rem);
  min-height: 72px;
  background: #f8faff;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.04rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  position: relative;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: .68rem;
  background: linear-gradient(140deg, #ac99ff, #69e5ed);
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: .52rem;
  left: .55rem;
  width: .8rem;
  height: .42rem;
  border-left: 2px solid #162240;
  border-bottom: 2px solid #162240;
  transform: rotate(-45deg);
}
.app-bar nav { display: flex; gap: .16rem; padding: .22rem; border: 1px solid var(--line); border-radius: 2rem; background: #eff2f9; }
.app-bar nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 43px;
  padding: .48rem .85rem;
  border-radius: 2rem;
  color: #384868;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.app-bar nav a:hover { background: var(--nav-tint); color: var(--nav-ink); }
.app-bar nav a[aria-current] {
  background: var(--nav-tint);
  color: var(--nav-ink);
}
.app-bar nav a[href="#attendance"] { --nav-tint: #e5e0fa; --nav-ink: #4c408f; }
.app-bar nav a[href="#students"] { --nav-tint: #efdef6; --nav-ink: #70417f; }
.app-bar nav a[href="#classes"] { --nav-tint: #daf0ea; --nav-ink: #245f55; }
.app-bar nav a[href="#cameras"] { --nav-tint: #f9e8d9; --nav-ink: #7d4c23; }
.app-bar nav a[href="#staff"] { --nav-tint: #e4edf9; --nav-ink: #315789; }
.nav-icon { position: relative; width: 1rem; height: 1rem; flex: none; color: #596d8a; }
.app-bar a .nav-icon { color: var(--nav-ink); }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; }
.nav-attendance::before { inset: .11rem; border: 1px solid; border-radius: .15rem; }
.nav-attendance::after { inset: .36rem .31rem .39rem; border-block: 1px solid; }
.nav-students::before { inset: .05rem .31rem .53rem; border: 1px solid; border-radius: 50%; }
.nav-students::after { inset: .54rem .16rem .07rem; border: 1px solid; border-radius: .55rem .55rem .16rem .16rem; }
.nav-classes::before { inset: .09rem; border: 1px solid; border-radius: .15rem; }
.nav-classes::after { inset: .15rem .35rem .15rem .47rem; border-left: 1px solid; }
.nav-cameras::before { inset: .22rem .25rem .22rem .05rem; border: 1px solid; border-radius: .15rem; }
.nav-cameras::after { inset: .22rem 0 .22rem .75rem; border-left: 1px solid; border-block: 1px solid; transform: skewY(-10deg); }
.nav-staff::before { inset: .05rem .31rem .53rem; border: 1px solid; border-radius: 50%; }
.nav-staff::after { inset: .54rem .16rem .07rem; border: 1px solid; border-radius: .55rem .55rem .16rem .16rem; }
.account-menu { position: relative; justify-self: end; }
.account-menu summary {
  display: grid; place-items: center;
  width: 2.55rem; height: 2.55rem; border-radius: 50%; background: var(--page-tint);
  color: var(--page-ink); font-size: .85rem; font-weight: 720; cursor: pointer; list-style: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] summary { background: #deddf5; }
.account-popover {
  position: absolute; top: calc(100% + .55rem); right: 0; z-index: 4;
  display: grid; gap: .65rem; min-width: 10rem; max-width: 15rem; padding: .8rem;
  border: 1px solid var(--line); border-radius: .8rem; background: var(--surface);
  box-shadow: var(--surface-shadow); overflow-wrap: anywhere;
}
.sign-out { min-height: 38px; background: #e5eaf5; color: var(--ink); font-size: .9rem; }

.workspace { min-width: 0; width: min(100%, 1500px); margin-inline: auto; padding: clamp(1.2rem, 3.5vw, 3.3rem); }
.page-title { margin-bottom: clamp(1.25rem, 2.3vw, 2.15rem); animation: page-title-in 220ms ease-out both; }
.page-title h1 { color: var(--ink); }
.page-title p { margin-top: .65rem; color: var(--muted); line-height: 1.5; }
.panel {
  min-width: 0; padding: clamp(1rem, 2.5vw, 1.55rem);
  border: 1px solid var(--line); border-radius: 1.35rem;
  background: linear-gradient(135deg, #fff 0, var(--surface) 64%);
  box-shadow: var(--surface-shadow);
}
.panel > h2 { margin-bottom: 1rem; }
.panel > p:not(.empty) { margin-bottom: .8rem; line-height: 1.5; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.15rem; align-items: start; }
.student-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1rem; justify-content: space-between; }
.section-heading > span:not(.badge) { padding: .25rem .55rem; border-radius: 2rem; background: var(--page-tint); color: var(--page-ink); font-size: .85rem; font-weight: 600; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.setup-overview { margin-bottom: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric {
  min-width: 0;
  display: grid;
  gap: .45rem;
  padding: 1.05rem 1.2rem;
  background: #ede9fa;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  color: #544886;
  text-decoration: none;
}
.setup-overview .metric { min-height: 105px; padding: 1.15rem; background: #f9faff; }
.setup-overview .metric:hover { background: #e7eaf9; }
.metric span { font-size: .9rem; font-weight: 650; }
.metric strong { color: var(--ink); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.register-overview .metric {
  position: relative; isolation: isolate; overflow: hidden; min-height: 108px;
  background: linear-gradient(120deg, var(--metric-start), var(--metric-end) 82%);
  box-shadow: var(--surface-shadow), inset 0 1px #ebd2ff1d;
}
.register-overview .metric::before, .register-overview .metric::after {
  content: ""; position: absolute; z-index: -1; width: 7.4rem; height: 5.5rem;
  right: -1rem; bottom: -1.4rem; border-radius: 1.7rem;
  border: 1px solid var(--metric-stroke); transform: rotate(-29deg);
}
.register-overview .metric::after { right: -1.65rem; bottom: -.6rem; }
.register-overview [data-metric="ENROLLED"] {
  --metric-start: #f0eafe; --metric-end: #ddd6f8; --metric-stroke: #9a84ce60; --metric-dot: #7660bd; color: #524389;
}
.register-overview [data-metric="PRESENT"] {
  --metric-start: #e8f7ef; --metric-end: #caece0; --metric-stroke: #65a69462; --metric-dot: #308369; color: #256654;
}
.register-overview [data-metric="ABSENT"] {
  --metric-start: #fceff3; --metric-end: #f2d8e4; --metric-stroke: #bf7f9b60; --metric-dot: #b1567b; color: #893d60;
}
.register-overview [data-metric="LATE"] {
  --metric-start: #fff6e7; --metric-end: #f4e1bd; --metric-stroke: #bd935a6c; --metric-dot: #9f6d2d; color: #785324;
}
.register-overview .metric span { display: flex; align-items: center; gap: .42rem; }
.register-overview .metric span::before {
  content: ""; width: .48rem; height: .48rem; flex: none; border-radius: 50%;
  background: var(--metric-dot); box-shadow: 0 0 10px var(--metric-dot);
}
.setup-panel p { color: var(--muted); }
.setup-panel .actions { margin-top: 1rem; }
.empty { color: var(--muted); padding: 1rem 0; line-height: 1.5; }
.notice { color: var(--teal); font-weight: 600; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.notice.error, [role=alert] { color: #a92d55; }
#page-feedback:not(:empty) { margin-bottom: .85rem; }
.muted { color: var(--muted); margin-top: 1rem; }
.rows { padding: 0; margin: 0; list-style: none; }
.rows li {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .8rem .1rem;
  border-bottom: 1px solid var(--line);
}
.rows strong, .rows small { display: block; overflow-wrap: anywhere; }
.rows small { margin-top: .2rem; }
.student-rows { margin-top: .45rem; }
.directory-search { margin: .85rem 0 .35rem; }
.directory-search input { background-color: var(--field); }
.deleted-students { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.deleted-students summary { color: var(--muted); font-weight: 600; cursor: pointer; }
.student-rows .actions { justify-content: flex-end; gap: .35rem; }
.student-rows button { font-size: .9rem; }
.student-identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.student-identity > span { min-width: 0; }
.student-identity .face-state {
  display: inline-flex; align-items: center; gap: .34rem;
  margin-top: .3rem; padding: .18rem .48rem; border-radius: 2rem;
  background: #f7ebd7; color: #7b541e; font-size: .77rem; font-weight: 600;
}
.face-state::before { content: ""; width: .38rem; height: .38rem; flex: none; border-radius: 50%; background: currentColor; }
.student-identity .face-state.ready { background: #dff2e9; color: #185d4b; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  overflow: hidden;
  border-radius: 50%;
  background: #e8e2fa;
  color: #604990;
  font-size: .83rem;
  font-weight: 700;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
#student-photo-preview { position: relative; width: 3.5rem; height: 3.5rem; }
#student-photo-preview > span { width: 100%; height: 100%; display: grid; place-items: center; }
#student-photo-preview:empty::after, #student-photo-preview > span:empty::after { content: "+"; color: #69579e; font-size: 1.45rem; font-weight: 400; }
#student-photo-preview img { position: absolute; inset: 0; }
.photo-field { display: flex; align-items: center; gap: .8rem; }
.photo-control { min-width: 0; flex: 1; }
.photo-control small { display: block; margin-top: .3rem; }
.photo-control input[type="file"] { min-height: 41px; padding: .3rem; font-size: .85rem; cursor: pointer; }
.photo-control input::file-selector-button {
  padding: .38rem .65rem; margin-inline-end: .5rem; border: 0; border-radius: .4rem;
  background: #ede6fb; color: #593c8c; font: inherit; font-weight: 650; cursor: pointer;
}
.name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.photo-consent { display: flex; align-items: start; line-height: 1.4; gap: .6rem; }
.photo-consent input { width: 1.05rem; min-height: 1.05rem; margin: .15rem 0 0; flex: none; accent-color: var(--page-action); }
.enroll-button { background: #d6eee6; color: #16614f; }
.enroll-button:hover:not(:disabled) { background: #c5e6dc; }
.management-danger { margin-top: 1.2rem; }
#student-management { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
#student-placement { margin-top: .85rem; }
.danger-button, .layout .primary.danger-button { background: #983950; color: #fff3f7; }
.danger-button:hover:not(:disabled), .layout .primary.danger-button:hover:not(:disabled) { background: #ad4760; }
dialog {
  width: min(calc(100% - 2rem), 475px);
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--ink);
  background: #f9faff;
}
dialog::backdrop { background: #25345566; }
dialog p { margin: .9rem 0 1.15rem; color: var(--muted); line-height: 1.5; }
.enroll-form { margin-top: 1.2rem; }
.attendance-workspace { display: grid; gap: 1rem; }
.attendance-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1rem; padding-block: 1rem; }
.filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .8rem; width: min(100%, 38rem); }
.directory-link { margin-bottom: .4rem; font-size: .88rem; font-weight: 650; }
.attendance-detail { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(17rem, 1fr); gap: 1rem; align-items: start; }
.attendance-detail:has(.automatic-controls[hidden]) { grid-template-columns: minmax(0, 1fr); }
.register-title { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .65rem; }
.mark-progress { display: grid; justify-items: end; gap: .35rem; }
#mark-count { color: var(--muted); font-size: .9rem; }
.mark-progress progress { width: 8rem; height: .35rem; accent-color: var(--page-action); }
.register-head, .register-rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, 11rem); gap: .75rem; }
.register-head { padding: .65rem .75rem; border-radius: .5rem; background: #eaf0f9; color: #3f5176; font-weight: 650; font-size: .88rem; }
.register-rows li { padding-inline: .75rem; }
.register-rows label { display: block; }
.register-rows select { border-color: #c5d1e6; background-color: #eef1f8; }
.register-rows select[data-mark="PRESENT"] { color: #185e4b; border-color: #a8d5c6; background-color: #def3eb; }
.register-rows select[data-mark="ABSENT"] { color: #8b3053; border-color: #e7bccf; background-color: #f8e6ee; }
.register-rows select[data-mark="LATE"] { color: #7b511d; border-color: #e3c99a; background-color: #fbefd9; }
.register-actions { margin-top: .35rem; }
.clear-button { background: #f6e4ed; color: #84324f; }
.clear-button:hover:not(:disabled) { background: #f1d7e4; }
#roster [data-open-register] { margin-top: .85rem; }
.automatic-controls {
  display: grid;
  gap: .85rem;
  background: #f9faff;
}
.panel.automatic-controls > p:not(.empty) { margin: 0; }
#automatic-status { color: var(--muted); line-height: 1.45; }
.automatic-controls .section-heading { align-items: center; }
.automatic-controls .badge { margin-bottom: 0; }
.automatic-controls .actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.automatic-controls select { min-width: 9rem; }
.camera-select-label { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.camera-visual {
  position: relative; display: grid; place-items: center; overflow: hidden;
  min-height: clamp(7.6rem, 16vw, 10rem); padding: .9rem .75rem 1.7rem;
  border: 1px solid #c0bde3; border-radius: .95rem;
  background: radial-gradient(ellipse at 50% -15%, #b4a6f0b3, transparent 75%),
              linear-gradient(145deg, #ebeafa, #dbe6f5);
}
.camera-visual #attendance-camera-preview {
  position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.camera-visual.has-frame::after {
  position: absolute; z-index: 1; inset: auto 0 0; height: 3rem;
  background: linear-gradient(transparent, #111836c9); content: "";
}
.camera-visual.has-frame .camera-lens { visibility: hidden; }
.camera-visual > span:last-child {
  position: absolute; z-index: 2; bottom: .5rem; left: .75rem; right: .75rem;
  overflow: hidden; color: #3e4776; font-size: .77rem; font-weight: 650;
  text-overflow: ellipsis; white-space: nowrap;
}
.camera-visual.has-frame > span:last-child { color: #fff; text-shadow: 0 1px 3px #111836; }
.camera-lens {
  width: clamp(4.05rem, 10vw, 5.2rem); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 39% 28%, #e6e6ff 0 4%, #c1bfff84 8%, transparent 15%),
    radial-gradient(circle at 57% 63%, #5755ad 0 6%, #252c65 22%, #111836 41%, transparent 43%),
    radial-gradient(circle, #314071 0 45%, #090f23 47% 53%, #55608e 55% 61%, transparent 63%),
    conic-gradient(from -35deg, #596ba9, #131d39, #63d0d8, #273452, #596ba9);
  box-shadow: 0 .55rem 1.25rem #293d6a55, inset 0 1px #bdc9ff85;
}

.camera-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .7rem; }
.badge { display: inline-flex; align-items: center; align-self: end; gap: .4rem; margin-bottom: .4rem; padding: .3rem .6rem; border-radius: 2rem; background: #e6ebf6; color: #455578; font-size: .84rem; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.badge.online { color: #17614c; background: #d9f0e7; }
.badge.online::before { animation: live-indicator 1.65s ease-out 3; }
#test-camera { background: #fbebd3; color: #795021; }
#test-camera:hover:not(:disabled) { background: #f7dfbc; }
#camera-connection[data-action="connect"] { background: #d8efe6; color: #1a624e; }
#camera-connection[data-action="connect"]:hover:not(:disabled) { background: #c7e6da; }
#camera-connection[data-action="disconnect"] { background: #f6e3eb; color: #853a58; }
#camera-connection[data-action="disconnect"]:hover:not(:disabled) { background: #efd4e1; }
.preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16/10;
  overflow: hidden;
  margin: 1rem 0;
  border-radius: .85rem;
  background: radial-gradient(ellipse at top, #e3eafb, #dbe3f0 75%);
  color: #465878;
  text-align: center;
}
.preview p { padding: .75rem; }
.preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }

.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 1rem; }
.login-card { width: min(100%, 420px); padding: clamp(1.3rem, 6vw, 2.65rem); border: 1px solid var(--line); border-radius: 1.2rem; background: #f9faff; box-shadow: var(--surface-shadow); }
.login-card h1 { margin: 1.5rem 0 1.3rem; font-size: 2.35rem; }
.login-card .primary { width: 100%; }
.login { background: radial-gradient(ellipse at top, #e4dcfa, transparent 62%); }
.login-card .primary { background: linear-gradient(125deg, #c2b8fa, #8cdeef); }

@keyframes page-title-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes live-indicator {
  from { box-shadow: 0 0 0 0 #279b7370; }
  to { box-shadow: 0 0 0 .35rem #279b7300; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  button:not(:disabled):hover, .button:hover { transform: translateY(-1px); }
  button:not(:disabled):active, .button:active { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-title, .badge.online::before { animation: none; }
  button, .button, input, select { transition: none; }
}
@media (forced-colors: active) {
  .page-title h1 { background: none; color: CanvasText; }
  .layout :is(input:not([type="checkbox"]), select):focus-visible { outline: 2px solid Highlight; }
}

@media (max-width: 940px) {
  .split, .attendance-detail { grid-template-columns: 1fr; }
  .automatic-controls { grid-row: 1; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { width: 100%; }
}
@media (max-width: 1000px) {
  .app-bar { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; padding: .55rem .75rem; }
  .app-bar nav { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .15rem; width: min(100%, 36rem); }
  .app-bar nav a { justify-content: center; gap: .2rem; min-height: 38px; padding: .38rem .12rem; font-size: .78rem; text-align: center; }
  .app-bar nav .nav-icon { display: none; }
}

/* Attendo visual system: dark rail, lime action color, warm grid canvas. */
:root {
  --attendo-black: #111113;
  --attendo-lime: #b8ff38;
  --attendo-purple: #6846f5;
  --attendo-ink: #111d3d;
  --attendo-muted: #76809a;
  --attendo-canvas: #f3f3ef;
  --attendo-line: #d9d9d5;
}
body { background: var(--attendo-canvas); color: var(--attendo-ink); }
.layout { grid-template-columns: 312px minmax(0, 1fr); background-color: var(--attendo-canvas); background-image: linear-gradient(#deded9 1px, transparent 1px), linear-gradient(90deg, #deded9 1px, transparent 1px); background-size: 25px 25px; }
.app-bar { background: var(--attendo-black); border-right: 0; box-shadow: none; padding: 2rem 1.5rem 1.35rem; color: #fff; }
.brand { padding: 0 .8rem; color: #fff; font-family: Inter, ui-sans-serif, sans-serif; font-size: 1.3rem; }
.brand-mark { width: 3.1rem; height: 3.1rem; border-radius: 50%; background: var(--attendo-lime); box-shadow: none; }
.brand-mark::after { top: .8rem; left: .86rem; width: 1.2rem; height: .65rem; border-color: var(--attendo-black); border-width: 3px; }
.app-bar .brand::after { content: "CLASSROOM INTELLIGENCE"; position: absolute; left: 6.35rem; top: 4.35rem; color: #85858d; font-size: .57rem; font-weight: 650; letter-spacing: .16em; }
.app-bar nav { gap: .15rem; margin-top: 4.2rem; }
.app-bar nav::before { content: "WORKSPACE"; display: block; margin: 0 .8rem .7rem; color: #72737d; font-size: .6rem; font-weight: 800; letter-spacing: .18em; }
.app-bar nav a { min-height: 64px; padding: .55rem .8rem; border-radius: .2rem; color: #a1a1aa; font-size: 1.02rem; }
.app-bar nav a::after { content: attr(aria-label); }
.app-bar nav a:hover { background: #202023; color: #fff; }
.app-bar nav a[aria-current] { background: var(--attendo-lime); color: #111113; box-shadow: none; }
.app-bar nav a[aria-current] .nav-icon { color: #111113 !important; }
.nav-icon { width: 1.15rem; height: 1.15rem; color: #96969f !important; }
.account-menu { border-top-color: #2c2c30; }
.account-menu summary { color: #fff; }
.account-menu summary:hover, .account-menu[open] summary { background: #242428; }
.account-menu summary::after { color: #a6a6ad; }
.account-popover { background: #1b1b1f; color: #fff; border-color: #36363c; }
.account-popover .sign-out { color: #fff; background: #2c2c32; border-color: #44444c; }
.workspace { width: min(100%, 1450px); padding: 0 clamp(1.8rem, 4vw, 4.6rem) 4rem; }
.workspace-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 94px; margin-inline: calc(clamp(1.8rem, 4vw, 4.6rem) * -1); padding: 0 clamp(1.8rem, 4vw, 4.6rem); border-bottom: 1px solid #d3d3cf; background: #f7f7f4e8; }
.global-search { position: relative; display: flex; align-items: center; width: min(100%, 455px); min-height: 52px; padding: 0 .75rem; border: 1px solid #d0d0ce; border-radius: .15rem; background: #fff; color: #9495a0; }
.global-search > span { font-size: 2rem; line-height: 1; transform: rotate(-20deg); }
.global-search input { min-height: 42px; border: 0; box-shadow: none; padding: .5rem; background: transparent; }
.global-search input:focus { outline: 0; }
.global-search kbd { padding: .25rem .45rem; border: 1px solid #dedee1; color: #7d7e88; font-size: .7rem; white-space: nowrap; }
.topbar-actions, .topbar-profile { display: flex; align-items: center; gap: 1rem; }
.notification-button { position: relative; width: 52px; height: 52px; padding: 0; border-radius: .15rem; background: #fff; color: #555868; font-size: 1.5rem; }
.notification-button i { position: absolute; top: .7rem; right: .85rem; width: .35rem; height: .35rem; border-radius: 50%; background: #ff735e; }
.topbar-profile > span:first-child { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--attendo-purple); color: #fff; font-weight: 750; }
.topbar-profile > span:nth-child(2) { display: grid; gap: .15rem; }
.topbar-profile strong { font-size: .9rem; }
.topbar-profile small { color: #777b8b; font-size: .75rem; }
.topbar-profile b { color: #999ba4; font-size: 1.2rem; }
.page-title { margin: 2.4rem 0 1.8rem; padding: 0; border: 0; }
.page-title h1 { font-size: clamp(2.2rem, 4vw, 3.35rem); color: var(--attendo-ink); }
.page-title p { font-size: .95rem; }
.panel { border-color: #d6d6d2; border-radius: .15rem; background: #fbfbf8; box-shadow: none; }
.panel:hover { border-color: #c2c2be; }
button, .button { border-radius: .12rem; }
.layout .primary, .primary { background: var(--attendo-lime); border-color: var(--attendo-lime); color: #111113; box-shadow: 3px 3px 0 #111113; }
.layout .primary:hover:not(:disabled), .primary:hover:not(:disabled) { background: #c6ff59; border-color: #c6ff59; }
.metric { border-radius: .08rem; background: #fbfbf8; box-shadow: none; }
.metric:hover { transform: none; box-shadow: none; border-color: #aaa; }
.overview-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.overview-strip article { display: grid; gap: .55rem; min-height: 142px; padding: 1.5rem; border: 1px solid #d5d5d1; border-left: 5px solid var(--attendo-purple); background: #fbfbf8; }
.overview-strip article:nth-child(2) { border-left-color: #91d900; }
.overview-strip article:nth-child(3) { border-left-color: #ff755f; }
.overview-strip span { color: #6f7484; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; font-weight: 700; }
.overview-strip strong { color: var(--attendo-ink); font-size: 2.35rem; line-height: 1; }
.overview-strip small { color: #9294a0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.signal-hero { position: relative; display: flex; justify-content: space-between; min-height: 395px; overflow: hidden; margin-bottom: 1.1rem; padding: 3.5rem 3.3rem; background: #171719; color: #fff; box-shadow: 8px 8px 0 var(--attendo-lime); }
.signal-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(#6f6f76 1px, transparent 1px), linear-gradient(90deg, #6f6f76 1px, transparent 1px); background-size: 25px 25px; mask-image: linear-gradient(90deg, #000, transparent 90%); }
.signal-copy, .signal-visual { position: relative; z-index: 1; }
.system-live { display: inline-flex; align-items: center; gap: .5rem; color: var(--attendo-lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.system-live i, .signal-caption i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--attendo-lime); }
.signal-copy h2 { max-width: 530px; margin: 1.8rem 0 1rem; color: #fff; font-size: clamp(2.7rem, 5.5vw, 4.7rem); line-height: .93; letter-spacing: -.07em; }
.signal-copy h2 em { color: var(--attendo-lime); font-style: normal; }
.signal-copy p { max-width: 310px; color: #afb0b8; line-height: 1.6; }
.signal-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; }
.signal-primary { min-height: 48px; padding-inline: 1.2rem; }
.signal-link { color: #fff; font-size: .8rem; text-decoration: none; }
.signal-link span, .signal-primary span { margin-left: .7rem; font-size: 1.2rem; }
.signal-visual { display: grid; align-content: center; justify-items: center; width: 38%; }
.signal-ring { display: grid; place-items: center; width: clamp(170px, 18vw, 240px); aspect-ratio: 1; border: 9px solid var(--attendo-lime); border-radius: 50%; outline: 1px dashed #73737a; outline-offset: -28px; box-shadow: 0 0 0 13px #b8ff3820; }
.signal-ring strong { font-size: clamp(3rem, 5vw, 4.5rem); letter-spacing: -.1em; }
.signal-ring strong small { color: var(--attendo-lime); font-size: .35em; letter-spacing: 0; }
.signal-ring span { margin-top: -2rem; color: #92939b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .55rem; letter-spacing: .12em; }
.signal-wave { display: flex; align-items: center; gap: .25rem; height: 40px; margin-top: 1.5rem; }
.signal-wave i { display: block; width: 3px; height: 18px; background: #76777e; }
.signal-wave i:nth-child(2), .signal-wave i:nth-child(6) { height: 32px; background: var(--attendo-lime); }.signal-wave i:nth-child(3), .signal-wave i:nth-child(5) { height: 25px; }.signal-wave i:nth-child(4) { height: 38px; background: var(--attendo-lime); }
.signal-caption { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; color: #8f9098; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .6rem; }
.teacher-shell { grid-template-columns: 312px minmax(0, 1fr); background: var(--attendo-canvas); background-image: linear-gradient(#deded9 1px, transparent 1px), linear-gradient(90deg, #deded9 1px, transparent 1px); background-size: 25px 25px; }
.teacher-bar { background: var(--attendo-black); border: 0; color: #fff; padding: 2rem 1.5rem 1.35rem; }
.teacher-main { width: min(100% - 2rem, 1200px); padding-top: 0; }
.teacher-hero { border: 0; border-bottom: 4px solid var(--attendo-lime); border-radius: 0; background: transparent; box-shadow: none; padding: 2.7rem 0 1.6rem; }
.teacher-hero h1 { color: var(--attendo-ink); font-size: 3.1rem; }
.teacher-toolbar, .teacher-register-panel { border-radius: .12rem; background: #fbfbf8; }
.teacher-stat { border-radius: .12rem; background: #fbfbf8 !important; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .app-bar { height: auto; padding: .8rem 1rem; }
  .app-bar .brand::after { display: none; }
  .app-bar nav { margin-top: .8rem; }
  .app-bar nav::before { display: none; }
  .app-bar nav a { min-height: 42px; font-size: .8rem; }
  .workspace { padding-top: 0; }
  .workspace-topbar { margin-inline: -1.25rem; padding-inline: 1.25rem; }
  .overview-strip { grid-template-columns: 1fr; }
  .signal-hero { padding: 2rem; }
  .signal-visual { width: 33%; }
  .teacher-shell { grid-template-columns: 1fr; }
  .teacher-bar { height: auto; flex-direction: row; }
}
@media (max-width: 640px) {
  .workspace-topbar { min-height: 72px; }.global-search { width: 100%; }.global-search kbd { display: none; }.topbar-profile > span:nth-child(2), .topbar-profile b { display: none; }
  .topbar-actions { gap: .5rem; }.notification-button { width: 42px; height: 42px; }.topbar-profile > span:first-child { width: 42px; height: 42px; }
  .signal-hero { min-height: 470px; padding: 2rem 1.5rem; }.signal-visual { position: absolute; right: 1rem; bottom: 1rem; width: auto; transform: scale(.7); transform-origin: bottom right; }.signal-copy h2 { font-size: 3.1rem; }.signal-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .teacher-hero h1 { font-size: 2.2rem; }
}
@media (max-width: 360px) {
  .app-bar nav a { font-size: .73rem; }
}
@media (max-width: 560px) {
  .layout { width: calc(100% - .65rem); margin: .325rem auto; border-radius: 1.35rem; }
  .account-menu summary { width: 2.35rem; height: 2.35rem; }
  .workspace { padding: 1.2rem .85rem; }
  .page-title { margin-bottom: 1.1rem; }
  .filters { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .directory-link { margin-bottom: 0; }
  .register-head, .register-rows li { grid-template-columns: minmax(0, 1fr) minmax(7rem, 8rem); }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-rows button { min-height: 36px; padding-inline: .55rem; }
}

/* Product polish and teacher operations workspace */
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, #d9d1ff 0, transparent 29rem),
    radial-gradient(circle at 100% 12%, #c5f0ee 0, transparent 25rem),
    #e9eef7;
}
.layout { border-color: #c9d3e6; box-shadow: 0 1.5rem 4rem #52638c1c; }
.app-bar { backdrop-filter: blur(18px); background: #f8faffde; }
.brand-mark { box-shadow: 0 .4rem 1.1rem #7268d044; }
.page-title h1 { background: linear-gradient(120deg, #202844 10%, #6454a4 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel { box-shadow: 0 .85rem 2.5rem #53658912, inset 0 1px #ffffffc4; }
.panel:hover { border-color: #becbe2; }
.metric { transition: transform 180ms ease, box-shadow 180ms ease; }
.metric:hover { transform: translateY(-2px); box-shadow: 0 .6rem 1.5rem #44577d18; }
.login { background: radial-gradient(circle at 20% 10%, #c9c0ff, transparent 31rem), radial-gradient(circle at 90% 70%, #bcebe9, transparent 28rem), #e7ecf7; }
.login-card { box-shadow: 0 1.5rem 4rem #3f4e781d, inset 0 1px #ffffff; }
.login-card::before { content: "SECURE ATTENDANCE PLATFORM"; display: block; color: #6a5ba0; font-size: .68rem; font-weight: 800; letter-spacing: .16em; }

.teacher-shell { min-height: 100vh; background: linear-gradient(135deg, #eef2fa 0%, #f9fbff 44%, #e8f5f3 100%); color: var(--ink); }
.teacher-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; padding: .8rem clamp(1rem, 5vw, 5rem); border-bottom: 1px solid #d5deed; background: #ffffffb8; backdrop-filter: blur(20px); }
.teacher-context { display: grid; gap: .1rem; margin-left: auto; margin-right: auto; text-align: center; }
.teacher-context strong { font-size: .95rem; }
.teacher-bar-actions, .teacher-welcome, .teacher-filters, .teacher-savebar, .register-tools, .teacher-search-row { display: flex; align-items: center; gap: .65rem; }
.teacher-bar-actions { justify-content: flex-end; }
.eyebrow { display: block; color: #7666aa; font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.live-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .6rem; border-radius: 2rem; color: #226a57; background: #def4e9; font-size: .76rem; font-weight: 750; }
.live-pill i { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 .24rem #299a7130; }
.ghost-button, .icon-button { background: transparent; border: 1px solid #ced8e9; }
.ghost-button:hover, .icon-button:hover { background: #e9eef8; }
.teacher-main { width: min(100% - 2rem, 1320px); margin: 0 auto; padding: clamp(1.6rem, 5vw, 4rem) 0; }
.teacher-hero { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; overflow: hidden; min-height: 190px; margin-bottom: 1.4rem; padding: clamp(1.4rem, 4vw, 2.8rem); border: 1px solid #d4d8f0; border-radius: 1.6rem; background: linear-gradient(120deg, #fdfdff, #eeeafd 58%, #dbf5f0); box-shadow: 0 1.1rem 3.2rem #52668c18; }
.teacher-hero::after { content: ""; position: absolute; z-index: -1; width: 24rem; height: 24rem; right: -7rem; top: -11rem; border: 1px solid #8e82d844; border-radius: 50%; box-shadow: 0 0 0 2rem #8e82d812, 0 0 0 4rem #8e82d808; }
.teacher-hero h1 { max-width: 31rem; margin: .45rem 0 .6rem; font-size: clamp(2rem, 5vw, 3.6rem); background: linear-gradient(120deg, #28264c, #7060ac); -webkit-background-clip: text; background-clip: text; color: transparent; }
.teacher-hero p { max-width: 34rem; color: #596780; line-height: 1.55; }
.hero-orbit { position: relative; display: grid; place-items: center; width: 9rem; height: 9rem; margin-right: 3rem; border: 1px solid #8c83ce66; border-radius: 50%; color: #5d51a1; font-size: 1.8rem; background: #ffffff55; box-shadow: 0 0 0 1rem #ffffff30, inset 0 0 2rem #a59ce644; }
.hero-orbit::before { content: ""; position: absolute; inset: 1.3rem; border: 1px dashed #8c83ce88; border-radius: 50%; }
.hero-orbit span:nth-child(1) { position: absolute; top: .5rem; right: 1.3rem; color: #4eaf8e; font-size: .8rem; }
.hero-orbit span:nth-child(2) { z-index: 1; }
.hero-orbit span:nth-child(3) { position: absolute; bottom: 1rem; left: .8rem; color: #e69a62; font-size: 1rem; }
.teacher-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid #d4deed; border-radius: 1.2rem; background: #ffffffb8; box-shadow: 0 .55rem 1.8rem #60719512; }
.teacher-welcome small, .teacher-student small { display: block; margin-top: .25rem; color: #697791; font-size: .78rem; }
.teacher-avatar { width: 2.9rem; height: 2.9rem; background: linear-gradient(135deg, #b9a9fa, #8bded4); color: #2f356d; }
.teacher-filters { align-items: end; }
.teacher-filters label { min-width: 12rem; font-size: .76rem; }
.teacher-filters input, .teacher-filters select { min-height: 40px; }
.teacher-summary { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.teacher-stat { display: grid; gap: .28rem; min-height: 108px; padding: 1rem 1.1rem; border: 1px solid #d5dfed; border-radius: 1.1rem; background: #fff; box-shadow: 0 .5rem 1.5rem #53658910; }
.teacher-stat span { color: #62708b; font-size: .8rem; font-weight: 750; }
.teacher-stat strong { font-size: 2.2rem; line-height: 1; letter-spacing: -.05em; }
.teacher-stat small { color: #8390a7; font-size: .72rem; }
.teacher-stat.total { background: linear-gradient(135deg, #e8e2ff, #d8f3f0); color: #473e85; }
.teacher-stat.present { background: #e8f7ef; color: #216b55; }
.teacher-stat.absent { background: #f9e9ef; color: #9a3e5d; }
.teacher-stat.late { background: #fff2dc; color: #936329; }
.teacher-stat.unmarked { background: #edf1f7; color: #52627c; }
.teacher-register-panel { padding: clamp(1rem, 3vw, 1.7rem); }
.register-tools { flex-wrap: wrap; justify-content: flex-end; }
.register-tools button { min-height: 35px; padding: .42rem .7rem; font-size: .78rem; }
.teacher-search-row { justify-content: space-between; margin: 1.1rem 0 .75rem; }
.teacher-search { width: min(100%, 23rem); font-size: .78rem; }
.teacher-search input { min-height: 39px; margin-top: .25rem; }
.register-date { color: #6d7a92; font-size: .82rem; }
.register-date b { color: #b0bacb; padding-inline: .25rem; }
.teacher-table-head, .teacher-roster li { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; gap: 1rem; align-items: center; }
.teacher-table-head { padding: .7rem .85rem; border-radius: .6rem; color: #596a85; background: #edf1f8; font-size: .77rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.teacher-roster { padding: 0; margin: 0; list-style: none; }
.teacher-roster li { min-height: 66px; padding: .55rem .85rem; border-bottom: 1px solid #e0e6f0; transition: background 140ms ease; }
.teacher-roster li:hover { background: #fafbff; }
.teacher-roster select { min-height: 38px; font-size: .85rem; font-weight: 700; }
.teacher-student { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.teacher-student strong { display: block; overflow-wrap: anywhere; }
.teacher-savebar { justify-content: space-between; min-height: 60px; margin-top: 1rem; padding: .75rem .85rem; border-top: 1px solid #dbe3ee; }
.teacher-savebar .notice { font-size: .85rem; }
.teacher-loading { display: grid; place-items: center; gap: .7rem; min-height: 18rem; color: #66758e; }
.spinner { width: 1.8rem; height: 1.8rem; border: 3px solid #d9def0; border-top-color: #7568b3; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.staff-workspace { display: grid; grid-template-columns: minmax(18rem, .72fr) minmax(0, 1.28fr); gap: 1rem; align-items: start; }
.staff-create { position: sticky; top: 1rem; }
.staff-create > p { color: #66758e; font-size: .9rem; line-height: 1.5; }
.staff-directory { min-width: 0; }
.staff-card { margin-top: .8rem; padding: 1rem; background: linear-gradient(135deg, #fff, #f6f8fc); }
.staff-card h3 { margin: 0; font-size: 1rem; }
.staff-card > p { color: #5d6b84; font-size: .85rem; }
.staff-card .assignment-form, .staff-card .password-form { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid #e0e6f0; }
.staff-card fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .7rem; }
.staff-card fieldset label { display: flex; align-items: start; gap: .45rem; font-size: .82rem; font-weight: 550; }
.staff-card fieldset input { width: 1rem; min-height: 1rem; margin-top: .12rem; accent-color: var(--focus); }
.staff-card .account-toggle { margin-top: .7rem; background: #f9e5eb; color: #8c3b57; }
@media (max-width: 900px) { .staff-workspace { grid-template-columns: 1fr; } .staff-create { position: static; } }

@media (max-width: 800px) {
  .teacher-context { display: none; }
  .teacher-hero { min-height: 160px; }
  .hero-orbit { width: 6rem; height: 6rem; margin-right: 0; font-size: 1.2rem; }
  .teacher-toolbar, .teacher-search-row { align-items: stretch; flex-direction: column; }
  .teacher-filters { display: grid; grid-template-columns: 1fr 1fr auto; }
  .teacher-filters label { min-width: 0; }
  .teacher-summary { grid-template-columns: repeat(2, 1fr); }
  .teacher-stat.total { grid-column: span 2; }
}

/* ==========================================================================
   Attendo Classroom Intelligence — Unified Production Theme
   ========================================================================== */
:root {
  color-scheme: light;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ui-ink: #1c1b35;
  --ui-muted: #73738b;
  --ui-purple: #6846f5;
  --ui-purple-dark: #5435d4;
  --ui-lilac: #f4f2fb;
  --ui-card: #ffffff;
  --ui-border: #e5e3ee;
  --ui-shadow: 0 10px 28px rgba(47, 38, 104, .06);
  --focus: #6846f5;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--ui-lilac);
  color: var(--ui-ink);
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3,
.page-title h1,
.signal-copy h2,
.overview-strip strong,
.signal-ring strong,
.teacher-hero h1 {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.student-table-id,
.hud-pill,
.overview-eyebrow {
  font-family: var(--font-mono);
}

button, .button, input, select, textarea {
  font-family: inherit;
}

button, .button {
  min-height: 40px;
  padding: .5rem .95rem;
  border: 1px solid #ddd9eb;
  border-radius: .5rem;
  background: #fff;
  color: var(--ui-ink);
  font-size: .85rem;
  font-weight: 650;
  box-shadow: none;
}

button:hover:not(:disabled), .button:hover {
  background: #f6f4fc;
  border-color: #cbc4e3;
}

.primary, .layout .primary, .layout .button.primary {
  border: 0;
  border-radius: .5rem;
  background: linear-gradient(135deg, #6846f5, #7d59f6);
  color: #fff;
  box-shadow: 0 6px 16px rgba(104, 70, 245, .24);
}

.primary:hover:not(:disabled), .layout .primary:hover:not(:disabled), .layout .button.primary:hover {
  background: linear-gradient(135deg, #5a38e6, #6f49ea);
  box-shadow: 0 8px 20px rgba(104, 70, 245, .32);
}

label {
  color: #363453;
  font-size: .84rem;
  font-weight: 600;
}

input, select, textarea {
  min-height: 40px;
  border: 1px solid #dcd8ea;
  border-radius: .5rem;
  background: #fff;
  color: var(--ui-ink);
  font-size: .88rem;
  box-shadow: none;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--ui-purple);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(104, 70, 245, .14);
}

/* Shell Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--ui-lilac);
}

/* Dark Top Navigation Bar */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  align-items: center;
  gap: 1rem;
  height: auto;
  min-height: 64px;
  padding: .6rem clamp(1rem, 3vw, 2.5rem);
  border: 0;
  border-radius: 0;
  background: #17152d;
  color: #fff;
  box-shadow: 0 6px 20px rgba(17, 15, 36, .18);
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: 0;
  color: #fff;
}

.brand::after,
.app-bar .brand::after {
  content: none !important;
  display: none !important;
}

.brand-logo {
  width: 2.15rem;
  height: 2.15rem;
  flex: none;
  object-fit: contain;
  display: block;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  height: 1.45rem;
}

.brand-wordmark img {
  height: 3.1rem;
  width: auto;
  max-width: none;
  display: block;
  margin-block: -.82rem;
  filter: brightness(1.18) drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.login-card .brand {
  justify-content: flex-start;
  margin-bottom: .5rem;
}

.login-card .brand-logo {
  width: 2.15rem;
  height: 2.15rem;
  flex: none;
  object-fit: contain;
  display: block;
}

.brand-pill {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.app-bar nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.app-bar nav::before {
  display: none;
}

.app-bar nav a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .45rem .8rem;
  border: 1px solid transparent;
  border-radius: .48rem;
  color: #b8b3cf;
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
}

.app-bar nav a:hover {
  background: #262143;
  color: #fff;
}

.app-bar nav a[aria-current] {
  background: #3d2e68;
  border-color: #7d5ae3;
  color: #fff;
  box-shadow: inset 0 -2px #f2a7d4;
}

.app-bar nav a[href] {
  --nav-tint: transparent;
  --nav-ink: currentColor;
}

.app-bar a .nav-icon {
  color: currentColor;
  transform: scale(.86);
}

.app-bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.top-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  min-height: 2.15rem;
  padding: 0;
  border: 1px solid #352f56;
  border-radius: .48rem;
  background: #231e3d;
  color: #e4e0f7;
}

.top-icon-button:hover {
  background: #342c58;
  border-color: #4f467c;
  color: #fff;
}

.top-icon-button svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notif-dot {
  position: absolute;
  top: .36rem;
  right: .38rem;
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: #ff6b6b;
}

.account-menu {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
}

.account-menu summary {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: auto;
  height: auto;
  min-width: 2.15rem;
  padding: .2rem .35rem;
  border-radius: .48rem;
  background: transparent;
  color: #fff;
}

.account-menu summary:hover,
.account-menu[open] summary {
  background: #262143;
}

.account-menu summary::after {
  display: none;
}

.account-menu summary > span:first-child {
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  flex: none;
  border-radius: 50%;
  background: var(--ui-purple);
  color: #fff;
  font-size: .74rem;
  font-weight: 750;
}

.account-copy {
  display: grid;
  gap: .06rem;
  text-align: left;
  line-height: 1.15;
}

.account-copy strong {
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.account-copy small {
  color: #a8a3c2;
  font-size: .64rem;
}

.account-popover {
  background: #231e3d;
  border-color: #443b6d;
  color: #fff;
  box-shadow: 0 18px 38px rgba(17, 13, 40, .42);
}

.account-popover .sign-out {
  background: #38305d;
  border-color: #4f467d;
  color: #fff;
}

/* Main Workspace */
.workspace {
  width: min(100%, 1380px);
  margin-inline: auto;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
  background: var(--ui-lilac);
}

.workspace-topbar {
  display: none;
}

/* Page Title */
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 0 1.35rem;
  padding: 0;
  border: 0;
}

.page-title h1 {
  color: var(--ui-ink);
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.page-title p {
  margin-top: .35rem;
  color: var(--ui-muted);
  font-size: .9rem;
}

.overview-title {
  align-items: flex-end;
}

.overview-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #6b6884;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.overview-eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  background: #d27e5a;
}

.overview-title h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .22em;
  margin: .45rem 0 .25rem;
  font-size: clamp(2.1rem, 3.8vw, 3.1rem);
}

.overview-greeting {
  flex: 0 0 auto;
}

.overview-wordmark {
  display: inline-flex;
  align-items: center;
  height: .88em;
  overflow: hidden;
}

.overview-technula {
  height: 1.75em;
  width: auto;
  object-fit: contain;
  display: block;
}

.overview-date {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .5rem .95rem;
  border: 1px solid #ddd9eb;
  border-radius: .5rem;
  background: #fff;
  color: var(--ui-ink);
  font-size: .82rem;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(47, 38, 104, .05);
  white-space: nowrap;
}

.overview-date svg {
  width: 1rem;
  height: 1rem;
  color: #625f7a;
}

/* Cards & Panels */
.panel, .staff-create, .staff-list, .teacher-toolbar, .teacher-register-panel {
  border: 1px solid var(--ui-border);
  border-radius: .8rem;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbff 100%);
  box-shadow: 0 10px 28px rgba(47, 38, 104, .055), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.panel {
  padding: clamp(1rem, 2vw, 1.35rem);
}

.panel:hover {
  border-color: #d0c8ea;
  box-shadow: 0 14px 34px rgba(47, 38, 104, .085);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.section-heading h2, .panel > h2 {
  color: var(--ui-ink);
  font-size: 1.04rem;
  font-weight: 750;
  letter-spacing: -.015em;
}

.section-heading > span:not(.badge) {
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #f1edff;
  color: var(--ui-purple-dark);
  font-size: .76rem;
  font-weight: 650;
}

.empty, .muted {
  color: var(--ui-muted);
}

/* Overview Hero Banner */
.signal-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: none;
  min-height: 215px;
  overflow: hidden;
  margin-bottom: 1rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-radius: .85rem;
  background: linear-gradient(135deg, #1f194b 0%, #2b2267 55%, #412b8e 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(40, 28, 92, .18);
}

.signal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .11;
  background-image: linear-gradient(#9e94d4 1px, transparent 1px), linear-gradient(90deg, #9e94d4 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent 15%, #000 85%);
}

.signal-copy, .signal-visual {
  position: relative;
  z-index: 1;
}

.system-live {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: #d7ccff;
  font-size: .74rem;
  font-weight: 650;
}

.system-live i, .signal-caption i {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: #8be2b4;
}

.system-live.degraded i, .signal-caption.setup i {
  background: #ff7b7b;
}

.system-live.setup i {
  background: #ffd365;
}

.signal-copy h2 {
  max-width: 540px;
  margin: .55rem 0 .45rem;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.signal-copy p {
  max-width: 440px;
  color: #cbc4e8;
  font-size: .88rem;
  line-height: 1.5;
}

.signal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1.25rem;
}

.signal-primary {
  min-height: 40px;
  padding-inline: 1.1rem;
  border: 0;
  background: linear-gradient(135deg, #6846f5, #7d59f6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(104, 70, 245, .36);
}

.signal-secondary {
  min-height: 40px;
  padding-inline: 1.05rem;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: .5rem;
  background: rgba(255, 255, 255, .06);
  color: #f3f0ff;
  font-size: .84rem;
  font-weight: 650;
}

.signal-secondary:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .4);
}

.signal-visual {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 0 0 auto;
}

.signal-wave {
  display: flex;
  align-items: center;
  gap: .28rem;
  height: 48px;
}

.signal-wave i {
  display: block;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #867cb8;
}

.signal-wave i:nth-child(2),
.signal-wave i:nth-child(6) {
  height: 32px;
  background: #d7a67e;
}

.signal-wave i:nth-child(3),
.signal-wave i:nth-child(5) {
  height: 24px;
  background: #b5a8ea;
}

.signal-wave i:nth-child(4) {
  height: 42px;
  background: #c7a9ff;
}

.signal-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 146px;
  height: 146px;
  border: 6px solid #b598ff;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(169, 139, 255, .14), transparent 68%);
  box-shadow: 0 0 0 10px rgba(169, 139, 255, .12);
  text-align: center;
}

.signal-ring strong {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}

.signal-ring span {
  margin-top: .3rem;
  color: #d5ccef;
  font-size: .68rem;
  font-weight: 600;
}

/* KPI Strip */
.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-bottom: 1rem;
}

.overview-strip article {
  display: grid;
  gap: .35rem;
  min-height: 108px;
  padding: 1.1rem 1.25rem;
  border: 1px solid #e4dff4;
  border-left: 4px solid var(--ui-purple);
  border-radius: .8rem;
  background: linear-gradient(135deg, #ffffff 0%, #f6f3ff 100%);
  box-shadow: var(--ui-shadow);
}

.overview-strip article:nth-child(2) {
  border-color: #dcebe3;
  border-left: 4px solid #599676;
  background: linear-gradient(135deg, #ffffff 0%, #f1faf5 100%);
}

.overview-strip article:nth-child(3) {
  border-color: #f0e2d6;
  border-left: 4px solid #d98b5d;
  background: linear-gradient(135deg, #ffffff 0%, #fff7f1 100%);
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .42rem;
  background: #efeaff;
  color: var(--ui-purple);
  font-size: .85rem;
}

.overview-strip article:nth-child(2) .kpi-icon {
  background: #e5f3ec;
  color: #3f7e5f;
}

.overview-strip article:nth-child(3) .kpi-icon {
  background: #fceee4;
  color: #bd703b;
}

.overview-strip span {
  color: #5d5b74;
  font-size: .8rem;
  font-weight: 650;
}

.overview-strip strong {
  color: var(--ui-ink);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.overview-strip small {
  color: #8b88a0;
  font-size: .74rem;
}

/* Attendance Workspace & Register */
.attendance-workspace, .attendance-detail {
  gap: 1rem;
}

.attendance-filters {
  padding: .95rem 1.2rem;
}

.attendance-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(19rem, .95fr);
  align-items: start;
}

.attendance-detail:has(.automatic-controls[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.register-head {
  border: 1px solid #ece8f4;
  border-radius: .5rem;
  background: #f7f5fb;
  color: #6c6882;
  font-size: .76rem;
  font-weight: 750;
}

.rows li, .register-rows li {
  border-color: #efecf6;
}

.rows li:hover, .register-rows li:hover {
  background: #faf8ff;
}

.metric {
  border: 1px solid var(--ui-border);
  border-radius: .65rem;
  background: #fff;
  box-shadow: var(--ui-shadow);
}

.register-overview .metric {
  min-height: 92px;
}

.register-overview .metric strong {
  font-size: 1.9rem;
}

.automatic-controls {
  background: #fff;
}

/* Student Directory Table */
.student-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.student-split > section:first-child {
  padding: 1.15rem 0 0;
  overflow: hidden;
}

.student-split > section:first-child > .section-heading,
.student-split > section:first-child > .directory-toolbar,
.student-split > section:first-child > .empty,
.student-split > section:first-child > .deleted-students {
  margin-inline: 1.25rem;
}

.directory-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: .9rem;
  margin-bottom: .9rem;
}

.directory-search {
  flex: 1 1 16rem;
  margin: 0;
}

.directory-filter {
  flex: 0 0 auto;
  width: 11.5rem;
}

.student-table-head, .student-rows > li {
  display: grid;
  grid-template-columns: minmax(12rem, 1.5fr) minmax(6rem, .75fr) minmax(7rem, .9fr) minmax(7.5rem, .85fr) minmax(7.5rem, .8fr);
  align-items: center;
  gap: .85rem;
}

.student-table-head {
  padding: .7rem 1.25rem;
  border-block: 1px solid var(--ui-border);
  background: #f6f4fb;
  color: #6d6982;
  font-size: .72rem;
  font-weight: 750;
}

.student-rows {
  margin: 0;
}

.student-rows > li {
  min-height: 62px;
  padding: .55rem 1.25rem;
}

.student-rows > li > .actions {
  justify-content: flex-start;
  gap: .4rem;
}

.student-rows > li > .actions button {
  min-height: 34px;
  padding: .35rem .65rem;
  font-size: .78rem;
}

.student-table-id, .student-table-class {
  color: #57546c;
  font-size: .82rem;
}

.student-table-photo {
  justify-self: start;
  padding: .26rem .58rem;
  border-radius: .35rem;
  background: #fff0df;
  color: #a6622e;
  font-size: .72rem;
  font-weight: 750;
}

.student-table-photo.ready {
  background: #dff1e7;
  color: #2f7053;
}

.table-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid #efecf6;
  color: var(--ui-muted);
  font-size: .78rem;
}

.avatar {
  width: 2.3rem;
  height: 2.3rem;
  background: #eee9ff;
  color: #5b42a6;
  font-size: .78rem;
  font-weight: 750;
}

.avatar-tint-0 { background: #ede9fe; color: #5b3fd6; }
.avatar-tint-1 { background: #fef3c7; color: #b45309; }
.avatar-tint-2 { background: #d1fae5; color: #047857; }
.avatar-tint-3 { background: #e0f2fe; color: #0369a1; }
.avatar-tint-4 { background: #fce7f3; color: #be185d; }
.avatar-tint-5 { background: #e0e7ff; color: #4338ca; }

.class-pill {
  display: inline-flex;
  align-items: center;
  padding: .22rem .55rem;
  border-radius: .38rem;
  background: #f3f1fb;
  color: #4b3d8f;
  font-size: .76rem;
  font-weight: 650;
}

.class-pill.muted {
  background: #f4f4f6;
  color: #7c7a8e;
}

/* Classes Workspace */
.classes-workspace {
  display: grid;
  grid-template-columns: minmax(17rem, .85fr) minmax(0, 1.55fr);
  gap: 1.15rem;
  align-items: start;
}

.class-cards {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
}

.class-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  min-height: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--ui-border);
  border-radius: .65rem;
  background: #faf9fe;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.class-card:hover {
  transform: translateX(3px);
  border-color: #c8bfe8;
  background: #fff;
}

.class-card[aria-pressed="true"] {
  border-color: var(--ui-purple);
  background: linear-gradient(135deg, #f5f2ff, #ffffff);
  box-shadow: 0 6px 18px rgba(104, 70, 245, .12);
}

.class-card-info strong {
  display: block;
  color: var(--ui-ink);
  font-size: .92rem;
  font-weight: 750;
}

.class-card-info small {
  color: var(--ui-muted);
  font-size: .75rem;
}

.class-card-count {
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5435d4;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}

.roster-row-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.roster-student-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

/* Cameras Command Center */
.camera-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(19rem, .95fr);
  gap: 1.15rem;
  align-items: start;
}

.camera-stage .preview {
  position: relative;
  border: 1px solid #2b264e;
  border-radius: .7rem;
  background: radial-gradient(circle at 50% 35%, #241f47, #131126 75%);
  color: #d6d1ee;
}

.camera-feed-list {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
}

.camera-feed-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .8rem .95rem;
  border: 1px solid var(--ui-border);
  border-radius: .6rem;
  background: #faf9fe;
  text-align: left;
}

.camera-feed-card[aria-pressed="true"] {
  border-color: var(--ui-purple);
  background: #f5f2ff;
  box-shadow: 0 4px 14px rgba(104, 70, 245, .1);
}

.camera-feed-card strong {
  display: block;
  font-size: .9rem;
  color: var(--ui-ink);
}

.camera-feed-card small {
  color: var(--ui-muted);
  font-size: .74rem;
}

/* Teachers Directory Upgrade */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.staff-card {
  margin-top: 0;
  padding: 1.15rem;
  border: 1px solid var(--ui-border);
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(47, 38, 104, .05);
}

.staff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .9rem;
}

.staff-card-identity {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.staff-card-identity h3 {
  margin: 0;
  font-size: .98rem;
  color: var(--ui-ink);
}

.staff-card-identity small {
  display: block;
  color: var(--ui-muted);
  font-size: .76rem;
}

.staff-security {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid #efecf6;
}

.staff-security summary {
  color: #5b42a6;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.enroll-button {
  background: #e4f2eb;
  border-color: #cde6d9;
  color: #2f7053;
}

.enroll-button:hover:not(:disabled) {
  background: #d5ebdf;
}

#student-editor {
  width: 100%;
}

/* Cameras Split */
.camera-toolbar {
  gap: .6rem;
}

.preview {
  border: 1px solid #ded9ed;
  border-radius: .6rem;
  background: linear-gradient(135deg, #f2effb, #e7eaf5);
}

.camera-visual {
  border-color: #d9d1f1;
  border-radius: .6rem;
  background: radial-gradient(ellipse at 50% -15%, #c8b9ff, transparent 75%), linear-gradient(145deg, #f0edff, #e5eaf6);
}

/* Teacher Workspace */
.teacher-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  background: var(--ui-lilac);
}

.teacher-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: auto;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  align-items: center;
  padding: .6rem clamp(1rem, 3vw, 2.5rem);
  border: 0;
  background: #17152d;
  color: #fff;
}

.teacher-context {
  margin: 0;
  padding: 0;
  border: 0;
  text-align: center;
}

.teacher-context strong {
  color: #fff;
}

.teacher-bar-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.teacher-bar-actions .ghost-button {
  border-color: #463e6e;
  color: #fff;
}

.teacher-main {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.teacher-hero {
  min-height: 195px;
  margin-bottom: 1rem;
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  border: 0;
  border-radius: .85rem;
  background: linear-gradient(135deg, #1f194b, #3a2b86);
  color: #fff;
  box-shadow: 0 14px 30px rgba(40, 28, 92, .18);
}

.teacher-hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
}

.teacher-hero p {
  color: #d6d1eb;
}

/* Login */
.login {
  background: radial-gradient(circle at 12% 15%, #ddd3ff, transparent 28rem),
              radial-gradient(circle at 90% 85%, #d5f0ea, transparent 28rem),
              var(--ui-lilac);
}

.login-card {
  border: 1px solid var(--ui-border);
  border-radius: .85rem;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 60px rgba(64, 53, 121, .14);
}

.login-card .brand-text strong {
  color: var(--ui-ink);
}

.login-card h1 {
  color: var(--ui-ink);
}

.login-card .primary {
  width: 100%;
}

/* Powered By Footer */
.powered-by {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.powered-by img {
  height: 1.15rem;
  width: auto;
  object-fit: contain;
}

/* System Health Dialog */
.system-health-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-width: none;
  padding: 1.35rem;
  border: 1px solid var(--ui-border);
  border-radius: .85rem;
  background: #fff;
  color: var(--ui-ink);
  box-shadow: 0 20px 50px rgba(23, 21, 45, .22);
}

.system-health-dialog::backdrop {
  background: rgba(23, 21, 45, .45);
}

.system-health-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.system-health-items {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.system-health-items li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .25rem .8rem;
  padding: .75rem 0;
  border-top: 1px solid var(--ui-border);
}

.system-health-items li small {
  grid-column: 1 / -1;
  color: var(--ui-muted);
}

/* Dashboard Animations */
@keyframes ui-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes wave-pulse {
  0%, 100% { transform: scaleY(.55); opacity: .7; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 10px rgba(169, 139, 255, .12); }
  50% { box-shadow: 0 0 0 16px rgba(169, 139, 255, .04); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .75; }
}

.page-title {
  animation: ui-rise .38s cubic-bezier(.22, 1, .36, 1) both;
}

.signal-hero {
  animation: ui-rise .44s cubic-bezier(.22, 1, .36, 1) .04s both;
}

.overview-strip article {
  animation: ui-rise .44s cubic-bezier(.22, 1, .36, 1) both;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.overview-strip article:nth-child(1) { animation-delay: .06s; }
.overview-strip article:nth-child(2) { animation-delay: .12s; }
.overview-strip article:nth-child(3) { animation-delay: .18s; }

.overview-strip article:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(47, 38, 104, .1);
}

#page-content > .split,
#page-content > .attendance-workspace,
#page-content > .staff-workspace,
.teacher-main > * {
  animation: ui-rise .46s cubic-bezier(.22, 1, .36, 1) .14s both;
}

.panel {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.kpi-icon {
  transition: transform .22s ease;
}

.overview-strip article:hover .kpi-icon {
  transform: scale(1.1);
}

.student-rows > li,
.class-card,
.staff-card,
.register-rows > li {
  animation: ui-rise .36s cubic-bezier(.22, 1, .36, 1) both;
}

.student-rows > li:nth-child(2), .class-card:nth-child(2), .staff-card:nth-child(2) { animation-delay: .03s; }
.student-rows > li:nth-child(3), .class-card:nth-child(3), .staff-card:nth-child(3) { animation-delay: .06s; }
.student-rows > li:nth-child(4), .class-card:nth-child(4), .staff-card:nth-child(4) { animation-delay: .09s; }
.student-rows > li:nth-child(5), .class-card:nth-child(5) { animation-delay: .12s; }
.student-rows > li:nth-child(6) { animation-delay: .15s; }
.student-rows > li:nth-child(7) { animation-delay: .18s; }
.student-rows > li:nth-child(8) { animation-delay: .21s; }
.student-rows > li:nth-child(n+9) { animation-delay: .24s; }

.signal-wave i {
  transform-origin: center;
  animation: wave-pulse 1.5s ease-in-out infinite;
}

.signal-wave i:nth-child(2) { animation-delay: .15s; }
.signal-wave i:nth-child(3) { animation-delay: .3s; }
.signal-wave i:nth-child(4) { animation-delay: .45s; }
.signal-wave i:nth-child(5) { animation-delay: .6s; }
.signal-wave i:nth-child(6) { animation-delay: .75s; }
.signal-wave i:nth-child(7) { animation-delay: .9s; }
.signal-wave i:nth-child(8) { animation-delay: 1.05s; }

.signal-ring {
  animation: pulse-ring 3.2s ease-in-out infinite;
}

.system-live i,
.notif-dot {
  animation: pulse-dot 2.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .page-title,
  .signal-hero,
  .overview-strip article,
  #page-content > .split,
  #page-content > .attendance-workspace,
  #page-content > .staff-workspace,
  .teacher-main > *,
  .signal-wave i,
  .signal-ring,
  .system-live i,
  .notif-dot {
    animation: none !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1020px) {
  .app-bar {
    grid-template-columns: 1fr auto;
  }
  .app-bar nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: .15rem;
  }
  .app-bar-right {
    grid-column: 2;
    grid-row: 1;
  }
  .account-copy {
    display: none;
  }
  .attendance-detail, .camera-split, .classes-workspace {
    grid-template-columns: 1fr;
  }
  .teacher-bar {
    grid-template-columns: 1fr auto;
  }
  .teacher-context {
    display: none;
  }
}

@media (max-width: 720px) {
  .workspace, .teacher-main {
    padding-inline: 1rem;
  }
  .page-title {
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
  }
  .signal-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .signal-visual {
    width: 100%;
    justify-content: space-between;
  }
  .overview-strip {
    grid-template-columns: 1fr;
  }
  .directory-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .directory-filter {
    width: 100%;
  }
  .student-table-head {
    display: none;
  }
  .student-rows > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .student-table-id, .student-table-class, .student-table-photo {
    display: none;
  }
}

/* ==========================================================================
   Dark Theme, Toasts, Skeletons, Command Palette & Advanced Components
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --ui-ink: #f0eefb;
  --ui-muted: #a19cbe;
  --ui-lilac: #0e0d1a;
  --ui-card: #171528;
  --ui-border: #2a2645;
  --ui-shadow: 0 14px 32px rgba(0, 0, 0, .35);
}

[data-theme="dark"] body,
[data-theme="dark"] .layout,
[data-theme="dark"] .workspace,
[data-theme="dark"] .teacher-shell {
  background: var(--ui-lilac);
  color: var(--ui-ink);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .metric,
[data-theme="dark"] .staff-card,
[data-theme="dark"] .overview-date,
[data-theme="dark"] .teacher-toolbar,
[data-theme="dark"] .login-card,
[data-theme="dark"] .system-health-dialog,
[data-theme="dark"] .command-dialog,
[data-theme="dark"] .drawer-panel {
  background: linear-gradient(180deg, #19172d 0%, #151325 100%);
  border-color: var(--ui-border);
  color: var(--ui-ink);
}

[data-theme="dark"] .teacher-stat {
  background: #1d1a34;
  border-color: var(--ui-border);
  color: var(--ui-ink);
}

[data-theme="dark"] .overview-strip article {
  background: linear-gradient(135deg, #1b1831 0%, #211c3d 100%);
  border-color: #2f2952;
  border-left-color: #7d5ae3;
  color: var(--ui-ink);
}

[data-theme="dark"] .overview-strip article:nth-child(2) {
  background: linear-gradient(135deg, #172125 0%, #1a2a27 100%);
  border-color: #253b36;
  border-left-color: #599676;
}

[data-theme="dark"] .overview-strip article:nth-child(3) {
  background: linear-gradient(135deg, #211b20 0%, #2b201e 100%);
  border-color: #3e2e2b;
  border-left-color: #d98b5d;
}

[data-theme="dark"] .class-card,
[data-theme="dark"] .camera-feed-card {
  background: #1f1c35;
  border-color: var(--ui-border);
  color: var(--ui-ink);
}

[data-theme="dark"] .class-card[aria-pressed="true"],
[data-theme="dark"] .camera-feed-card[aria-pressed="true"] {
  background: linear-gradient(135deg, #272148, #1d1a33);
  border-color: #7d5ae3;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] button:not(.primary):not(.signal-primary):not(.top-icon-button):not(.danger-button):not(.enroll-button) {
  background: #1f1c35;
  border-color: #322d52;
  color: var(--ui-ink);
}

[data-theme="dark"] .student-table-head,
[data-theme="dark"] .register-head {
  background: #1f1c35;
  border-color: var(--ui-border);
  color: var(--ui-muted);
}

[data-theme="dark"] .rows li,
[data-theme="dark"] .register-rows li,
[data-theme="dark"] .table-footer,
[data-theme="dark"] .staff-security {
  border-color: var(--ui-border);
}

[data-theme="dark"] .rows li:hover,
[data-theme="dark"] .register-rows li:hover {
  background: #201d36;
}

[data-theme="dark"] .class-pill {
  background: #282348;
  color: #cbbefc;
}

[data-theme="dark"] .class-pill.muted {
  background: #211e36;
  color: #8f8aa8;
}

[data-theme="dark"] .page-title h1,
[data-theme="dark"] .section-heading h2,
[data-theme="dark"] .panel > h2,
[data-theme="dark"] .overview-strip strong,
[data-theme="dark"] .class-card-info strong,
[data-theme="dark"] .camera-feed-card strong,
[data-theme="dark"] .staff-card-identity h3,
[data-theme="dark"] label {
  color: var(--ui-ink);
}

[data-theme="dark"] .student-table-id,
[data-theme="dark"] .student-table-class,
[data-theme="dark"] .overview-strip span {
  color: #b7b2d2;
}

/* Floating Toast Stack */
.toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 95;
  display: grid;
  gap: .55rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem;
  border: 1px solid #d7d1ee;
  border-left: 4px solid #6846f5;
  border-radius: .65rem;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  color: var(--ui-ink);
  font-size: .84rem;
  font-weight: 600;
  box-shadow: 0 14px 32px rgba(23, 21, 45, .16);
  pointer-events: auto;
  animation: toast-in .26s cubic-bezier(.22, 1, .36, 1) both;
}

.toast.error {
  border-left-color: #e11d48;
}

.toast.success {
  border-left-color: #10b981;
}

[data-theme="dark"] .toast {
  background: rgba(24, 22, 43, .96);
  border-color: #342f58;
}

.toast button {
  min-height: 24px;
  padding: 0 .35rem;
  border: 0;
  background: transparent;
  color: var(--ui-muted);
  font-size: 1rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Skeleton Loaders */
.skeleton-grid {
  display: grid;
  gap: 1rem;
}

.skeleton-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.skeleton-box {
  height: 108px;
  border-radius: .75rem;
  background: linear-gradient(90deg, rgba(120, 110, 170, .08) 25%, rgba(120, 110, 170, .18) 50%, rgba(120, 110, 170, .08) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.35s infinite linear;
}

.skeleton-panel {
  height: 260px;
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Command Palette */
.command-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: .85rem;
  background: var(--ui-card);
  color: var(--ui-ink);
  box-shadow: 0 24px 60px rgba(17, 15, 36, .28);
  overflow: hidden;
}

.command-dialog::backdrop {
  background: rgba(17, 15, 36, .52);
  backdrop-filter: blur(3px);
}

.command-search-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--ui-border);
}

.command-search-row input {
  border: 0;
  background: transparent !important;
  box-shadow: none !important;
  padding: .25rem 0;
  font-size: .95rem;
}

.command-results {
  max-height: 22rem;
  overflow-y: auto;
  padding: .5rem;
  margin: 0;
  list-style: none;
}

.command-results li button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .65rem .85rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.command-results li button:hover,
.command-results li button[aria-selected="true"] {
  background: #f1edff;
  color: #4b2db8;
}

[data-theme="dark"] .command-results li button:hover,
[data-theme="dark"] .command-results li button[aria-selected="true"] {
  background: #282348;
  color: #d6ccff;
}

.command-tag {
  font-size: .72rem;
  color: var(--ui-muted);
}

/* Animated Hero SVG Ring & Overview Analytics */
.signal-ring {
  position: relative;
  border: 0;
  background: radial-gradient(circle, rgba(169, 139, 255, .14), transparent 68%);
}

.signal-ring svg.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, .14);
  stroke-width: 7;
}

.ring-progress {
  fill: none;
  stroke: #b598ff;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset .85s cubic-bezier(.22, 1, .36, 1);
}

.overview-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(19rem, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.trend-chart-wrap {
  margin-top: .75rem;
}

.trend-svg {
  width: 100%;
  height: 175px;
  display: block;
  overflow: visible;
}

.trend-line {
  fill: none;
  stroke: #6846f5;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw-line 1s ease forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.trend-legend {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-top: .5rem;
  color: var(--ui-muted);
  font-size: .76rem;
}

.activity-list {
  display: grid;
  gap: .65rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .7rem;
  border-radius: .55rem;
  background: #f8f6fd;
}

[data-theme="dark"] .activity-list li {
  background: #1f1c35;
}

.activity-dot {
  width: 2rem;
  height: 2rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: .45rem;
  background: #ede9fe;
  color: #5b3fd6;
  font-size: .82rem;
  font-weight: 800;
}

.activity-list strong {
  display: block;
  font-size: .84rem;
}

.activity-list small {
  color: var(--ui-muted);
  font-size: .74rem;
}

/* Slide-Over Student Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 15, 36, .45);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  width: min(30rem, 100vw);
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--ui-card);
  border-left: 1px solid var(--ui-border);
  box-shadow: -16px 0 44px rgba(17, 15, 36, .22);
  animation: drawer-in .24s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--ui-border);
}

.dropzone-active {
  border-color: var(--ui-purple) !important;
  background: rgba(104, 70, 245, .07) !important;
}

/* Class Progress Bar */
.class-progress {
  width: 100%;
  height: 5px;
  margin-top: .45rem;
  border-radius: 999px;
  background: rgba(104, 70, 245, .14);
  overflow: hidden;
}

.class-progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6846f5, #10b981);
  transition: width .45s ease;
}

/* Camera AI HUD & Grid View */
.camera-hud {
  position: absolute;
  top: .75rem;
  left: .75rem;
  right: .75rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  pointer-events: none;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: rgba(17, 15, 36, .74);
  backdrop-filter: blur(6px);
  color: #f3f1fb;
  font-size: .72rem;
  font-weight: 700;
}

.hud-pill.live i {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 1.6s infinite;
}

.camera-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .85rem;
  margin-top: .85rem;
}

.camera-grid-tile {
  padding: .75rem;
  border: 1px solid var(--ui-border);
  border-radius: .65rem;
  background: rgba(104, 70, 245, .03);
}

@media (max-width: 960px) {
  .overview-analytics {
    grid-template-columns: 1fr;
  }
}

