/* =========================================================
   SchoolManagement — Professional Design System
   Bootstrap 5.3 + custom tokens · Mobile-first
   ========================================================= */

:root {
  --lp-primary: #2563eb;
  --lp-primary-dark: #1d4ed8;
  --lp-primary-soft: #eff6ff;
  --lp-success: #059669;
  --lp-success-soft: #ecfdf5;
  --lp-warning: #d97706;
  --lp-warning-soft: #fffbeb;
  --lp-danger: #dc2626;
  --lp-danger-soft: #fef2f2;
  --lp-info: #0891b2;
  --lp-info-soft: #ecfeff;
  --lp-muted: #64748b;
  --lp-text: #0f172a;
  --lp-text-secondary: #475569;
  --lp-border: #e2e8f0;
  --lp-border-strong: #cbd5e1;
  --lp-bg: #f1f5f9;
  --lp-surface: #ffffff;
  --lp-radius: 12px;
  --lp-radius-sm: 8px;
  --lp-radius-lg: 16px;
  --lp-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --lp-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --lp-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --lp-navbar-h: 56px;
  --lp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lp-safe-bottom: env(safe-area-inset-bottom, 0px);
  --lp-safe-top: env(safe-area-inset-top, 0px);
  --lp-container-pad: clamp(0.75rem, 2.5vw, 1.25rem);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--lp-font);
  background: var(--lp-bg);
  color: var(--lp-text);
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 0.9375rem;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

main.lp-main {
  flex: 1;
  width: 100%;
  padding-top: 1.25rem;
  padding-bottom: calc(2.5rem + var(--lp-safe-bottom));
  padding-left: var(--lp-container-pad);
  padding-right: var(--lp-container-pad);
}

/* Bootstrap container inside main already has padding — avoid double on xs */
main.lp-main.container,
main.lp-main.container-fluid {
  padding-left: var(--lp-container-pad);
  padding-right: var(--lp-container-pad);
}

a { color: var(--lp-primary); text-decoration: none; }
a:hover { color: var(--lp-primary-dark); }
a:focus-visible {
  outline: 2px solid var(--lp-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

img, video, svg { max-width: 100%; height: auto; }

code, .font-monospace {
  font-size: 0.875em;
  background: var(--lp-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #334155;
}

/* ---------- Navbar ---------- */
.lp-navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #172554 100%) !important;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.28);
  min-height: var(--lp-navbar-h);
  padding-top: calc(0.4rem + var(--lp-safe-top));
  padding-bottom: 0.4rem;
  z-index: 1030;
}

.lp-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lp-navbar .navbar-brand i {
  color: #60a5fa;
  font-size: 1.25rem;
}

.lp-navbar .navbar-brand .brand-sub {
  display: none;
  font-weight: 500;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 0.15rem;
}

@media (min-width: 992px) {
  .lp-navbar .navbar-brand .brand-sub { display: inline; }
}

.lp-navbar .nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--lp-radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lp-navbar .nav-link:hover,
.lp-navbar .nav-link:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

.lp-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(37, 99, 235, 0.45);
}

.lp-navbar .dropdown-menu {
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  box-shadow: var(--lp-shadow-md);
  padding: 0.4rem;
  min-width: 200px;
}

.lp-navbar .dropdown-item {
  border-radius: 6px;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
}

.lp-navbar .dropdown-item:hover {
  background: var(--lp-primary-soft);
  color: var(--lp-primary-dark);
}

.lp-navbar .navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.55rem;
  border-radius: var(--lp-radius-sm);
}

.lp-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

.lp-navbar .navbar-toggler-icon {
  filter: invert(1);
  width: 1.15em;
  height: 1.15em;
}

/* Mobile nav stack */
@media (max-width: 991.98px) {
  .lp-navbar .navbar-collapse {
    background: rgba(15, 23, 42, 0.97);
    margin: 0.5rem -0.5rem -0.4rem;
    padding: 0.75rem;
    border-radius: 0 0 var(--lp-radius) var(--lp-radius);
    border-top: 1px solid rgba(255,255,255,0.08);
    max-height: min(70vh, 480px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .lp-navbar .nav-link {
    padding: 0.65rem 0.85rem !important;
    margin-bottom: 0.15rem;
  }
  .lp-navbar .dropdown-menu {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255,255,255,0.1);
  }
  .lp-navbar .dropdown-item {
    color: rgba(255,255,255,0.9);
  }
  .lp-navbar .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.35);
    color: #fff;
  }
}

/* ---------- Page header ---------- */
.lp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.lp-page-header h1,
.lp-page-header .h1,
.lp-page-header .h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--lp-text);
  margin-bottom: 0.2rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: 1.25;
}

.lp-page-header .lp-subtitle {
  color: var(--lp-muted);
  font-size: 0.875rem;
  margin: 0;
  max-width: 42rem;
}

.lp-page-header .lp-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ---------- Cards ---------- */
.lp-card {
  background: var(--lp-surface);
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  box-shadow: var(--lp-shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
  transition: box-shadow 0.2s;
}

.lp-card:hover {
  box-shadow: var(--lp-shadow-md);
}

.lp-card.p-0 {
  padding: 0;
  overflow: hidden;
}

.lp-card.p-0 .table {
  margin-bottom: 0;
}

.lp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--lp-border);
}

.lp-card-header h2,
.lp-card-header .h5,
.lp-card-header .h6 {
  margin: 0;
  font-weight: 600;
}

.lp-card h2.h6,
.lp-card .h6 {
  font-weight: 600;
  color: var(--lp-text);
  margin-bottom: 0.85rem;
}

/* ---------- Stats ---------- */
.lp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.lp-stat-grid .stat {
  background: var(--lp-surface);
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  box-shadow: var(--lp-shadow);
  padding: 1rem 0.85rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

@media (hover: hover) {
  .lp-stat-grid .stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--lp-shadow-md);
  }
}

.lp-stat-grid .stat .num {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--lp-primary);
}

.lp-stat-grid .stat .lbl,
.lp-stat-grid .stat .label {
  font-size: 0.75rem;
  color: var(--lp-muted);
  margin-top: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Tables ---------- */
.lp-card .table,
.table-lp {
  --bs-table-bg: transparent;
  font-size: 0.9rem;
}

.table > :not(caption) > * > * {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  font-weight: 600;
  border-bottom-width: 1px;
  background: #f8fafc;
  white-space: nowrap;
}

.table-hover > tbody > tr:hover {
  background-color: var(--lp-primary-soft);
}

.table-actions {
  white-space: normal;
}

.table-actions .btn {
  margin: 0.1rem;
}

.table-actions form {
  display: inline;
}

/* Responsive table wrapper */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
}

