:root {
  color-scheme: light;
  --font-sans: "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --bg: #eef2f7;
  --bg-strong: #dbe3ef;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --panel-stroke: rgba(255, 255, 255, 0.68);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --ink: #101828;
  --muted: #667085;
  --soft: #f3f7fb;
  --accent: #0071e3;
  --accent-deep: #0056b3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --success: #198754;
  --success-soft: rgba(25, 135, 84, 0.12);
  --warning: #b36b00;
  --warning-soft: rgba(179, 107, 0, 0.13);
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, 0.12);
  --shadow-sm: 0 10px 30px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 20px 60px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 28px 90px rgba(16, 24, 40, 0.16);
  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 999px;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 113, 227, 0.16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(148, 163, 184, 0.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.86), transparent 35%),
    linear-gradient(180deg, #f4f7fb 0%, var(--bg) 36%, #eef3f8 100%);
  overflow-x: hidden;
}

body[data-route="/login"],
body[data-route="/register"] {
  background:
    radial-gradient(circle at top left, rgba(0, 113, 227, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.16), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #edf3f9 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
  z-index: 0;
}

body::before {
  inset: auto auto 5rem -5rem;
  width: 13rem;
  height: 13rem;
  background: rgba(255, 255, 255, 0.52);
}

body::after {
  inset: 4rem -4rem auto auto;
  width: 11rem;
  height: 11rem;
  background: rgba(0, 113, 227, 0.08);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

#app {
  position: relative;
  z-index: 1;
}

.loading-screen,
.app-shell,
.auth-shell {
  min-height: 100vh;
}

.loading-screen {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.loading-card {
  width: min(100%, 420px);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(28px);
  border: 1px solid var(--panel-stroke);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-seal {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, var(--accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.brand-copy span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(16, 24, 40, 0.14);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.spinner.large {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

.auth-shell {
  display: grid;
  gap: 1rem;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.auth-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  backdrop-filter: blur(28px);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  filter: blur(20px);
}

.auth-panel > * {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-heading {
  margin: 1rem 0 0;
  font-size: clamp(2rem, 8vw, 3.45rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.auth-copy {
  max-width: 34rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.feature-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
}

.feature-card strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.feature-card span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.auth-form-shell {
  display: grid;
  gap: 1rem;
}

.form-head h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.form-head p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-grid {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field.compact {
  gap: 0.3rem;
}

.field label,
.field .label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #344054;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.05rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.textarea {
  min-height: 7rem;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.32);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.input-hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.85rem 1.15rem;
  border: 0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.12);
}

.button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #2293ff);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.button.tint {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.button.success {
  background: linear-gradient(135deg, var(--success), #28b463);
  color: #fff;
}

.button.danger {
  background: linear-gradient(135deg, var(--danger), #ee5d52);
  color: #fff;
}

.button.quiet {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.button.block {
  width: 100%;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.muted-copy {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.alert {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.alert.info {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.alert.success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(25, 135, 84, 0.18);
}

.alert.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(217, 45, 32, 0.18);
}

.app-shell {
  position: relative;
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

.chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.9rem 0.9rem 0;
}

.topbar {
  width: min(100%, 1160px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  padding: 0;
  min-width: 0;
}

.brand-button .brand-seal {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.95rem;
}

.segment {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem;
  margin-left: 0.2rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
}

.segment-link,
.mobile-sheet-link,
.dock-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.segment-link {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.segment-link.active {
  background: #fff;
  color: var(--accent-deep);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.09);
}

.toolbar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.identity-chip {
  display: none;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.45rem 0.55rem 0.45rem 0.45rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.identity-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #3b82f6);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.identity-copy {
  min-width: 0;
}

.identity-copy strong,
.identity-copy span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-copy strong {
  font-size: 0.84rem;
  letter-spacing: -0.02em;
}

.identity-copy span {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border-radius: 1rem;
}

.mobile-sheet {
  width: min(100%, 1160px);
  margin: 0.6rem auto 0;
  padding: 0.65rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
}

.mobile-sheet-links {
  display: grid;
  gap: 0.4rem;
}

.mobile-sheet-link {
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  border-radius: 1rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.mobile-sheet-link.active {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent-deep);
}

.page-shell {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 1rem 1rem 0;
  display: grid;
  gap: 1rem;
}

.hero-card,
.glass-card,
.modal-sheet,
.dock,
.toast,
.loading-card {
  backdrop-filter: blur(28px);
}

.hero-card,
.glass-card {
  border: 1px solid var(--panel-stroke);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.hero-card {
  overflow: hidden;
  position: relative;
  padding: 1.35rem;
  border-radius: var(--radius-lg);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  filter: blur(18px);
}

.hero-card > * {
  position: relative;
}

.hero-title {
  margin: 0.95rem 0 0;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-body {
  margin: 0.8rem 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.glass-card {
  padding: 1.1rem;
  border-radius: var(--radius-md);
}

.section-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.section-title h2,
.section-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.section-title p,
.section-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.panel-grid,
.metrics-grid,
.detail-grid,
.people-grid,
.record-grid,
.feature-grid-compact {
  display: grid;
  gap: 0.85rem;
}

.metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.metric-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  margin-top: 0.45rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.metric-subtle {
  color: var(--muted);
}

.metric-success {
  color: var(--success);
}

.metric-accent {
  color: var(--accent-deep);
}

.metric-danger {
  color: var(--danger);
}

.metric-warning {
  color: var(--warning);
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-pill.present,
.status-pill.active,
.tag.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.late,
.tag.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.absent,
.status-pill.inactive,
.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.admin,
.tag.admin {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.status-pill.super_admin,
.tag.super_admin {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.12), rgba(0, 113, 227, 0.12));
  color: #111827;
}

.profile-row,
.record-row,
.setting-row,
.list-card {
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.profile-row:first-child,
.record-row:first-child,
.setting-row:first-child,
.list-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.profile-row:last-child,
.record-row:last-child,
.setting-row:last-child,
.list-card:last-child {
  padding-bottom: 0;
}

.profile-pair,
.meta-pair {
  display: grid;
  gap: 0.15rem;
}

.profile-pair span,
.meta-pair span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.profile-pair strong,
.meta-pair strong {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.camera-shell {
  display: grid;
  gap: 0.85rem;
}

.camera-frame {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 1.5rem;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.camera-stage,
.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  padding: 1rem;
}

.camera-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.capture-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mini-map {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.mini-map strong,
.mini-map span {
  display: block;
}

.mini-map strong {
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}

.mini-map span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  gap: 0.75rem;
  place-items: start;
  padding: 0.4rem 0;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.people-grid,
.record-grid {
  grid-template-columns: 1fr;
}

.person-card,
.record-card {
  padding: 1rem;
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
}

.person-header,
.record-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.avatar {
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.12), rgba(17, 24, 39, 0.08));
  color: var(--accent-deep);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.avatar.large {
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 1.1rem;
}

.person-copy,
.record-copy {
  min-width: 0;
  flex: 1;
}

.person-copy h3,
.record-copy h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.person-copy p,
.record-copy p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.tag-row,
.card-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-row {
  margin-top: 0.9rem;
}

.person-meta,
.record-meta {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.meta-grid {
  display: grid;
  gap: 0.75rem;
}

.filter-bar {
  display: grid;
  gap: 0.75rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.page-button {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.95rem;
}

.page-button.current {
  background: linear-gradient(135deg, var(--accent), #2293ff);
  color: #fff;
}

.page-summary {
  color: var(--muted);
  font-size: 0.84rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.28);
}

.modal-sheet {
  width: min(100%, 760px);
  max-height: min(90vh, 820px);
  overflow: auto;
  border-radius: 1.8rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.2rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
}

.modal-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-body {
  padding: 1rem 1.2rem 1.2rem;
}

.detail-photo-grid {
  display: grid;
  gap: 0.8rem;
}

.detail-photo {
  overflow: hidden;
  border-radius: 1.2rem;
  background: #dfe7f0;
}

.toast-rack {
  position: fixed;
  inset: 1rem 1rem auto;
  z-index: 80;
  display: grid;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  pointer-events: auto;
}

.toast strong {
  display: block;
  font-size: 0.86rem;
}

.toast span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.toast.success .toast-dot {
  background: var(--success);
}

.toast.error .toast-dot {
  background: var(--danger);
}

.toast.info .toast-dot {
  background: var(--accent);
}

.toast-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dock {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.45rem;
  padding: 0.45rem;
  border-radius: 1.5rem;
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
}

.dock-link {
  min-height: 3.5rem;
  display: grid;
  place-items: center;
  gap: 0.22rem;
  padding: 0.45rem;
  border-radius: 1.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.68);
}

.dock-link strong,
.dock-link span {
  display: block;
}

.dock-link strong {
  font-size: 0.82rem;
  line-height: 1;
}

.dock-link.active {
  background: linear-gradient(135deg, var(--accent), #2293ff);
  color: #fff;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .auth-shell {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    padding: 1.4rem 1.4rem 2rem;
  }

  .auth-panel {
    padding: 1.6rem;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid.two-col,
  .meta-grid.two-col,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment,
  .identity-chip,
  .desktop-only {
    display: inline-flex;
  }

  .mobile-only,
  .dock {
    display: none;
  }

  .page-shell {
    padding: 1.15rem 1.4rem 1.5rem;
  }

  .panel-grid.two-up,
  .people-grid,
  .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics-grid.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .modal-backdrop {
    place-items: center;
  }

  .detail-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .page-shell {
    padding-top: 1.35rem;
  }

  .panel-grid.dashboard-main {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .panel-grid.attendance-main {
    grid-template-columns: 1fr 0.9fr;
    align-items: start;
  }

  .hero-card {
    padding: 1.65rem;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