/* Card-style rows on very small screens for data tables marked .table-stack */
@media (max-width: 575.98px) {
  .table-stack thead {
    display: none;
  }
  .table-stack tbody tr {
    display: block;
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: var(--lp-surface);
    box-shadow: var(--lp-shadow);
  }
  .table-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    border: none !important;
    padding: 0.35rem 0 !important;
    text-align: right;
  }
  .table-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--lp-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    flex-shrink: 0;
  }
  .table-stack tbody td.table-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    border-top: 1px dashed var(--lp-border) !important;
    margin-top: 0.35rem;
    padding-top: 0.5rem !important;
  }
  .table-stack tbody td.table-actions::before {
    display: none;
  }
}

/* Teacher workspace: horizontal scroll on tablet, cards on phone */
.lp-workspace-table {
  min-width: 640px;
}

@media (max-width: 575.98px) {
  .lp-workspace-wrap {
    margin: 0 calc(-1 * var(--lp-container-pad));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ---------- Forms ---------- */
.form-label {
  font-weight: 600;
  font-size: 0.825rem;
  color: var(--lp-text-secondary);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-radius: var(--lp-radius-sm);
  border-color: var(--lp-border-strong);
  font-size: 0.9375rem;
  padding: 0.55rem 0.75rem;
  min-height: 2.5rem; /* touch target */
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.form-control-sm,
.form-select-sm {
  min-height: 2.15rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.875rem;
}

.form-check-input {
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.15em;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--lp-primary);
  border-color: var(--lp-primary);
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

.input-group-text {
  border-radius: var(--lp-radius-sm);
  background: #f8fafc;
  border-color: var(--lp-border-strong);
  font-size: 0.875rem;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--lp-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--lp-primary-dark);
  border-color: var(--lp-primary-dark);
}

.btn-outline-primary {
  color: var(--lp-primary);
  border-color: var(--lp-primary);
}

.btn-outline-primary:hover {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
}

/* Sticky save bar (mobile forms / workspace) */
.lp-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--lp-border);
  padding: 0.75rem var(--lp-container-pad);
  padding-bottom: calc(0.75rem + var(--lp-safe-bottom));
  margin: 0 calc(-1 * var(--lp-container-pad)) calc(-1 * var(--lp-container-pad));
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.lp-card .lp-sticky-actions {
  margin-left: -1.35rem;
  margin-right: -1.35rem;
  margin-bottom: -1.25rem;
  border-radius: 0 0 var(--lp-radius) var(--lp-radius);
}

/* ---------- Badges ---------- */
.badge {
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.35em 0.6em;
  border-radius: 6px;
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--lp-radius-sm);
  border: none;
  font-size: 0.9rem;
  box-shadow: var(--lp-shadow);
}

.alert-success {
  background: var(--lp-success-soft);
  color: #065f46;
}

.alert-danger {
  background: var(--lp-danger-soft);
  color: #991b1b;
}

.alert-warning {
  background: var(--lp-warning-soft);
  color: #92400e;
}

.alert-info {
  background: var(--lp-info-soft);
  color: #155e75;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  background: transparent;
  padding: 0;
  flex-wrap: wrap;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--lp-muted);
}

/* ---------- List groups ---------- */
.list-group-item {
  border-color: var(--lp-border);
  padding: 0.75rem 1rem;
}

.list-group-flush .list-group-item:first-child {
  border-top: none;
}

/* ---------- Footer ---------- */
.lp-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  padding: 1.15rem 0;
  padding-bottom: calc(1.15rem + var(--lp-safe-bottom));
  margin-top: auto;
}

.lp-footer a {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Login / auth ---------- */
.lp-auth-wrap {
  min-height: calc(100dvh - var(--lp-navbar-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.lp-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--lp-surface);
  border-radius: var(--lp-radius-lg);
  border: 1px solid var(--lp-border);
  box-shadow: var(--lp-shadow-lg);
  padding: 1.75rem 1.5rem;
}

@media (min-width: 576px) {
  .lp-auth-card {
    padding: 2rem 2.25rem;
  }
}

.lp-auth-card .auth-title {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.lp-auth-card .auth-sub {
  color: var(--lp-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ---------- Hero (home) ---------- */
.lp-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
  box-shadow: var(--lp-shadow-lg);
}

.lp-hero h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.lp-hero p {
  opacity: 0.9;
  max-width: 36rem;
}

/* ---------- Definition lists ---------- */
.lp-card dl.row dt {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--lp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.45rem;
}

.lp-card dl.row dd {
  padding-top: 0.35rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--lp-border);
  padding-bottom: 0.5rem;
}

.lp-card dl.row dd:last-of-type {
  border-bottom: none;
}

/* ---------- Chip / filter bar ---------- */
.lp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.lp-filter-bar .form-control,
.lp-filter-bar .form-select {
  min-width: 0;
  flex: 1 1 140px;
}

.lp-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.lp-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--lp-border-strong);
  background: var(--lp-surface);
  color: var(--lp-text-secondary);
  transition: all 0.15s;
  min-height: 2.15rem;
}

.lp-chip:hover {
  border-color: var(--lp-primary);
  color: var(--lp-primary);
}

.lp-chip.active {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}

/* ---------- Timeline (Parent diary) ---------- */
.lp-timeline {
  position: relative;
  padding-left: 1.25rem;
}

.lp-timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: var(--lp-border-strong);
  border-radius: 1px;
}

.lp-timeline-item {
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 0.25rem;
}

.lp-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 0.45rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--lp-primary);
  border: 2px solid var(--lp-surface);
  box-shadow: 0 0 0 2px var(--lp-primary-soft);
}

.lp-timeline-item .tl-date {
  font-weight: 700;
  font-size: 0.85rem;
}

.lp-timeline-item .tl-meta {
  font-size: 0.8rem;
  color: var(--lp-muted);
}

/* ---------- Message bubbles ---------- */
.lp-msg {
  border-radius: var(--lp-radius);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  max-width: 100%;
}

.lp-msg-out {
  background: var(--lp-primary-soft);
  border: 1px solid #bfdbfe;
  margin-left: 1rem;
}

.lp-msg-in {
  background: #f8fafc;
  border: 1px solid var(--lp-border);
  margin-right: 1rem;
}

.lp-msg .msg-meta {
  font-size: 0.7rem;
  color: var(--lp-muted);
  margin-bottom: 0.2rem;
}

/* ---------- Utilities ---------- */
.lp-text-muted { color: var(--lp-muted) !important; }
.lp-fw-bold { font-weight: 700; }
.lp-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.lp-empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--lp-muted);
}

.lp-empty i {
  font-size: 2.5rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 0.75rem;
}

/* Code editor textarea */
textarea.font-monospace {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
  border-radius: var(--lp-radius-sm);
  line-height: 1.5;
}

textarea.font-monospace:focus {
  background: #0f172a;
  color: #f8fafc;
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* ---------- Responsive breakpoints ---------- */
@media (max-width: 767.98px) {
  .lp-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .lp-page-header .lp-header-actions,
  .lp-page-header > .btn,
  .lp-page-header > a.btn {
    width: 100%;
  }
  .lp-page-header > .btn,
  .lp-page-header > a.btn {
    justify-content: center;
  }
  .lp-card {
    padding: 1rem 1.05rem;
    border-radius: var(--lp-radius-sm);
  }
  .table-actions .btn {
    margin-bottom: 0.2rem;
  }
  /* Stack action buttons full-width on phone where helpful */
  .lp-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .lp-actions-stack .btn {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  body { font-size: 0.9rem; }
  main.lp-main {
    padding-top: 1rem;
  }
  .btn-group-mobile {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.35rem;
  }
}

/* Print */
@media print {
  .lp-navbar, .lp-footer, .lp-sticky-actions, .navbar-toggler {
    display: none !important;
  }
  body { background: #fff; }
  .lp-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Feature grid (home) ---------- */
.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.lp-feature {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
  padding: 1.25rem;
  transition: box-shadow 0.2s, transform 0.15s;
}
@media (hover: hover) {
  .lp-feature:hover {
    box-shadow: var(--lp-shadow-md);
    transform: translateY(-2px);
  }
}
.lp-feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: var(--lp-primary-soft);
  color: var(--lp-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}
.lp-feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.lp-feature p {
  font-size: 0.875rem;
  color: var(--lp-muted);
  margin: 0;
  line-height: 1.45;
}

/* =========================================================
   Teacher Workspace (ws-*)
   ========================================================= */
.ws-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--lp-shadow-md);
}
.ws-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.ws-hero h1 { color: #fff; font-weight: 800; letter-spacing: -0.02em; }
.ws-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ws-class-pill,
.ws-date-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.ws-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.85rem 1rem !important;
}
@media (min-width: 768px) {
  .ws-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.ws-class-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}
.ws-class-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.9rem;
  border-radius: var(--lp-radius-sm);
  border: 1px solid var(--lp-border-strong);
  background: #f8fafc;
  color: var(--lp-text-secondary);
  min-width: 6.5rem;
  transition: all 0.15s;
}
.ws-class-chip:hover {
  border-color: var(--lp-primary);
  color: var(--lp-primary);
}
.ws-class-chip.active {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.ws-class-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.ws-class-year { font-size: 0.7rem; opacity: 0.8; margin-top: 0.1rem; }

.ws-date-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ws-date-form { margin: 0; }
.ws-date-form .form-control { width: auto; min-width: 9.5rem; }

.ws-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 575.98px) {
  .ws-stats { grid-template-columns: repeat(3, 1fr); }
  .ws-stats .ws-stat:nth-child(4),
  .ws-stats .ws-stat:nth-child(5) { grid-column: span 1; }
}
.ws-stat {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  padding: 0.65rem 0.4rem;
  text-align: center;
  box-shadow: var(--lp-shadow);
}
.ws-stat-num {
  display: block;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--lp-text);
}
.ws-stat-den { font-size: 0.75em; font-weight: 600; color: var(--lp-muted); }
.ws-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}
.ws-stat-ok .ws-stat-num { color: var(--lp-success); }
.ws-stat-warn .ws-stat-num { color: var(--lp-warning); }
.ws-stat-bad .ws-stat-num { color: var(--lp-danger); }

.ws-quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
}
.ws-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ws-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.ws-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
  overflow: hidden;
  border-left: 4px solid var(--lp-border-strong);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ws-card.is-logged { border-left-color: var(--lp-success); }
.ws-card[data-att="Present"] { border-left-color: var(--lp-success); }
.ws-card[data-att="Late"] { border-left-color: var(--lp-warning); }
.ws-card[data-att="Absent"] { border-left-color: var(--lp-danger); }
.ws-card[data-att="Excused"] { border-left-color: var(--lp-info); }
.ws-card:focus-within {
  box-shadow: var(--lp-shadow-md);
  border-color: #bfdbfe;
}

.ws-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--lp-border);
}
.ws-student {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.ws-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ws-student-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ws-student-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-student-meta {
  font-size: 0.75rem;
  color: var(--lp-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.ws-badge-logged {
  color: var(--lp-success);
  font-weight: 600;
  background: var(--lp-success-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
}
.ws-badge-new {
  color: var(--lp-muted);
  font-weight: 500;
}

.ws-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 1rem;
}
@media (min-width: 576px) {
  .ws-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ws-field-att { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  .ws-card-grid {
    grid-template-columns: 10rem 1fr 1fr 1fr 1.4fr;
    align-items: end;
  }
  .ws-field-att { grid-column: auto; }
  .ws-field-notes { grid-column: auto; }
}
.ws-field .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
}

/* Attendance select colors */
.att-select.att-Present {
  border-color: #6ee7b7;
  background-color: #ecfdf5;
  color: #065f46;
  font-weight: 600;
}
.att-select.att-Absent {
  border-color: #fca5a5;
  background-color: #fef2f2;
  color: #991b1b;
  font-weight: 600;
}
.att-select.att-Late {
  border-color: #fcd34d;
  background-color: #fffbeb;
  color: #92400e;
  font-weight: 600;
}
.att-select.att-Excused {
  border-color: #67e8f9;
  background-color: #ecfeff;
  color: #155e75;
  font-weight: 600;
}

.ws-save-bar {
  margin-top: 0.5rem;
}

/* =========================================================
   Parent Portal (pp-*)
   ========================================================= */
.pp-hero {
  background: linear-gradient(135deg, #831843 0%, #be185d 45%, #f43f5e 100%);
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--lp-shadow-md);
}
.pp-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}
.pp-hero h1 { color: #fff; font-weight: 800; }

.pp-child-picker {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}
.pp-child-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.95rem 0.55rem 0.55rem;
  background: var(--lp-surface);
  border: 2px solid var(--lp-border);
  border-radius: 999px;
  min-width: 0;
  max-width: 16rem;
  transition: all 0.15s;
  box-shadow: var(--lp-shadow);
}
.pp-child-chip:hover {
  border-color: #fb7185;
  color: inherit;
}
.pp-child-chip.active {
  border-color: #e11d48;
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  box-shadow: 0 2px 12px rgba(225, 29, 72, 0.2);
}
.pp-child-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #be185d);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-child-chip.active .pp-child-avatar {
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
}
.pp-child-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pp-child-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-child-class {
  font-size: 0.72rem;
  color: var(--lp-muted);
}

.pp-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.pp-profile-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.pp-profile-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-mini-stats {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.pp-mini {
  text-align: center;
  min-width: 3.5rem;
  padding: 0.4rem 0.55rem;
  background: #f8fafc;
  border-radius: var(--lp-radius-sm);
  border: 1px solid var(--lp-border);
}
.pp-mini .num {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
}
.pp-mini .lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--lp-muted);
  font-weight: 600;
}

.pp-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pp-day {
  display: flex;
  gap: 0.85rem;
  position: relative;
  padding-bottom: 1.15rem;
}
.pp-day:last-child { padding-bottom: 0; }
.pp-day-rail {
  width: 0.75rem;
  flex-shrink: 0;
  position: relative;
}
.pp-day-rail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  border-radius: 50%;
  background: var(--lp-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #bfdbfe;
  z-index: 1;
}
.pp-day-rail::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 1.1rem;
  bottom: -0.2rem;
  width: 2px;
  margin-left: -1px;
  background: var(--lp-border);
}
.pp-day:last-child .pp-day-rail::after { display: none; }
.pp-day.att-present .pp-day-rail::before { background: var(--lp-success); box-shadow: 0 0 0 2px #a7f3d0; }
.pp-day.att-absent .pp-day-rail::before { background: var(--lp-danger); box-shadow: 0 0 0 2px #fecaca; }
.pp-day.att-late .pp-day-rail::before { background: var(--lp-warning); box-shadow: 0 0 0 2px #fde68a; }
.pp-day.att-excused .pp-day-rail::before { background: var(--lp-info); box-shadow: 0 0 0 2px #a5f3fc; }

.pp-day-body {
  flex: 1;
  min-width: 0;
  background: #f8fafc;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  padding: 0.75rem 0.9rem;
}
.pp-day.att-present .pp-day-body { border-left: 3px solid var(--lp-success); }
.pp-day.att-absent .pp-day-body { border-left: 3px solid var(--lp-danger); }
.pp-day.att-late .pp-day-body { border-left: 3px solid var(--lp-warning); }
.pp-day.att-excused .pp-day-body { border-left: 3px solid var(--lp-info); }

.pp-day-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.pp-day-date {
  font-size: 0.8rem;
  color: var(--lp-muted);
  text-transform: capitalize;
}
.pp-day-date strong {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--lp-text);
  font-size: 0.95rem;
}
.pp-att-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.att-present .pp-att-badge { background: var(--lp-success-soft); color: #065f46; }
.att-absent .pp-att-badge { background: var(--lp-danger-soft); color: #991b1b; }
.att-late .pp-att-badge { background: var(--lp-warning-soft); color: #92400e; }
.att-excused .pp-att-badge { background: var(--lp-info-soft); color: #155e75; }

.pp-day-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
}
.pp-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--lp-border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}
.pp-fact-ico { font-size: 0.95rem; }
.pp-day-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--lp-text-secondary);
  font-style: italic;
}

/* Chat */
.pp-chat {
  min-height: 420px;
  max-height: min(640px, 75vh);
}
.pp-chat-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 180px;
}
.pp-chat-empty {
  text-align: center;
  color: var(--lp-muted);
  padding: 2rem 1rem;
  font-size: 0.875rem;
}
.pp-chat-empty i {
  font-size: 2rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 0.5rem;
}
.pp-bubble {
  max-width: 92%;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.pp-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pp-bubble.in {
  align-self: flex-start;
  background: #f1f5f9;
  border: 1px solid var(--lp-border);
  color: var(--lp-text);
  border-bottom-left-radius: 4px;
}
.pp-bubble-meta {
  font-size: 0.68rem;
  opacity: 0.8;
  margin-bottom: 0.15rem;
  font-weight: 600;
}
.pp-bubble.out .pp-bubble-meta { color: rgba(255,255,255,0.85); }
.pp-chat-compose {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--lp-border);
  padding-top: 0.85rem;
  margin-top: auto;
}
.pp-chat-compose .form-control {
  resize: none;
  min-height: 2.75rem;
}
.pp-chat-compose .btn {
  align-self: flex-end;
}

@media (max-width: 575.98px) {
  .ws-hero, .pp-hero {
    border-radius: var(--lp-radius);
    padding: 1rem 1.05rem;
  }
  .pp-profile {
    flex-direction: column;
    align-items: stretch;
  }
  .pp-mini-stats {
    justify-content: space-between;
  }
  .pp-mini {
    flex: 1;
  }
}

/* =========================================================
   Compatibility layer — classes used across Projects / Admin /
   Leads / Surveys / Redirects / School forms
   ========================================================= */

/* Auth subtitle */
.lp-auth-sub {
  color: var(--lp-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Collection header (project details) */
.lp-collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Mode cards (Lead / Survey / None) */
.lp-mode-card {
  border: 2px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 1.35rem;
  height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: pointer;
  background: var(--lp-surface);
  text-align: left;
  color: inherit;
}
.lp-mode-card:hover:not(.active):not(.disabled) {
  border-color: var(--lp-primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  color: inherit;
}
.lp-mode-card.active {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
  cursor: default;
  box-shadow: 0 0 0 1px var(--lp-primary);
}
.lp-mode-card.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}
.lp-mode-card .mode-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--lp-primary);
}
.lp-mode-card h5 {
  margin-bottom: 0.35rem;
  font-weight: 700;
  font-size: 1rem;
}
.lp-mode-card p {
  font-size: 0.875rem;
  color: var(--lp-muted);
  margin-bottom: 0;
  line-height: 1.45;
}

/* Empty state (Projects, lists) */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--lp-muted);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.45;
  display: block;
  color: var(--lp-primary);
}
.empty-state p {
  font-size: 1rem;
  margin-bottom: 1.15rem;
}

/* Collection mode badges */
.badge-mode-none {
  background: #64748b !important;
  color: #fff !important;
}
.badge-mode-lead {
  background: var(--lp-primary) !important;
  color: #fff !important;
}
.badge-mode-survey {
  background: var(--lp-success) !important;
  color: #fff !important;
}

/* Status badges common */
.badge-status-active {
  background: var(--lp-success-soft) !important;
  color: #065f46 !important;
}
.badge-status-inactive {
  background: #f1f5f9 !important;
  color: #64748b !important;
}
.badge-status-draft {
  background: var(--lp-warning-soft) !important;
  color: #92400e !important;
}
.badge-status-published {
  background: var(--lp-success-soft) !important;
  color: #065f46 !important;
}

/* Pagination */
.pagination .page-link {
  border-radius: 6px !important;
  margin: 0 0.15rem;
  border-color: var(--lp-border);
  color: var(--lp-text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 2.25rem;
  text-align: center;
}
.pagination .page-item.active .page-link {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}
.pagination .page-link:hover {
  background: var(--lp-primary-soft);
  color: var(--lp-primary-dark);
  border-color: #bfdbfe;
}

/* Modal polish */
.modal-content {
  border: none;
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow-lg);
}
.modal-header {
  border-bottom-color: var(--lp-border);
  padding: 1rem 1.25rem;
}
.modal-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.modal-footer {
  border-top-color: var(--lp-border);
  padding: 0.85rem 1.25rem;
}
.modal-body {
  padding: 1.15rem 1.25rem;
}

/* Nav tabs (project sub-pages) */
.nav-tabs {
  border-bottom-color: var(--lp-border);
  gap: 0.15rem;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--lp-muted);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--lp-radius-sm) var(--lp-radius-sm) 0 0;
}
.nav-tabs .nav-link:hover {
  color: var(--lp-primary);
  border-bottom-color: #bfdbfe;
  background: transparent;
}
.nav-tabs .nav-link.active {
  color: var(--lp-primary);
  border-bottom-color: var(--lp-primary);
  background: transparent;
}

/* Code / slug chips */
code {
  font-size: 0.82em;
  background: #f1f5f9;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: #334155;
  word-break: break-all;
}

/* Form pages — consistent max width */
.lp-form-narrow {
  max-width: 32rem;
}
.lp-form-medium {
  max-width: 40rem;
}
.lp-form-wide {
  max-width: 56rem;
}

/* Toolbar row above tables */
.lp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.lp-toolbar .lp-toolbar-left,
.lp-toolbar .lp-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Soft status pills for school */
.lp-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.lp-status-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.lp-status-pill.is-active { background: var(--lp-success-soft); color: #065f46; }
.lp-status-pill.is-warn { background: var(--lp-warning-soft); color: #92400e; }
.lp-status-pill.is-danger { background: var(--lp-danger-soft); color: #991b1b; }

/* Avatar circle utility (shared school + projects) */
.lp-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  flex-shrink: 0;
}
.lp-avatar-lg {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.25rem;
}
.lp-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
}

/* Detail two-column grids on small screens */
.lp-detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 992px) {
  .lp-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .lp-detail-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Sticky page actions on forms (mobile) */
.lp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lp-border);
}
@media (max-width: 575.98px) {
  .lp-form-actions {
    flex-direction: column;
  }
  .lp-form-actions .btn {
    width: 100%;
  }
}

/* Ensure table-light thead matches design */
.table thead.table-light th,
.table-light {
  --bs-table-bg: #f8fafc;
  --bs-table-color: var(--lp-muted);
}

/* Admin role toggle buttons wrap nicely */
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
  max-width: 22rem;
}
@media (max-width: 991.98px) {
  .table-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

/* Dropdown in dark navbar — ensure readable */
.lp-navbar .dropdown-menu {
  z-index: 1040;
}

/* Offcanvas-like mobile filter (utility) */
.lp-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Parent/Teacher structural aliases (safety) */
.pp-bubble-text { word-break: break-word; }
.pp-diary { }
.ws-hero-text { min-width: 0; }

/* Students / Classes create-edit forms */
.lp-card .row.g-2 > [class*="col-"] .form-label {
  margin-bottom: 0.25rem;
}

/* Global focus visible for keyboard users */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--lp-primary);
  outline-offset: 2px;
}

/* Dark footer was intentional in redesign — keep light text */
.lp-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.65);
  border-top: none;
}
.lp-footer .text-muted,
.lp-footer .opacity-75 {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* ---- Extra responsive polish for legacy project pages ---- */
@media (max-width: 767.98px) {
  .lp-mode-card {
    padding: 1rem;
  }
  .lp-mode-card .mode-icon {
    font-size: 1.5rem;
  }
  .empty-state {
    padding: 2rem 1rem;
  }
  .empty-state i {
    font-size: 2.25rem;
  }
  /* Project index tables: allow horizontal scroll with edge fade hint */
  .lp-card .table-responsive {
    border-radius: 0 0 var(--lp-radius-sm) var(--lp-radius-sm);
  }
  .breadcrumb {
    font-size: 0.75rem;
  }
}

/* Toast-like temp alerts spacing */
main.lp-main > .alert {
  margin-bottom: 1rem;
}

/* Validation summary */
.validation-summary-errors ul,
.text-danger.field-validation-error {
  font-size: 0.85rem;
}
.validation-summary-errors {
  background: var(--lp-danger-soft);
  border-radius: var(--lp-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* HR in cards */
.lp-card hr {
  border-color: var(--lp-border);
  opacity: 1;
  margin: 1rem 0;
}

/* Button group spacing */
.btn + .btn {
  /* rely on gap where flex; fallback margin for inline */
}
.d-inline > form + form,
.d-inline form {
  display: inline;
}

/* Loading / disabled opacity consistency */
.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Ensure images in content don't overflow */
.lp-card img {
  max-width: 100%;
  height: auto;
  border-radius: var(--lp-radius-sm);
}

/* School Details sections */
.lp-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Progress thin bar utility */
.lp-progress {
  height: 0.4rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.lp-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 999px;
}

/* Skip link a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lp-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  border-radius: 0 0 var(--lp-radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* =========================================================
   Teacher Workspace — messages with parents (ws-msg-*)
   ========================================================= */
.ws-msg-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--lp-border-strong);
  scroll-margin-top: calc(var(--lp-navbar-h) + 0.75rem);
}
.ws-msg-header {
  margin-bottom: 0.85rem;
}
.ws-msg-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  min-height: 420px;
}
@media (min-width: 992px) {
  .ws-msg-layout {
    grid-template-columns: minmax(240px, 300px) 1fr;
    align-items: stretch;
  }
}

.ws-msg-list {
  display: flex;
  flex-direction: column;
  max-height: min(520px, 70vh);
  overflow: hidden;
}
.ws-msg-list-head {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  border-bottom: 1px solid var(--lp-border);
  background: #f8fafc;
}
.ws-msg-list-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.ws-msg-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--lp-border);
  color: inherit;
  transition: background 0.12s;
}
.ws-msg-item:hover {
  background: var(--lp-primary-soft);
  color: inherit;
}
.ws-msg-item.active {
  background: linear-gradient(90deg, #eff6ff, #fff);
  border-left: 3px solid var(--lp-primary);
  padding-left: calc(0.85rem - 3px);
}
.ws-msg-item.has-unread .ws-msg-item-name {
  font-weight: 800;
}
.ws-msg-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ws-msg-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.ws-msg-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-msg-item-preview {
  font-size: 0.75rem;
  color: var(--lp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-msg-unread {
  flex-shrink: 0;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--lp-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ws-avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
}

.ws-msg-thread {
  min-height: 380px;
  max-height: min(560px, 75vh);
  overflow: hidden;
}
.ws-msg-thread-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--lp-border);
  background: #f8fafc;
}
.ws-msg-thread-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}
.ws-msg-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--lp-muted);
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
  gap: 0.5rem;
}
.ws-msg-placeholder i {
  font-size: 2.25rem;
  opacity: 0.4;
  color: var(--lp-primary);
}
.ws-msg-compose {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--lp-border);
  background: var(--lp-surface);
}
.ws-msg-compose .form-control {
  resize: none;
  min-height: 2.75rem;
}
.ws-msg-compose .btn {
  align-self: flex-end;
}

/* On small screens: if chat selected, emphasize thread */
@media (max-width: 991.98px) {
  .ws-msg-layout.has-chat .ws-msg-list {
    max-height: 220px;
  }
}
.ws-card-chat {
  flex-shrink: 0;
  position: relative;
  padding: 0.35rem 0.5rem;
}
.ws-card-chat .ws-msg-unread {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
}

/* Realtime status indicator */
.ws-rt-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lp-muted);
}
.ws-rt-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}
.ws-rt-status.is-on .ws-rt-dot {
  background: var(--lp-success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25);
}
.ws-rt-status.is-on { color: #065f46; }
.ws-rt-status.is-off .ws-rt-dot { background: var(--lp-danger); }
.ws-rt-status.is-off { color: #991b1b; }

/* School media */
.school-avatar-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--lp-shadow-md);
}
.school-avatar-wrap {
  position: relative;
}
.ws-field-photos {
  grid-column: 1 / -1;
}
.ws-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  min-height: 0.5rem;
}
.ws-photo-thumb {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: var(--lp-radius-sm);
  overflow: hidden;
  border: 1px solid var(--lp-border);
  box-shadow: var(--lp-shadow);
}
.ws-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin media library */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.85rem;
}
.media-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-card-preview {
  position: relative;
  aspect-ratio: 1;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-card-preview img,
.media-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-check {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
  margin: 0;
}
.media-video-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  background: rgba(15,23,42,0.35);
  pointer-events: none;
}
.media-file-icon {
  color: rgba(255,255,255,0.5);
  font-size: 2.5rem;
}
.media-card-meta {
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.media-path {
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  color: var(--lp-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--lp-muted);
  align-items: center;
}
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* =========================================================
   Admin Users (au-*)
   ========================================================= */
.au-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--lp-shadow-md);
}
.au-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.au-hero h1 { color: #fff; font-weight: 800; }
.au-hero .btn-light {
  font-weight: 600;
  border: none;
  box-shadow: var(--lp-shadow);
}

.au-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem !important;
  margin-bottom: 1rem;
}
.au-toolbar .form-select { width: auto; min-width: 8.5rem; }
.au-toolbar-search {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 20rem;
}
.au-toolbar-search i {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lp-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.au-toolbar-search .form-control {
  padding-left: 2rem;
}
.au-toolbar-count {
  width: 100%;
}
@media (min-width: 768px) {
  .au-toolbar-count { width: auto; }
}

.au-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.au-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
  overflow: hidden;
  border-left: 4px solid var(--lp-primary);
  transition: box-shadow 0.15s;
}
.au-card:hover { box-shadow: var(--lp-shadow-md); }
.au-card.is-locked {
  border-left-color: var(--lp-warning);
  background: linear-gradient(90deg, #fffbeb 0%, #fff 40%);
}

.au-card-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.1rem 0.65rem;
}
.au-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.au-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.au-email {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-all;
}
.au-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.au-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.au-pill-ok { background: var(--lp-success-soft); color: #065f46; }
.au-pill-warn { background: var(--lp-warning-soft); color: #92400e; }

.au-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.au-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: #fff;
}
.au-role-admin { background: #dc2626; }
.au-role-manager { background: #d97706; }
.au-role-teacher { background: #2563eb; }
.au-role-parent { background: #0891b2; }
.au-role-marketing { background: #059669; }
.au-role-guest { background: #64748b; }

.au-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 1.1rem 1rem;
  border-top: 1px solid var(--lp-border);
  background: #f8fafc;
}
.au-role-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.au-role-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  line-height: 1.2;
}
.au-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 575.98px) {
  .au-hero { border-radius: var(--lp-radius); }
  .au-card-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .au-ops .btn { flex: 1; }
}

/* Parent avatar upload */
.pp-avatar-block {
  position: relative;
  flex-shrink: 0;
}
.pp-profile-avatar-img {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--lp-shadow-md);
  display: block;
}
.pp-avatar-upload-btn {
  position: absolute;
  right: -0.2rem;
  bottom: -0.15rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: var(--lp-shadow);
  margin: 0;
}
.pp-avatar-upload-btn:hover {
  background: var(--lp-primary-dark);
  color: #fff;
}
.pp-child-avatar-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* =========================================================
   School admin — Classes / Students (sc-*)
   ========================================================= */
.sc-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--lp-shadow-md);
}
.sc-hero-class {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
}
.sc-hero-student {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.sc-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}
.sc-hero h1 { color: #fff; font-weight: 800; }
.sc-hero .btn-outline-light {
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}
.sc-hero .btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem;
}
.sc-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 3px solid var(--lp-success);
  transition: box-shadow 0.15s;
}
.sc-card:hover { box-shadow: var(--lp-shadow-md); }
.sc-card.is-inactive {
  border-top-color: #94a3b8;
  opacity: 0.92;
}
.sc-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
}
.sc-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-success-soft);
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.sc-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--lp-text);
  text-decoration: none;
  display: block;
  line-height: 1.25;
}
.sc-card-title:hover { color: var(--lp-primary); }
.sc-card-sub {
  font-size: 0.8rem;
  color: var(--lp-muted);
  margin-top: 0.15rem;
}
.sc-card-body {
  padding: 0.5rem 1rem 0.75rem;
  flex: 1;
}
.sc-metric {
  display: inline-flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  padding: 0.4rem 0.75rem;
  min-width: 4.5rem;
}
.sc-metric-num {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--lp-text);
}
.sc-metric-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  font-weight: 600;
}
.sc-notes {
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 1rem 1rem;
  border-top: 1px solid var(--lp-border);
  background: #f8fafc;
}

.sc-student-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.sc-row-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: var(--lp-shadow);
}
.sc-row-avatar-fallback {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc-avatar-teacher {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}
.sc-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lp-muted);
  font-weight: 700;
}
.sc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.sc-dl dt {
  color: var(--lp-muted);
  font-weight: 600;
  padding-top: 0.35rem;
}
.sc-dl dd {
  margin-bottom: 0.35rem;
  padding-top: 0.3rem;
  border-bottom: 1px solid var(--lp-border);
  padding-bottom: 0.35rem;
}
.sc-dl dd:last-of-type { border-bottom: none; }

@media (max-width: 575.98px) {
  .sc-hero { border-radius: var(--lp-radius); padding: 1rem; }
}

/* Parent card on Student Details */
.ph-card .lp-card-header { margin-bottom: 0.75rem; }
.ph-empty {
  text-align: center;
  padding: 1.25rem 0.75rem;
  color: var(--lp-muted);
  font-size: 0.875rem;
}
.ph-empty i {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.35rem;
  opacity: 0.45;
  color: var(--lp-primary);
}
.ph-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.ph-item {
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  background: #f8fafc;
  overflow: hidden;
  border-left: 3px solid var(--lp-border-strong);
}
.ph-item.is-primary {
  border-left-color: var(--lp-success);
  background: linear-gradient(90deg, #ecfdf5 0%, #f8fafc 50%);
}
.ph-item-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 0.4rem;
}
.ph-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #be185d);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ph-name {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.ph-rel {
  font-size: 0.75rem;
  color: var(--lp-muted);
}
.ph-item-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}
.ph-item-body {
  padding: 0 0.75rem 0.65rem 3.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ph-contact {
  font-size: 0.8rem;
  color: var(--lp-text-secondary);
}
.ph-contact a { color: inherit; text-decoration: none; }
.ph-contact a:hover { color: var(--lp-primary); text-decoration: underline; }
.ph-contact i { margin-right: 0.25rem; opacity: 0.7; }
.ph-add-form {
  border-top: 1px dashed var(--lp-border-strong);
  padding-top: 0.85rem;
  margin-top: 0.25rem;
}

/* Workspace class media album */
.ws-media-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem !important;
}
.ws-media-panel-head { margin-bottom: 0.85rem; }
.ws-media-upload {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .ws-media-upload {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}
.ws-media-drop {
  border: 2px dashed var(--lp-border-strong);
  border-radius: var(--lp-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ws-media-drop i { font-size: 1.75rem; color: var(--lp-primary); opacity: 0.7; }
.ws-media-drop:hover,
.ws-media-drop.is-drag {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
}
.ws-media-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 9rem;
  overflow-y: auto;
}
.ws-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  margin: 0;
}
.ws-tag-chip:has(.ws-tag-cb:checked) {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
}
.ws-tag-cb { margin: 0; }
.ws-tag-av {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ws-tag-name {
  max-width: 7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
}
.ws-media-item {
  margin: 0;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  overflow: hidden;
  background: #fff;
}
.ws-media-thumb {
  display: block;
  aspect-ratio: 1;
  background: #0f172a;
}
.ws-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ws-media-item figcaption {
  padding: 0.4rem 0.5rem 0.5rem;
}
.ws-media-tag-summary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}
.ws-media-item-actions {
  display: flex;
  gap: 0.25rem;
}
.ws-media-empty {
  grid-column: 1 / -1;
  padding: 0.75rem;
  text-align: center;
}

/* Workspace daily media (upload + tag) */
.ws-media-panel { margin-bottom: 1rem; }
.ws-media-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.ws-media-upload {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (min-width: 992px) {
  .ws-media-upload {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}
.ws-media-drop {
  border: 2px dashed var(--lp-border-strong);
  border-radius: var(--lp-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ws-media-drop i { font-size: 1.75rem; color: var(--lp-primary); opacity: 0.8; }
.ws-media-drop:hover, .ws-media-drop.is-drag {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
}
.ws-media-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  grid-column: 1 / -1;
}
.ws-media-preview-item {
  width: 64px;
  height: 64px;
  border-radius: var(--lp-radius-sm);
  overflow: hidden;
  border: 1px solid var(--lp-border);
}
.ws-media-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.ws-media-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.15rem;
}
.ws-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  margin: 0;
  user-select: none;
}
.ws-tag-chip:has(input:checked) {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
}
.ws-tag-chip input { margin: 0; }
.ws-tag-av {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ws-tag-name { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  border-top: 1px dashed var(--lp-border);
  padding-top: 0.85rem;
}
.ws-media-item {
  margin: 0;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--lp-shadow);
}
.ws-media-thumb {
  display: block;
  aspect-ratio: 1;
  background: #0f172a;
}
.ws-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ws-media-item figcaption {
  padding: 0.45rem 0.5rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ws-media-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-height: 1.4rem;
}
.ws-media-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.ws-media-empty { padding: 0.75rem 0; }
.pp-media-strip { padding: 0 0.25rem 0.5rem; }

/* Workspace realtime attendance-first */
.ws-att-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.5rem;
}
.ws-att-btn {
  flex: 1 1 auto;
  min-width: 4.5rem;
  border: 1px solid var(--lp-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lp-text-secondary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ws-att-btn:hover { border-color: var(--lp-primary); color: var(--lp-primary); }
.ws-att-btn.active[data-att="Present"] {
  background: #ecfdf5; border-color: #10b981; color: #047857;
}
.ws-att-btn.active[data-att="Late"] {
  background: #fffbeb; border-color: #f59e0b; color: #b45309;
}
.ws-att-btn.active[data-att="Absent"] {
  background: #fef2f2; border-color: #ef4444; color: #b91c1c;
}
.ws-att-btn.active[data-att="Excused"] {
  background: #f1f5f9; border-color: #64748b; color: #334155;
}
.ws-card.is-present { border-left: 3px solid #10b981; }
.ws-card.is-not-present { border-left: 3px solid #cbd5e1; }
.ws-notes-block {
  position: relative;
  transition: opacity 0.15s;
}
.ws-notes-block.is-locked {
  opacity: 0.55;
}
.ws-notes-block.is-locked .ws-field { pointer-events: none; }
.ws-notes-lock-msg {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--lp-muted);
  padding: 0.25rem 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ws-save-hint {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.35rem;
}
.ws-save-hint.is-ok { color: #059669; }
.ws-save-hint.is-err { color: #dc2626; }
.ws-tag-chip.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.ws-quickbar kbd {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  border: 1px solid var(--lp-border);
  background: #f8fafc;
}

/* Parent diary realtime */
.pp-rt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}
.pp-rt-badge.is-on {
  background: #ecfdf5;
  color: #047857;
}
.pp-rt-badge.is-off {
  background: #fef2f2;
  color: #b91c1c;
}
.pp-rt-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.pp-day-flash {
  animation: ppFlash 0.8s ease;
}
@keyframes ppFlash {
  0% { background: #ecfdf5; }
  100% { background: transparent; }
}
.pp-day.att-present .pp-att-badge { background: #ecfdf5; color: #047857; }
.pp-day.att-absent .pp-att-badge { background: #fef2f2; color: #b91c1c; }
.pp-day.att-late .pp-att-badge { background: #fffbeb; color: #b45309; }
.pp-day.att-excused .pp-att-badge { background: #f1f5f9; color: #475569; }
.pp-att-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Media panel collapse (ưu tiên điểm danh) */
.ws-media-panel.is-collapsed {
  padding-bottom: 0.65rem;
}
.ws-media-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0 !important;
}
.ws-media-panel:not(.is-collapsed) .ws-media-panel-head {
  margin-bottom: 0.5rem !important;
}
.ws-media-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.15rem 0;
  cursor: pointer;
  min-width: 0;
}
.ws-media-toggle-ico {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-primary-soft, #e0e7ff);
  color: var(--lp-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ws-media-toggle-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.ws-media-toggle-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--lp-text);
}
.ws-media-toggle-hint {
  font-size: 0.72rem;
  color: var(--lp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-media-chevron {
  color: var(--lp-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ws-media-panel:not(.is-collapsed) .ws-media-chevron {
  transform: rotate(180deg);
}
.ws-media-head-actions {
  flex-shrink: 0;
}
.ws-media-panel:not(.is-collapsed) .ws-media-head-actions {
  display: none;
}
.ws-media-body {
  border-top: 1px dashed var(--lp-border);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
}

/* Notes accordion — 1 HS tại một thời điểm */
.ws-notes-wrap {
  padding: 0 0.75rem 0.65rem;
}
.ws-notes-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px dashed var(--lp-border-strong, #cbd5e1);
  background: #f8fafc;
  border-radius: var(--lp-radius-sm, 0.5rem);
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lp-text-secondary, #475569);
  cursor: pointer;
  text-align: left;
}
.ws-notes-toggle:hover:not(:disabled) {
  border-color: var(--lp-primary);
  color: var(--lp-primary);
  background: var(--lp-primary-soft, #eef2ff);
}
.ws-notes-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ws-notes-toggle-label { flex-shrink: 0; }
.ws-notes-preview {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--lp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
}
.ws-notes-chevron {
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--lp-muted);
}
.ws-notes-wrap.is-open .ws-notes-chevron {
  transform: rotate(180deg);
}
.ws-notes-wrap.is-open .ws-notes-toggle {
  border-style: solid;
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft, #eef2ff);
  color: var(--lp-primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.ws-card.is-notes-open {
  box-shadow: var(--lp-shadow-md, 0 4px 14px rgba(15, 23, 42, 0.1));
  border-color: #c7d2fe;
}
.ws-notes-block {
  border: 1px solid var(--lp-primary);
  border-top: none;
  border-radius: 0 0 var(--lp-radius-sm, 0.5rem) var(--lp-radius-sm, 0.5rem);
  padding: 0.65rem 0.75rem 0.5rem;
  background: #fff;
  margin: 0;
}
.ws-notes-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}
.ws-notes-wrap.is-locked .ws-notes-toggle {
  background: #f1f5f9;
}

/* Absence request (PH + GV) */
.pp-absence-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.pp-absence-body {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--lp-border);
}
.pp-absence.is-open .pp-absence-chevron { transform: rotate(180deg); }
.pp-absence-chevron { transition: transform 0.2s; color: var(--lp-muted); }
.ws-absence-panel {
  border-left: 3px solid #f59e0b;
}

/* Pick Parent user modal */
.ph-pick-av {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#pickParentList .ph-pick-item { cursor: pointer; }
#pickParentList .ph-pick-item:hover { background: var(--lp-primary-soft, #eef2ff); }

/* Structured teacher comments */
.ws-comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.ws-comment-toolbar .ws-preset-btn {
  font-size: 0.72rem;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-comment-list { display: flex; flex-direction: column; gap: 0.65rem; }
.ws-comment-item {
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm, 0.5rem);
  padding: 0.5rem;
  background: #f8fafc;
}
.ws-comment-item-head {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.ws-comment-item-head .ws-comment-label { font-weight: 700; text-transform: uppercase; font-size: 0.78rem; }
.ws-comment-body { font-size: 0.85rem; line-height: 1.45; }
.ws-notes-footer { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.65rem; }

.pp-comment {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--lp-border);
}
.pp-comment:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.pp-comment-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--lp-primary, #4f46e5);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.pp-comment-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--lp-text);
  font-style: italic;
}

/* Dashboard */
.db-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--lp-radius, 0.75rem);
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 55%, #60a5fa 100%);
  color: #fff;
  margin-bottom: 1.25rem;
  box-shadow: var(--lp-shadow-md, 0 4px 14px rgba(15,23,42,.12));
}
.db-eyebrow { font-size: 0.8rem; font-weight: 600; opacity: 0.9; }
.db-date-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.db-date-form .form-control { width: auto; min-width: 9.5rem; }
.db-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.db-stat {
  background: #fff;
  border: 1px solid var(--lp-border, #e2e8f0);
  border-radius: var(--lp-radius-sm, 0.5rem);
  padding: 0.75rem 0.85rem;
  text-align: center;
  box-shadow: var(--lp-shadow, 0 1px 3px rgba(15,23,42,.06));
}
.db-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--lp-text, #0f172a);
}
.db-stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lp-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.db-stat-ok .db-stat-num { color: #059669; }
.db-stat-warn .db-stat-num { color: #d97706; }
.db-stat-danger .db-stat-num { color: #dc2626; }
.db-stat-info .db-stat-num { color: #2563eb; }
.db-table th { font-size: 0.75rem; text-transform: uppercase; color: var(--lp-muted); font-weight: 700; }
.db-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.25rem 0;
}
.db-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.8rem;
  border: 1px solid var(--lp-border);
}

.chat-load-more-wrap {
  text-align: center;
  padding: 0.5rem 0 0.75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(to bottom, var(--lp-card-bg, #fff) 60%, transparent);
}
.chat-load-more { font-size: 0.8rem; }
