:root,
html[data-theme="midnight-navy"] {
  --app-bg: #eef2f7;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-border: #e2e8f0;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-primary: #0f2744;
  --app-primary-hover: #16355c;
  --app-accent: #1d4ed8;
  --app-success: #15803d;
  --app-warning: #b45309;
  --app-danger: #b91c1c;
  --app-radius: 14px;
  --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --sidebar-width: 250px;
  --landing-ink: #f8fafc;
  --landing-muted: rgba(248, 250, 252, .78);
  --landing-glow: rgba(59, 130, 246, .28);
  --font-sans: "Outfit", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

html[data-theme="coastal-teal"] {
  --app-bg: #e7f5f5;
  --app-surface: #ffffff;
  --app-surface-soft: #f2fbfb;
  --app-border: #cde4e6;
  --app-text: #0b2e36;
  --app-muted: #4f6f76;
  --app-primary: #0f4c5c;
  --app-primary-hover: #136377;
  --app-accent: #14919b;
  --landing-glow: rgba(20, 145, 155, .32);
}

html[data-theme="forest-pine"] {
  --app-bg: #eef5f0;
  --app-surface: #ffffff;
  --app-surface-soft: #f5faf6;
  --app-border: #d5e4da;
  --app-text: #14261c;
  --app-muted: #5b7163;
  --app-primary: #1b4332;
  --app-primary-hover: #245c44;
  --app-accent: #2d6a4f;
  --landing-glow: rgba(45, 106, 79, .30);
}

html[data-theme="graphite-slate"] {
  --app-bg: #f3f4f6;
  --app-surface: #ffffff;
  --app-surface-soft: #f9fafb;
  --app-border: #e5e7eb;
  --app-text: #111827;
  --app-muted: #6b7280;
  --app-primary: #1f2937;
  --app-primary-hover: #374151;
  --app-accent: #4b5563;
  --landing-glow: rgba(75, 85, 99, .28);
}

html[data-theme="amber-campus"] {
  --app-bg: #f7f4ef;
  --app-surface: #ffffff;
  --app-surface-soft: #fbf8f3;
  --app-border: #e8dfd2;
  --app-text: #2a2114;
  --app-muted: #7a6a52;
  --app-primary: #3f2e14;
  --app-primary-hover: #5a4220;
  --app-accent: #b45309;
  --landing-glow: rgba(180, 83, 9, .28);
}

html[data-theme="crimson-archive"] {
  --app-bg: #f8f1f3;
  --app-surface: #ffffff;
  --app-surface-soft: #fcf6f8;
  --app-border: #edd8df;
  --app-text: #3b0a18;
  --app-muted: #7f4a5a;
  --app-primary: #4c0519;
  --app-primary-hover: #6b0f2a;
  --app-accent: #be123c;
  --landing-glow: rgba(190, 18, 60, .28);
}

html[data-theme="indigo-lab"] {
  --app-bg: #eef0f8;
  --app-surface: #ffffff;
  --app-surface-soft: #f6f7fc;
  --app-border: #d9ddee;
  --app-text: #17153a;
  --app-muted: #64608a;
  --app-primary: #1e1b4b;
  --app-primary-hover: #2e2a6b;
  --app-accent: #4338ca;
  --landing-glow: rgba(67, 56, 202, .28);
}

html[data-theme="olive-academic"] {
  --app-bg: #f4f3ec;
  --app-surface: #ffffff;
  --app-surface-soft: #faf9f3;
  --app-border: #e2e0d2;
  --app-text: #2a2818;
  --app-muted: #6f6b55;
  --app-primary: #3f3a1d;
  --app-primary-hover: #565028;
  --app-accent: #6b705c;
  --landing-glow: rgba(107, 112, 92, .28);
}

html[data-theme="sky-research"] {
  --app-bg: #f0f9ff;
  --app-surface: #ffffff;
  --app-surface-soft: #f7fcff;
  --app-border: #d0e8f7;
  --app-text: #0c2d44;
  --app-muted: #567891;
  --app-primary: #0c4a6e;
  --app-primary-hover: #0e5f8d;
  --app-accent: #0284c7;
  --landing-glow: rgba(2, 132, 199, .30);
}

/* Picture themes: --app-bg-image is shown behind a tinted --app-bg-overlay. */
html[data-theme="photo-campus-sunrise"] {
  --app-bg: #f6efe6;
  --app-surface-soft: #fbf7f1;
  --app-border: #e9dccb;
  --app-text: #2b1f10;
  --app-muted: #7a6650;
  --app-primary: #4a3217;
  --app-primary-hover: #624320;
  --app-accent: #c2711c;
  --landing-glow: rgba(194, 113, 28, .30);
  --app-bg-image: url("themes/campus-sunrise.jpg");
  --app-bg-overlay: rgba(250, 245, 238, .70);
}
html[data-theme="photo-library-classic"] {
  --app-bg: #f3ede4;
  --app-surface-soft: #faf6f0;
  --app-border: #e4d8c6;
  --app-text: #2a1c10;
  --app-muted: #76634e;
  --app-primary: #3b2616;
  --app-primary-hover: #52361f;
  --app-accent: #9a6a2f;
  --landing-glow: rgba(154, 106, 47, .30);
  --app-bg-image: url("themes/library-classic.jpg");
  --app-bg-overlay: rgba(246, 240, 231, .74);
}
html[data-theme="photo-mountain-mist"] {
  --app-bg: #eef2f7;
  --app-surface-soft: #f6f8fb;
  --app-border: #d8e0ea;
  --app-text: #15243a;
  --app-muted: #5d6f86;
  --app-primary: #334a66;
  --app-primary-hover: #405c7e;
  --app-accent: #5b7fa6;
  --landing-glow: rgba(91, 127, 166, .30);
  --app-bg-image: url("themes/mountain-mist.jpg");
  --app-bg-overlay: rgba(240, 244, 249, .50);
}
html[data-theme="photo-ocean-dusk"] {
  --app-bg: #eef7f6;
  --app-surface-soft: #f5fbfa;
  --app-border: #d2e6e4;
  --app-text: #0c2b31;
  --app-muted: #537177;
  --app-primary: #0e5363;
  --app-primary-hover: #13697d;
  --app-accent: #d9694c;
  --landing-glow: rgba(224, 122, 95, .30);
  --app-bg-image: url("themes/ocean-dusk.jpg");
  --app-bg-overlay: rgba(241, 248, 247, .60);
}
html[data-theme="photo-tech-circuit"] {
  --app-bg: #eaf0fb;
  --app-surface-soft: #f4f7fd;
  --app-border: #d4ddf0;
  --app-text: #0b1733;
  --app-muted: #56668a;
  --app-primary: #0a1f4d;
  --app-primary-hover: #102b69;
  --app-accent: #2563eb;
  --landing-glow: rgba(37, 99, 235, .34);
  --app-bg-image: url("themes/tech-circuit.jpg");
  --app-bg-overlay: rgba(234, 240, 251, .76);
}
html[data-theme="photo-rice-terraces"] {
  --app-bg: #eef5ec;
  --app-surface-soft: #f5faf4;
  --app-border: #d5e5d1;
  --app-text: #13261a;
  --app-muted: #5a705f;
  --app-primary: #1f4d2b;
  --app-primary-hover: #28633a;
  --app-accent: #4d8b31;
  --landing-glow: rgba(77, 139, 49, .30);
  --app-bg-image: url("themes/rice-terraces.jpg");
  --app-bg-overlay: rgba(240, 246, 238, .70);
}
html[data-theme="photo-city-twilight"] {
  --app-bg: #f2eefa;
  --app-surface-soft: #f8f5fd;
  --app-border: #e0d7f0;
  --app-text: #1f1236;
  --app-muted: #6b5d86;
  --app-primary: #3b1f63;
  --app-primary-hover: #4c2a7e;
  --app-accent: #7c4ddf;
  --landing-glow: rgba(139, 92, 246, .32);
  --app-bg-image: url("themes/city-twilight.jpg");
  --app-bg-overlay: rgba(244, 240, 251, .72);
}
html[data-theme="photo-cherry-blossom"] {
  --app-bg: #fbf1f5;
  --app-surface-soft: #fdf7fa;
  --app-border: #f0d9e3;
  --app-text: #3a1424;
  --app-muted: #85596b;
  --app-primary: #7a2848;
  --app-primary-hover: #95335a;
  --app-accent: #c94377;
  --landing-glow: rgba(219, 90, 138, .30);
  --app-bg-image: url("themes/cherry-blossom.jpg");
  --app-bg-overlay: rgba(252, 244, 247, .48);
}
html[data-theme="photo-autumn-forest"] {
  --app-bg: #faf1e7;
  --app-surface-soft: #fcf7f1;
  --app-border: #eedcc7;
  --app-text: #2e1706;
  --app-muted: #806148;
  --app-primary: #5a2a0c;
  --app-primary-hover: #733710;
  --app-accent: #c2620f;
  --landing-glow: rgba(217, 115, 26, .30);
  --app-bg-image: url("themes/autumn-forest.jpg");
  --app-bg-overlay: rgba(250, 243, 234, .72);
}
html[data-theme="photo-galaxy-night"] {
  --app-bg: #efeefa;
  --app-surface-soft: #f6f5fd;
  --app-border: #dcd9f0;
  --app-text: #17133a;
  --app-muted: #625e88;
  --app-primary: #1c1745;
  --app-primary-hover: #2a2366;
  --app-accent: #6454e0;
  --landing-glow: rgba(124, 108, 240, .34);
  --app-bg-image: url("themes/galaxy-night.jpg");
  --app-bg-overlay: rgba(240, 239, 251, .74);
}
html[data-theme-photo] body {
  background:
    linear-gradient(var(--app-bg-overlay), var(--app-bg-overlay)),
    var(--app-bg-image) center / cover no-repeat fixed;
  background-color: var(--app-bg);
}
html[data-theme-photo] .page-header h1,
html[data-theme-photo] .page-header .page-subtitle {
  text-shadow: 0 0 10px rgba(255, 255, 255, .85), 0 1px 1px rgba(255, 255, 255, .7);
}
html[data-theme-photo] .sidebar {
  background: color-mix(in srgb, var(--app-surface) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
html[data-theme-photo] .landing-shell {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 90%, transparent) 0%, color-mix(in srgb, var(--app-primary) 58%, transparent) 100%),
    var(--app-bg-image) center / cover no-repeat;
}
@media (max-width: 900px) {
  /* iOS/Android ignore or mis-render fixed backgrounds. */
  html[data-theme-photo] body { background-attachment: scroll; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .landing-brand, .page-header h1 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}

a { color: var(--app-accent); }
a:hover { color: var(--app-primary-hover); }

.app-navbar {
  background: var(--app-primary) !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-height: 60px;
  padding-top: .45rem;
  padding-bottom: .45rem;
}
.app-navbar .navbar-brand {
  font-size: 1rem;
  letter-spacing: .01em;
}
.app-navbar .user-chip {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: rgba(255,255,255,.92);
  font-size: .86rem;
}
.app-navbar .user-chip-meta {
  text-align: right;
  line-height: 1.25;
}
.app-navbar .user-chip-meta strong {
  display: block;
  font-weight: 600;
}
.app-navbar .user-chip-photo {
  display: inline-flex;
  text-decoration: none;
}
.app-navbar .user-chip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: .72rem;
  color: #0f172a;
  background: #e2e8f0;
}
.app-navbar .lang-switch-select {
  width: auto;
  min-width: 6.5rem;
  max-width: 8.5rem;
  padding-top: .2rem;
  padding-bottom: .2rem;
  font-size: .78rem;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
.app-navbar .lang-switch-select option {
  color: #0f172a;
  background: #fff;
}
.users-avatar-photo {
  object-fit: cover;
  padding: 0;
}
.users-avatar.avatar-title,
.users-avatar.avatar-title-sm {
  border-radius: 12px;
  object-fit: cover;
}
.users-avatar.avatar-title {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}
.users-avatar.avatar-title-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: .72rem;
}
.student-photo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .45rem;
}
.student-photo-strip.with-names {
  gap: .75rem 1rem;
  margin-top: .75rem;
}
.student-photo-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.student-photo-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.student-photo-meta strong {
  font-size: .92rem;
}
button.photo-zoom-trigger {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  line-height: 0;
  cursor: zoom-in;
  border-radius: 12px;
}
button.photo-zoom-trigger .users-avatar {
  cursor: zoom-in;
}
.photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.photo-zoom[hidden] {
  display: none;
}
.photo-zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .82);
}
.photo-zoom-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, calc(100vw - 1.5rem));
  height: min(92vh, 900px);
  margin: auto;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.photo-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  background: #111827;
  flex-wrap: wrap;
}
.photo-zoom-title {
  min-width: 0;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-zoom-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.photo-zoom-actions button,
.photo-zoom-level {
  border: 1px solid #334155;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  min-height: 34px;
  padding: .25rem .7rem;
  font-size: .85rem;
}
.photo-zoom-actions button {
  cursor: pointer;
}
.photo-zoom-actions button:hover {
  background: #334155;
}
.photo-zoom-level {
  display: inline-flex;
  align-items: center;
  min-width: 4.2rem;
  justify-content: center;
}
.photo-zoom-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.photo-zoom-stage.is-dragging {
  cursor: grabbing;
}
.photo-zoom-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.profile-photo-preview .avatar-lg,
.users-avatar.avatar-lg {
  width: 112px;
  height: 112px;
  border-radius: 16px;
  font-size: 1.6rem;
}
.unread-message-item + .unread-message-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.unread-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-log-body {
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.recent-message-list {
  max-height: 280px;
  overflow-y: auto;
}
.recipient-search {
  position: relative;
}
.recipient-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + .25rem);
  max-height: 240px;
  overflow-y: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.recipient-result {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .55rem .75rem;
  border: 0;
  background: transparent;
  text-align: left;
}
.recipient-result:hover,
.recipient-result.is-active {
  background: var(--app-surface-soft);
}
.recipient-result small {
  color: var(--app-muted, #64748b);
  white-space: nowrap;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  padding: 1rem .75rem 1.5rem;
}
.sidebar-brand {
  padding: .55rem .75rem 1rem;
  margin-bottom: .35rem;
  border-bottom: 1px solid var(--app-border);
}
.sidebar-brand .eyebrow {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--app-muted);
  font-weight: 700;
}
.sidebar-brand .title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--app-text);
  margin-top: .15rem;
}
.sidebar-section {
  margin: .9rem .75rem .35rem;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.sidebar-section ~ .sidebar-section {
  margin-top: 1.15rem;
  padding-top: .75rem;
  border-top: 1px solid var(--app-border);
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .68rem .8rem;
  margin-bottom: .18rem;
  color: #334155;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}
.sidebar a .nav-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 7px;
  background: #eef2f7;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.sidebar a:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar a.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.sidebar a.active .nav-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.nav-group {
  margin-bottom: .18rem;
}
.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .68rem .8rem;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-group-toggle .nav-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 7px;
  background: #eef2f7;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.nav-group-toggle .nav-group-label {
  flex: 1 1 auto;
}
.nav-group-toggle .nav-caret {
  width: .55rem;
  height: .55rem;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: 0 0 auto;
  margin-right: .15rem;
}
.nav-group.is-open .nav-caret {
  transform: rotate(45deg);
  margin-top: -.15rem;
}
.nav-group-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.nav-group-toggle.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.nav-group-toggle.is-active .nav-icon {
  background: #dbeafe;
  color: #1d4ed8;
}
.nav-sub {
  padding: .15rem 0 .25rem .55rem;
  margin: 0 0 .2rem .55rem;
  border-left: 2px solid #e2e8f0;
}
.nav-sub a {
  padding: .55rem .7rem;
  font-size: .92em;
  font-weight: 600;
}
.nav-sub a .nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  font-size: .65rem;
}

.content-area {
  flex: 1;
  padding: 1.5rem 1.65rem 2.25rem;
  min-width: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-header h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 .2rem;
  color: var(--app-text);
}
.page-header .page-subtitle {
  color: var(--app-muted);
  margin: 0;
  max-width: 44rem;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: .95rem 1.15rem;
}
.card-body { padding: 1.15rem; }
.panel-card { overflow: hidden; }
.panel-card > .card-body.border-bottom,
.panel-toolbar {
  background: var(--app-surface-soft);
}

.stat-card,
.users-stat-card {
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  border-radius: var(--app-radius);
  overflow: hidden;
}
.stat-card .card-body,
.users-stat-card .card-body {
  padding: 1rem 1.1rem;
}
.stat-label,
.users-stat-card .small {
  color: var(--app-muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.stat-value,
.users-stat-value,
.stat-card .display-6 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: .2rem;
  color: var(--app-text);
}

.form-label {
  font-size: .86rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: .35rem;
}
.form-control,
.form-select {
  border-color: #cbd5e1;
  border-radius: 10px;
  padding: .55rem .75rem;
}
.form-control:focus,
.form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .15);
}
.form-text, .small-muted {
  font-size: .84rem;
  color: var(--app-muted);
}
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .15rem;
}

.create-group-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .75rem 0.5rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 55%, #fffbeb 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.create-group-flow-step {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  flex: 1 1 160px;
  min-width: 0;
  opacity: .72;
}
.create-group-flow-step.is-current {
  opacity: 1;
}
.create-group-flow-num {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  background: #0f172a;
  color: #fff;
}
.create-group-flow-step:not(.is-current) .create-group-flow-num {
  background: #94a3b8;
}
.create-group-flow-title {
  font-weight: 700;
  font-size: .92rem;
  color: #0f172a;
  line-height: 1.25;
}
.create-group-flow-desc {
  font-size: .8rem;
  color: #64748b;
  margin-top: .15rem;
  line-height: 1.35;
}
.create-group-flow-arrow {
  display: none;
  align-self: center;
  color: #94a3b8;
  font-weight: 700;
  padding: 0 .15rem;
}
@media (min-width: 900px) {
  .create-group-flow-arrow {
    display: block;
  }
}
.create-title-callout {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: .86rem;
  color: #9a3412;
  line-height: 1.4;
}
.create-title-ack {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .85rem 1rem;
}
.create-title-ack .form-check-input {
  margin-top: .35rem;
}
.create-title-ack .form-check-label {
  font-size: .9rem;
  color: #334155;
  line-height: 1.45;
}
.create-confirm-checks {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .85rem 1rem;
}
.file-title-cta {
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.28);
}
.file-title-cta:hover {
  filter: brightness(0.97);
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}
.btn-dark,
.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}
.btn-dark:hover,
.btn-primary:hover {
  background: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
}
.btn-outline-dark {
  border-color: #cbd5e1;
  color: #0f172a;
}
.btn-outline-dark:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.badge {
  font-weight: 600;
  letter-spacing: .01em;
}
.badge.rounded-pill { padding: .4em .7em; }

.table thead th {
  white-space: nowrap;
  vertical-align: middle;
  background: #f8fafc;
  color: #475569;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  border-bottom-color: var(--app-border);
}
.table > :not(caption) > * > * {
  padding: .85rem .9rem;
}
.table-hover > tbody > tr:hover > * {
  background-color: #f8fafc;
}

.alert {
  border-radius: 12px;
  border: 1px solid transparent;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.timeline { border-left: 3px solid #e2e8f0; padding-left: 1rem; }
.timeline-item { position: relative; margin-bottom: 1rem; }
.timeline-item:before {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
  left: -1.45rem;
  top: .35rem;
}

/* Auth pages */
.auth-shell {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-hero {
  background:
    linear-gradient(160deg, rgba(15,39,68,.92), rgba(15,39,68,.78)),
    radial-gradient(circle at top left, rgba(59,130,246,.35), transparent 45%),
    #0f2744;
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-hero .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.auth-hero h1 {
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .85rem;
}
.auth-hero p {
  color: rgba(255,255,255,.78);
  max-width: 34rem;
  margin-bottom: 0;
}
.auth-hero .auth-points {
  margin-top: 2rem;
  display: grid;
  gap: .7rem;
}
.auth-hero .auth-points div {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  color: rgba(255,255,255,.88);
  font-size: .95rem;
}
.auth-hero .auth-points span {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  flex: 0 0 auto;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--app-bg);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: var(--app-shadow);
  padding: 1.75rem;
}
.auth-card.auth-card-wide { max-width: 720px; }
.auth-card h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.auth-card .lead-muted {
  color: var(--app-muted);
  margin-bottom: 1.25rem;
}

/* Request / list items */
.request-item,
.info-tile {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
  padding: 1rem;
  margin-bottom: .75rem;
}
.request-item:last-child { margin-bottom: 0; }

/* Project detail */
.project-hero {
  background: linear-gradient(135deg, #0f2744, #1e3a5f);
  color: #fff;
  border-radius: var(--app-radius);
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--app-shadow);
}
.project-hero .meta {
  color: rgba(255,255,255,.72);
  font-size: .9rem;
}
.project-hero h1 {
  color: #fff;
  font-size: 1.55rem;
  margin: .2rem 0 .35rem;
}
.stage-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
  box-shadow: var(--app-shadow);
  margin-bottom: 1.25rem;
  background: #fff;
}
.stage-card .card-header {
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manuscript-item {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .75rem;
  background: #f8fafc;
}

/* Users page helpers (kept/extended) */
.users-page .users-create-card,
.users-page .users-table-card { overflow: hidden; }
.users-page .users-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .15rem;
}
.users-role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.projects-filing-tabs {
  gap: .25rem;
  border-bottom: 0;
}
.projects-filing-tabs .nav-link {
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--app-muted, #64748b);
  font-weight: 600;
  border-radius: .65rem .65rem 0 0;
  padding: .65rem 1rem;
  background: transparent;
}
.projects-filing-tabs .nav-link:hover {
  color: var(--app-ink, #0f172a);
  background: var(--app-surface-soft, #f8fafc);
}
.projects-filing-tabs .nav-link.active {
  color: var(--app-ink, #0f172a);
  background: var(--app-surface, #fff);
  border-color: var(--app-border, #e2e8f0);
  border-bottom-color: var(--app-surface, #fff);
  box-shadow: 0 -1px 0 var(--app-surface, #fff);
}
.projects-filing-panel {
  border-top-left-radius: 0 !important;
}
.guide-panel .guide-body {
  max-width: 860px;
}
.guide-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
}
.guide-block:last-of-type {
  border-bottom: 0;
  margin-bottom: 1rem;
  padding-bottom: 0;
}
.guide-block h3 {
  margin-bottom: .65rem;
}
.guide-block ol,
.guide-block ul {
  padding-left: 1.15rem;
}
.guide-block li + li {
  margin-top: .35rem;
}
.guide-note {
  background: var(--app-surface-soft, #f8fafc);
  border-left: 3px solid var(--app-accent, #2563eb);
  padding: .65rem .85rem;
  font-size: .9rem;
  color: var(--app-muted, #64748b);
  border-radius: 0 .4rem .4rem 0;
}
.guide-dos h3 {
  margin-top: 1rem;
}
.guide-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
.student-ui-preview-banner {
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #f59e0b;
  position: sticky;
  top: 56px;
  z-index: 1020;
}
.sidebar-preview-badge {
  display: inline-block;
  margin-top: .45rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #fef3c7;
  color: #92400e;
}
.student-view-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.student-view-sidebar {
  background: var(--app-sidebar, #0f172a);
  color: #e2e8f0;
  border-radius: .75rem;
  padding: .75rem 0 1rem;
  position: sticky;
  top: 5.5rem;
}
.student-view-sidebar-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  padding: 0 .9rem .5rem;
  font-weight: 700;
}
.student-view-sidebar .sidebar-section {
  color: #94a3b8;
}
.student-view-sidebar a {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #e2e8f0;
  text-decoration: none;
  padding: .45rem .9rem;
  font-size: .92rem;
}
.student-view-sidebar a:hover,
.student-view-sidebar a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.student-view-sidebar .nav-icon {
  width: 1.5rem;
  display: inline-flex;
  justify-content: center;
  opacity: .85;
  font-size: .75rem;
  font-weight: 700;
}
.student-view-callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 3px solid #2563eb;
  border-radius: .4rem;
  padding: .75rem .9rem;
  font-size: .92rem;
}
.student-view-mock {
  border-style: dashed;
}
@media (max-width: 900px) {
  .student-view-layout {
    grid-template-columns: 1fr;
  }
  .student-view-sidebar {
    position: static;
  }
}
.users-account-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 220px;
}
.users-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex: 0 0 auto;
  color: #0f172a;
  background: #e2e8f0;
  overflow: hidden;
}
.users-avatar.avatar-list {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 1rem;
}
.users-role-badge {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  border-radius: .45rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.users-avatar.role-admin,
.users-role-badge.role-admin { background: #e2e8f0; color: #0f172a; }
.users-avatar.role-coordinator,
.users-role-badge.role-coordinator { background: #dbeafe; color: #1e3a8a; }
.users-avatar.role-adviser,
.users-role-badge.role-adviser { background: #dcfce7; color: #14532d; }
.users-avatar.role-panelist,
.users-role-badge.role-panelist { background: #ffedd5; color: #9a3412; }
.users-avatar.role-student,
.users-role-badge.role-student { background: #e0f2fe; color: #075985; }
.users-avatar.role-default,
.users-role-badge.role-default { background: #f1f5f9; color: #334155; }
.users-scope-form { min-width: 180px; max-width: 240px; }
.users-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: .35rem;
  flex-wrap: wrap;
}
.users-row-pending,
.users-datagrid tbody tr.users-row-pending td { background: #fffbeb; }
.users-modal .modal-footer.users-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--app-surface, #fff);
  border-top: 1px solid var(--app-border, #e2e8f0);
  gap: .5rem;
}
.users-modal .modal-body {
  max-height: min(70vh, 640px);
}
.modal-dialog-scrollable .users-modal {
  max-height: calc(100vh - 2rem);
}
.min-w-0 { min-width: 0; }
.filter-bar {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--app-shadow);
}
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--app-muted);
}

/* Datagrid */
.datagrid-wrap,
div.dt-container,
.dataTables_wrapper { width: 100%; }
table.datagrid {
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
table.datagrid thead th {
  background: #f8fafc;
  border-bottom-width: 1px;
}
table.datagrid tbody td { vertical-align: middle; }
.dataTables_wrapper .row {
  margin-left: 0;
  margin-right: 0;
  align-items: center;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: .7rem .95rem;
  font-size: .9rem;
}
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #ced4da;
  border-radius: .5rem;
  padding: .35rem .6rem;
  margin-left: .4rem;
  min-width: 180px;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #ced4da;
  border-radius: .5rem;
  padding: .28rem .45rem;
  margin: 0 .35rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: .25rem .55rem !important;
  margin-left: .2rem !important;
  border-radius: .45rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #111827 !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
  background-color: var(--app-primary);
}
.card > .table-responsive,
.card-body > .table-responsive,
.panel-card > .table-responsive {
  border-radius: inherit;
}

@media (max-width: 992px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 2rem 1.4rem; min-height: auto; }
}

/* Mobile navigation drawer */
.nav-toggle,
.sidebar-close,
.sidebar-mobile-user,
.sidebar-mobile-footer,
.sidebar-backdrop {
  display: none;
}
.sidebar-brand {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    margin-right: .5rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 10px;
    flex: 0 0 auto;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
  }
  .app-navbar .container-fluid {
    flex-wrap: nowrap;
  }
  .app-navbar .navbar-brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: .5rem;
    font-size: .95rem;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1060;
    width: min(86vw, 320px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-right: 1px solid var(--app-border);
    padding: .75rem .75rem calc(5rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .25);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open {
    overflow: hidden;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(15, 23, 42, .45);
  }
  .sidebar-backdrop[hidden] {
    display: none;
  }
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 1.4rem;
    line-height: 1;
    color: #334155;
    flex: 0 0 auto;
  }
  .sidebar-mobile-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .75rem .85rem;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: .25rem;
  }
  .sidebar-mobile-user strong {
    display: block;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-mobile-user span {
    display: block;
    font-size: .75rem;
    color: var(--app-muted);
  }
  .sidebar-mobile-user .user-chip-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: 0 0 auto;
  }
  .sidebar-mobile-footer {
    display: block;
    margin-top: 1.25rem;
    padding: .9rem .5rem 0;
    border-top: 1px solid var(--app-border);
  }
  .sidebar a,
  .nav-group-toggle {
    padding: .75rem .8rem;
  }
  .sidebar .sidebar-section {
    display: block !important;
  }
  .sidebar .nav-group-toggle {
    display: flex !important;
    pointer-events: none;
  }
  .sidebar .nav-group-toggle .nav-caret {
    display: none;
  }
  .sidebar .nav-sub,
  .sidebar .nav-sub[hidden] {
    display: block !important;
  }
  .content-area { padding: 1rem .85rem 1.5rem; }
  .dataTables_wrapper .dataTables_filter input {
    min-width: 120px;
    width: 100%;
    margin-left: 0;
    margin-top: .35rem;
  }
  .users-scope-form { max-width: none; }
  .app-navbar .user-chip-meta { display: none; }
}

@media (max-width: 575.98px) {
  .app-navbar .lang-switch,
  .app-navbar .user-chip .btn {
    display: none !important;
  }
  .app-navbar .user-chip-avatar {
    width: 34px;
    height: 34px;
  }
  .page-header {
    gap: .6rem;
    margin-bottom: 1rem;
  }
  .page-header h1 {
    font-size: 1.3rem;
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    width: 100%;
  }
  .page-actions .btn {
    flex: 1 1 auto;
    white-space: nowrap;
  }
  .card-body {
    padding: .9rem;
  }
  .modal-dialog {
    margin: .5rem;
  }
  .table {
    font-size: .88rem;
  }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    padding: .5rem .6rem;
    text-align: left !important;
  }
  .ap-card > .card-body {
    padding: 1rem;
  }
  .ap-slot-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) auto;
  }
  .cn-item {
    padding: .8rem .9rem;
  }
  .cn-panel {
    padding: 0 .9rem;
  }
}

.unread-message-item + .unread-message-item {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--app-border);
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: .25rem;
}
.message-bubble {
  max-width: 85%;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
}
.message-bubble.mine {
  align-self: flex-end;
  background: #e8eef8;
  border-color: #c9d7ec;
}
.message-bubble.theirs {
  align-self: flex-start;
}
.message-delete-btn {
  font-size: .75rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.message-delete-btn:hover {
  text-decoration: underline;
}

.member-picker {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  overflow: hidden;
}
.member-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-soft);
}
.member-picker-search {
  flex: 1 1 220px;
  min-width: 0;
}
.member-picker-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--app-muted);
  font-size: .88rem;
  white-space: nowrap;
}
.member-picker-list {
  max-height: 280px;
  overflow: auto;
  padding: .35rem;
}
.member-picker-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 0;
  padding: .65rem .7rem;
  border-radius: 10px;
  cursor: pointer;
}
.member-picker-item:hover {
  background: #f1f5f9;
}
.member-picker-item.is-selected {
  background: color-mix(in srgb, var(--app-accent) 10%, #fff);
}
.member-picker-item input {
  margin-top: .2rem;
}
.member-picker-item-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.member-picker-item-text strong {
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.25;
}
.member-picker-empty,
.member-picker-nohit {
  padding: 1rem .85rem;
  font-size: .9rem;
}
.member-picker-sm .member-picker-toolbar {
  padding: .55rem .7rem;
}
.member-picker-sm .member-picker-list {
  max-height: 220px;
}
.member-picker-sm .member-picker-item {
  padding: .5rem .6rem;
}
.member-picker-sm .member-picker-item-text strong {
  font-size: .9rem;
}

.adviser-guide-panel {
  border: 1px solid var(--app-border);
  background: var(--app-surface-soft, #f8fafc);
  border-radius: 12px;
  padding: .85rem 1rem;
}
.adviser-guide-name {
  font-weight: 650;
  margin-bottom: .55rem;
}
.adviser-guide-section + .adviser-guide-section {
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px dashed var(--app-border);
}
.adviser-guide-label {
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .35rem;
}
.adviser-guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.adviser-tag {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: .78rem;
}
.adviser-expertise-groups {
  display: grid;
  gap: 1rem;
}
.adviser-expertise-group {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: .85rem 1rem;
  background: var(--app-surface-soft);
}
.adviser-expertise-group-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: .65rem;
}
.adviser-expertise-trigger {
  font-weight: 600;
  color: var(--app-accent, #0f766e) !important;
}
.adviser-expertise-trigger:hover {
  text-decoration: underline !important;
}
.adviser-guide-sched {
  font-size: .9rem;
  margin-bottom: .2rem;
}
.adviser-guide-contacts {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .9rem;
}
.adviser-guide-contacts li {
  margin-bottom: .2rem;
}
.adviser-contact-label {
  color: #475569;
  font-weight: 600;
}
.adviser-contact-edit {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: .75rem .9rem;
  background: #fff;
}
.adviser-slot-list .adviser-slot-row:last-child {
  margin-bottom: 0 !important;
}

/* Consultation reminders */
.consult-alert {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.35rem;
  border-radius: 14px;
  background: #fef2f2;
  border: 2px solid #fca5a5;
  color: #7f1d1d;
}
.consult-alert-soft {
  background: #fff7ed;
  border-color: #fdba74;
  color: #7c2d12;
}
.consult-alert-icon {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  color: #dc2626;
  animation: consult-pulse 1.8s ease-in-out infinite;
}
.consult-alert-soft .consult-alert-icon {
  color: #ea580c;
}
.consult-alert-icon-lg {
  width: 72px;
  height: 72px;
}
@keyframes consult-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .consult-alert-icon { animation: none; }
}
.consult-alert-body {
  min-width: 0;
  flex: 1 1 auto;
}
.consult-alert-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.consult-alert-text {
  font-size: .9rem;
  margin-top: .2rem;
  opacity: .9;
}
.consult-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}
.consult-modal-head {
  gap: 1rem;
  align-items: center;
  background: #fef2f2;
}
.consult-modal-item {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}
@media (max-width: 575.98px) {
  .consult-alert {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
    padding: 1rem;
  }
  .consult-alert-icon {
    width: 52px;
    height: 52px;
  }
}

/* Student group modal (users.php) */
.sg-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin-bottom: .2rem;
}
.sg-title {
  font-weight: 600;
  font-size: 1rem;
}
.sg-members {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--app-border);
  border-radius: 10px;
}
.sg-members li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--app-border);
}
.sg-members li:last-child {
  border-bottom: 0;
}
.sg-members li.is-self {
  background: #f8fafc;
}

/* Group reports */
.gr-search {
  max-width: 420px;
}
.gr-table th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--app-muted, #64748b);
  background: #f8fafc;
  white-space: nowrap;
}
.gr-title {
  font-weight: 600;
  max-width: 30rem;
}
.gr-meta {
  font-size: .78rem;
  color: var(--app-muted, #64748b);
}
.gr-members {
  font-size: .88rem;
  line-height: 1.45;
}
.gr-leader {
  font-size: .68rem;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 999px;
  padding: 0 .4rem;
}
.gr-group-row td {
  background: #f1f5f9 !important;
  font-weight: 700;
  font-size: .9rem;
}
.gr-count {
  display: inline-block;
  min-width: 2.2rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.gr-count.is-zero {
  background: #fee2e2;
  color: #991b1b;
}
@media print {
  .gr-group-row td {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .gr-table tr {
    break-inside: avoid;
  }
}

/* Consultations (minimal layout) */
.cn-page {
  max-width: 980px;
}
.cn-panel {
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0 1.25rem;
}
.cn-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 0;
  font-weight: 650;
}
.cn-panel > summary::-webkit-details-marker {
  display: none;
}
.cn-chevron {
  width: .55rem;
  height: .55rem;
  border-right: 2px solid var(--app-muted, #64748b);
  border-bottom: 2px solid var(--app-muted, #64748b);
  transform: rotate(45deg);
  transition: transform .15s;
}
.cn-panel[open] > summary .cn-chevron {
  transform: rotate(-135deg);
}
.cn-panel[open] {
  padding-bottom: 1.25rem;
}
.cn-panel[open] > summary {
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 1rem;
}
.cn-form .form-label {
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .3rem;
}
.cn-note {
  font-size: .85rem;
  color: var(--app-muted, #64748b);
  background: var(--app-bg, #f1f5f9);
  border-radius: 8px;
  padding: .5rem .75rem;
}
.cn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.cn-chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cn-chips label {
  display: inline-block;
  padding: .3rem .8rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
  background: #fff;
  user-select: none;
}
.cn-chips input:checked + label {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.cn-chips input:focus-visible + label {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.cn-subhead {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin: .25rem 0 .5rem;
}
.cn-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .6rem;
}
.cn-check label {
  display: block;
  font-size: .8rem;
  color: #334155;
  margin-bottom: .2rem;
}
.cn-req {
  font-size: .7rem;
  color: #b45309;
  font-weight: 600;
}
.cn-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.cn-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface, #fff);
  color: #334155;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
}
.cn-filter-chip span {
  font-size: .72rem;
  min-width: 1.3rem;
  text-align: center;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #f1f5f9;
}
.cn-filter-chip.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.cn-filter-chip.is-active span {
  background: rgba(255,255,255,.2);
}
.cn-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .5rem;
}
.cn-section-head h2 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0;
}
.cn-count {
  font-size: .8rem;
  color: var(--app-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.cn-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
}
.cn-empty {
  font-size: .9rem;
  color: var(--app-muted, #64748b);
  padding: 1rem 1.25rem;
  background: var(--app-surface, #fff);
  border: 1px dashed var(--app-border);
  border-radius: 12px;
}
.cn-list {
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
}
.cn-item {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--app-border);
}
.cn-item:last-child {
  border-bottom: 0;
}
.cn-item.is-muted .cn-item-title,
.cn-item.is-muted .cn-item-text {
  color: var(--app-muted, #64748b);
}
.cn-item-main {
  flex: 1 1 320px;
  min-width: 0;
}
.cn-item-side {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  flex-wrap: wrap;
}
.cn-item-title {
  font-size: .95rem;
}
.cn-sep {
  color: var(--app-muted, #64748b);
  margin: 0 .35rem;
}
.cn-item-meta {
  font-size: .8rem;
  color: var(--app-muted, #64748b);
  margin-top: .1rem;
}
.cn-item-text {
  font-size: .85rem;
  margin-top: .35rem;
}
.cn-link {
  font-size: .82rem;
}
.cn-status {
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.cn-status-pending { background: #fef3c7; color: #92400e; }
.cn-status-approved { background: #dbeafe; color: #1e40af; }
.cn-status-completed { background: #dcfce7; color: #166534; }
.cn-status-declined { background: #fee2e2; color: #991b1b; }
.cn-respond {
  flex: 1 1 100%;
}
.cn-respond > summary,
.cn-details > summary {
  font-size: .82rem;
  color: var(--app-accent, #0f766e);
  cursor: pointer;
  width: fit-content;
}
.cn-respond-body {
  display: grid;
  gap: .5rem;
  margin-top: .5rem;
}
.cn-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.cn-inline-form .form-control,
.cn-inline-form .form-select {
  width: auto;
  flex: 1 1 150px;
}
.cn-inline-form .cn-grow {
  flex: 1 1 280px;
}
.cn-reco {
  margin-top: .5rem;
  padding: .55rem .75rem;
  border-left: 3px solid #0f172a;
  background: var(--app-bg, #f8fafc);
  border-radius: 0 8px 8px 0;
  font-size: .88rem;
}
.cn-reco > span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin-bottom: .15rem;
}
.cn-details {
  margin-top: .45rem;
}
.cn-kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .25rem 1rem;
  font-size: .82rem;
  margin-top: .4rem;
}
.cn-kv span {
  color: var(--app-muted, #64748b);
  margin-right: .35rem;
}

/* Adviser profile (minimal layout) */
.ap-section {
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--app-border);
}
.ap-section:first-child {
  padding-top: 0;
}
.ap-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
}
.ap-section-head h2 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0;
}
.ap-hint {
  font-size: .85rem;
  color: var(--app-muted, #64748b);
  margin: .2rem 0 .9rem;
}
.ap-count {
  font-size: .78rem;
  color: var(--app-muted, #64748b);
}
.ap-count.is-empty {
  color: #b91c1c;
}
.ap-expertise .adviser-expertise-groups {
  gap: .9rem;
}
.ap-expertise .adviser-expertise-group {
  border: 0;
  padding: 0;
  background: transparent;
}
.ap-expertise .adviser-expertise-group-title {
  font-size: .72rem;
  margin-bottom: .4rem;
}
.ap-expertise .row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
}
.ap-expertise .row > * {
  width: auto;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
}
.ap-expertise .form-check {
  padding: 0;
  margin: 0;
  min-height: 0;
}
.ap-expertise .form-check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ap-expertise .form-check-label {
  display: inline-block;
  padding: .3rem .75rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  font-size: .82rem;
  cursor: pointer;
  background: #fff;
  color: #334155;
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.ap-expertise .form-check-label:hover {
  border-color: #94a3b8;
}
.ap-expertise .form-check-input:checked + .form-check-label {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.ap-expertise .form-check-input:focus-visible + .form-check-label {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.ap-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  border-bottom: 1px solid var(--app-border);
  margin-bottom: .9rem;
}
.ap-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: .45rem .7rem;
  font-size: .85rem;
  color: var(--app-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.ap-tab:hover {
  color: #0f172a;
}
.ap-tab.is-active {
  color: #0f172a;
  font-weight: 600;
  border-bottom-color: #0f172a;
}
.ap-tab-count:empty {
  display: none;
}
.ap-tab-count {
  font-size: .7rem;
  min-width: 1.1rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  text-align: center;
  line-height: 1.1rem;
}
.ap-tab-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin-bottom: .5rem;
}
.ap-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ap-selected {
  margin-top: .9rem;
  font-size: .8rem;
  color: var(--app-muted, #64748b);
}
.ap-slot-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted, #64748b);
  margin-bottom: .5rem;
}
.ap-slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .35rem;
  margin-bottom: .4rem;
}
.ap-slot-dash {
  color: var(--app-muted, #64748b);
}
.ap-slot-row .adviser-slot-remove {
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  padding: .15rem .35rem;
}
.ap-contacts {
  display: grid;
  gap: .5rem;
}
.ap-contact-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
}
.ap-contact-row .form-check-label {
  font-size: .9rem;
}
.ap-contact-row.is-off .form-control {
  opacity: .45;
}
.ap-contact-inputs {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: .35rem;
}
@media (max-width: 575.98px) {
  .ap-contact-row {
    grid-template-columns: 1fr;
    gap: .3rem;
  }
}
.ap-savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .85rem 0 0;
  background: var(--app-surface, #fff);
  z-index: 5;
}
.ap-card > .card-body {
  padding: 1.5rem 1.75rem 1rem;
}
.ap-section:last-of-type {
  border-bottom: 0;
}
.ap-preview {
  position: sticky;
  top: 5rem;
}

/* Landing page */
.is-auth-page {
  min-height: 100vh;
}
.auth-main {
  min-height: 100vh;
  padding: 0;
}
.landing-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 92%, #000) 0%, var(--app-primary) 48%, color-mix(in srgb, var(--app-primary) 80%, var(--app-accent)) 100%);
  color: var(--landing-ink);
}
.landing-aurora,
.landing-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.landing-aurora {
  background:
    radial-gradient(ellipse 60% 50% at 18% 22%, var(--landing-glow), transparent 60%),
    radial-gradient(ellipse 45% 40% at 78% 70%, rgba(255,255,255,.12), transparent 55%);
  animation: landingGlow 10s ease-in-out infinite alternate;
}
.landing-grid {
  opacity: .14;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
  animation: landingDrift 24s linear infinite;
}
.landing-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
  max-width: 44rem;
}
.landing-kicker {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--landing-muted);
  animation: landingRise .7s ease both;
}
.landing-brand {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 5vw, 4.1rem);
  line-height: 1.05;
  font-weight: 700;
  color: #fff;
  animation: landingRise .8s .08s ease both;
}
.landing-lead {
  margin: 0;
  max-width: 32rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--landing-muted);
  animation: landingRise .8s .16s ease both;
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
  animation: landingRise .8s .24s ease both;
}
.btn-landing-primary {
  background: #fff;
  color: var(--app-primary);
  border: 0;
  font-weight: 700;
  padding: .7rem 1.2rem;
  border-radius: 999px;
}
.btn-landing-primary:hover {
  background: #f1f5f9;
  color: var(--app-primary);
}
.btn-landing-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  font-weight: 600;
  padding: .7rem 1.2rem;
  border-radius: 999px;
}
.btn-landing-ghost:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.landing-signin {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: color-mix(in srgb, var(--app-bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.landing-form {
  width: min(100%, 420px);
  color: var(--app-text);
  animation: landingRise .85s .18s ease both;
}
.landing-form h2 {
  margin: 0 0 .35rem;
  font-size: 1.7rem;
  font-weight: 700;
}
.landing-form > p {
  color: var(--app-muted);
  margin-bottom: 1.25rem;
}
.landing-form .btn-landing-submit {
  display: block;
  width: 100%;
  background: var(--app-primary);
  color: #fff !important;
  border: 0;
  font-weight: 700;
  padding: .85rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}
.landing-form .btn-landing-submit:hover {
  background: var(--app-primary-hover);
  color: #fff !important;
}
.is-auth-page .landing-signup {
  display: block;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid #dbe3ea;
}
.is-auth-page .landing-signup-label {
  display: block;
  margin: 0 0 .75rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}
.is-auth-page .landing-signup-btn {
  display: flex !important;
  align-items: center;
  gap: .85rem;
  width: 100%;
  margin: 0 0 .65rem;
  padding: .9rem 1rem;
  border-radius: 14px;
  text-decoration: none !important;
  color: #0f172a !important;
  background: #ffffff;
  border: 1px solid #c9d5e0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.is-auth-page .landing-signup-btn:last-child {
  margin-bottom: 0;
}
.is-auth-page .landing-signup-btn:hover,
.is-auth-page .landing-signup-btn:focus {
  transform: translateY(-2px);
  color: #0f172a !important;
  border-color: var(--app-accent);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .1);
}
.is-auth-page .landing-signup-btn-adviser {
  background: #f8fafc;
}
.is-auth-page .landing-signup-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 12px;
  flex: 0 0 2.45rem;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
  background: var(--app-primary);
}
.is-auth-page .landing-signup-btn-adviser .landing-signup-badge {
  background: var(--app-accent);
}
.is-auth-page .landing-signup-text {
  display: flex !important;
  flex-direction: column;
  gap: .12rem;
  flex: 1 1 auto;
  min-width: 0;
}
.is-auth-page .landing-signup-text strong {
  display: block;
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}
.is-auth-page .landing-signup-text em {
  display: block;
  font-style: normal;
  font-size: .8rem;
  color: #64748b;
  line-height: 1.3;
}
.is-auth-page .landing-signup-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .85rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.is-auth-page .landing-signup-btn:hover .landing-signup-arrow {
  background: var(--app-accent);
  color: #fff;
}
@keyframes landingRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes landingGlow {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(1.06); opacity: 1; }
}
@keyframes landingDrift {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}

/* Theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .85rem;
}
.theme-option {
  display: flex;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: .85rem;
  background: var(--app-surface);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-option.is-selected,
.theme-option:has(input:checked) {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 18%, transparent);
}
.theme-swatches {
  display: flex;
  gap: .25rem;
  flex: 0 0 auto;
}
.theme-swatches i {
  width: 1rem;
  height: 2.1rem;
  border-radius: .35rem;
  display: block;
}
.theme-meta {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.theme-meta strong {
  font-size: .92rem;
}
.theme-meta small {
  color: var(--app-muted);
  font-size: .78rem;
}
.theme-group-title {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin: 0 0 .6rem;
}
.theme-grid-photo {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.theme-option-photo {
  flex-direction: column;
  align-items: stretch;
  padding: .5rem;
  gap: .5rem;
}
.theme-option-photo:hover {
  border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-border));
}
.theme-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.theme-thumb-swatches {
  position: absolute;
  left: .4rem;
  bottom: .4rem;
  display: flex;
  gap: .2rem;
  padding: .2rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .85);
}
.theme-thumb-swatches i {
  display: block;
  width: .7rem;
  height: .7rem;
  border-radius: 3px;
}
.theme-option-photo .theme-meta {
  padding: 0 .2rem .15rem;
}

/* Performance reports */
.perf-kpi {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 1rem 1.1rem;
  height: 100%;
}
.perf-kpi-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--app-muted);
  font-weight: 700;
}
.perf-kpi-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  margin: .35rem 0 .2rem;
}
.perf-bars {
  display: grid;
  gap: .7rem;
}
.perf-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr auto;
  gap: .65rem;
  align-items: center;
}
.perf-bar-label {
  font-size: .86rem;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perf-bar-track {
  height: .55rem;
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  overflow: hidden;
}
.perf-bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
  border-radius: inherit;
}
.perf-bar-value {
  font-size: .86rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: right;
}

@media (max-width: 960px) {
  .landing-shell {
    grid-template-columns: 1fr;
  }
  .landing-hero {
    min-height: 52vh;
    max-width: none;
  }
  .landing-signin {
    min-height: 48vh;
  }
}
@media (max-width: 640px) {
  .perf-bar-row {
    grid-template-columns: 1fr auto;
  }
  .perf-bar-label {
    grid-column: 1 / -1;
  }
}

.grading-hub-item {
  border-left: 3px solid transparent;
}
.grading-hub-item:hover {
  border-left-color: var(--app-accent);
  background: var(--app-surface-soft);
}
.stage-card-focus {
  outline: 2px solid var(--app-accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--app-accent) 16%, transparent);
}

.project-jump-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .85rem;
  padding: .65rem .9rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  position: sticky;
  top: 4.25rem;
  z-index: 20;
  box-shadow: var(--app-shadow);
}
.project-jump-nav a {
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  color: var(--app-text);
  padding: .2rem .45rem;
  border-radius: .35rem;
}
.project-jump-nav a:hover {
  background: var(--app-surface-soft);
  color: var(--app-accent, #2563eb);
}
.project-jump-meta {
  margin-left: auto;
  font-size: .82rem;
  color: var(--app-muted);
}
.project-section {
  scroll-margin-top: 6.5rem;
}
.project-section[hidden] { display: none !important; }
.project-tabs { gap: .25rem .35rem; }
.project-tabs a[data-project-tab] {
  padding: .4rem .8rem;
  border-radius: 999px;
  color: var(--app-muted);
}
.project-tabs a[data-project-tab].active {
  background: #0f172a;
  color: #fff;
}
@media (max-width: 575.98px) {
  .project-tabs { position: static; }
  .project-tabs .project-jump-meta { width: 100%; margin-left: 0; }
}
.stage-subnav {
  gap: .35rem;
  flex-wrap: wrap;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--app-border);
  position: relative;
  z-index: 2;
}
.stage-subnav .nav-link {
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: var(--app-muted);
  background: var(--app-surface);
  font-weight: 600;
  font-size: .88rem;
  padding: .4rem .95rem;
  cursor: pointer;
  pointer-events: auto;
}
.stage-subnav .nav-link:hover {
  color: var(--app-text);
  background: var(--app-surface-soft);
}
.stage-subnav .nav-link.active {
  color: #fff;
  background: var(--app-ink, #0f172a);
  border-color: var(--app-ink, #0f172a);
}
.is-student-ui-preview .project-jump-nav {
  top: 7.5rem;
}
.stage-tabs {
  padding: .55rem .55rem 0;
  gap: .35rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-soft);
  flex-wrap: nowrap;
  overflow-x: auto;
}
.stage-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--app-muted);
  font-weight: 600;
  border-radius: 10px 10px 0 0;
  padding: .7rem 1rem;
  background: transparent;
}
.stage-tabs .nav-link .badge {
  font-weight: 600;
}
.stage-tabs .nav-link:hover {
  color: var(--app-text);
  background: color-mix(in srgb, var(--app-surface) 70%, transparent);
}
.stage-tabs .nav-link.active {
  color: var(--app-text);
  background: var(--app-surface);
  border-color: var(--app-border);
  border-bottom-color: var(--app-surface);
  position: relative;
  z-index: 1;
}
.stage-tab-content > .tab-pane {
  padding: 0;
}
.stage-tab-content .stage-card {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0;
}
.stage-tab-label {
  font-family: var(--font-sans);
  font-size: .95rem;
}
@media (max-width: 640px) {
  .stage-tabs .nav-link {
    padding: .65rem .8rem;
    font-size: .9rem;
  }
}

/* Analytics — tabbed workspace */
.analytics-toolbar {
  position: sticky;
  top: 3.5rem;
  z-index: 5;
}
.analytics-tabs .nav-link {
  font-size: .88rem;
  padding: .4rem .85rem;
}
.analytics-scroll {
  max-height: 280px;
  overflow: auto;
}
.analytics-scroll-tall {
  max-height: 360px;
  overflow: auto;
}
.analytics-map-frame {
  height: 240px;
}
.analytics-map-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}
.analytics-kpis .fs-4 {
  line-height: 1.15;
}

/* Panel Board — compact accordion workspace */
.panel-board-filters {
  position: sticky;
  top: 3.5rem;
  z-index: 4;
}
.panel-board-chip {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .7rem .85rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.panel-board-chip:hover {
  border-color: color-mix(in srgb, var(--app-accent, #2563eb) 50%, var(--app-border));
  color: inherit;
}
.panel-board-chip.is-active {
  border-color: var(--app-ink, #0f172a);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-ink, #0f172a) 12%, transparent);
}
.panel-board-chip-n {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}
.panel-board-chip-l {
  font-size: .78rem;
  color: var(--app-muted, #64748b);
}
.panel-board-item {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: .65rem;
  background: var(--app-surface);
}
.panel-board-summary {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  margin: 0;
  border: 0;
  background: var(--app-surface);
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.panel-board-summary:hover {
  background: var(--app-surface-soft, #f8fafc);
}
.panel-board-item.is-open .panel-board-summary {
  background: var(--app-surface-soft, #f8fafc);
  border-bottom: 1px solid var(--app-border);
}
.panel-board-summary-main {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}
.panel-board-summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.panel-board-summary-title {
  font-weight: 650;
  line-height: 1.35;
}
.panel-board-summary-meta {
  line-height: 1.4;
}
.panel-board-summary-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--app-muted, #64748b);
  white-space: nowrap;
  margin-top: .15rem;
}
.panel-board-item.is-open .panel-board-summary-cta {
  color: var(--app-ink, #0f172a);
}
.panel-board-chevron {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -.15rem;
  transition: transform .15s ease;
}
.panel-board-item.is-open .panel-board-chevron {
  transform: rotate(225deg);
  margin-top: .1rem;
}
.panel-board-body {
  padding: .9rem 1rem 1rem;
}
.panel-board-form .form-label {
  color: var(--app-muted, #64748b);
}
.panel-board-pager {
  display: flex;
  gap: .35rem;
}


@media print {
    .app-navbar,
    .sidebar,
    .no-print,
    .alert-dismissible,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate,
    .dataTables_info {
        display: none !important;
    }
    .app-shell {
        display: block !important;
    }
    .content-area {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .card {
        box-shadow: none !important;
        break-inside: auto;
    }
    table {
        font-size: 11px;
    }
}

/* Print-only letterhead (print_letterhead_html) */
.print-letterhead {
    text-align: center;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 6px;
    margin-bottom: 12px;
    break-inside: avoid;
}
.print-letterhead-institution {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.25;
}
.print-letterhead-school {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.print-letterhead-app {
    font-size: 10.5px;
    color: #475569;
}

/* Shared minimalist tabs + stat strip */
.ui-tabs {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--app-border, #e2e8f0);
  scrollbar-width: thin;
}
.ui-tabs a, .ui-tabs button {
  flex: 0 0 auto;
  padding: .55rem .9rem;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--app-muted, #64748b);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}
.ui-tabs a:hover, .ui-tabs button:hover { color: #0f172a; }
.ui-tabs a.active, .ui-tabs button.active { color: #0f172a; border-bottom-color: #0f172a; }
.ui-tabs .ui-tab-count { font-size: .72rem; font-weight: 700; margin-left: .3rem; padding: .05rem .4rem; border-radius: 999px; background: #eef2f7; color: #475569; }
.ui-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; font-size: .85rem; color: var(--app-muted, #64748b); }
.ui-stats strong { color: var(--app-text, #0f172a); font-size: 1rem; margin-right: .15rem; }
.ui-stats .is-warn strong { color: #b45309; }
.ui-stats .is-ok strong { color: #15803d; }
.ui-stats-note { margin-left: auto; font-size: .78rem; cursor: help; }

[data-ui-panel][hidden] { display: none !important; }
.ui-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.ui-fold > summary::-webkit-details-marker { display: none; }
.ui-fold > summary::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  opacity: .6;
}
.ui-fold[open] > summary::before { transform: rotate(45deg); }

/* Dashboard tabs */
[data-dash-panel][hidden] { display: none !important; }
.dash-tabs { margin-top: .5rem; }
.dash-tabbar {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  padding: .35rem;
  margin-bottom: .75rem;
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border, #e2e8f0);
  border-radius: 12px;
  scrollbar-width: thin;
}
.dash-tab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--app-muted, #64748b);
  font-weight: 600;
  font-size: .88rem;
  padding: .45rem .9rem;
  border-radius: 9px;
  white-space: nowrap;
}
.dash-tab:hover { background: #f1f5f9; color: #0f172a; }
.dash-tab.active { background: #0f172a; color: #fff; }
.dash-tabs .grading-hub > .page-header,
.dash-tabs .perf-report > .page-header { margin-top: 0; }

/* Sidebar menu (task-based sections) */
.sidebar a[hidden], .nav-sec[hidden] { display: none !important; }
.nav-search { padding: .35rem .25rem .6rem; }
.nav-search .form-control { border-radius: 9px; font-size: .85rem; background: #f8fafc; }
.nav-menu { display: flex; flex-direction: column; gap: .15rem; }
.nav-top { padding-bottom: .4rem; margin-bottom: .2rem; border-bottom: 1px solid var(--app-border); }
.sidebar a.nav-item-link {
  padding: .5rem .65rem;
  margin-bottom: .1rem;
  font-size: .9rem;
  font-weight: 500;
  gap: .6rem;
  border-radius: 9px;
}
.sidebar a.nav-item-link .nav-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
}
.sidebar a.nav-item-link:hover .nav-icon { color: #0f172a; }
.sidebar a.nav-item-link.active { font-weight: 600; }
.sidebar a.nav-item-link.active .nav-icon { background: #dbeafe; color: #1d4ed8; }
.nav-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  flex: 0 0 auto;
  min-width: 1.35rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
}
.nav-badge-sm { min-width: 1.15rem; font-size: .62rem; padding: 0 .35rem; }
.nav-sec { margin-top: .35rem; }
.nav-sec-title,
.nav-sec-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: .45rem .65rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #94a3b8;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
}
.nav-sec-toggle { cursor: pointer; border-radius: 8px; padding-top: .5rem; padding-bottom: .5rem; }
.nav-sec-toggle > span:first-child { flex: 1 1 auto; }
.nav-sec-toggle:hover { color: #334155; background: #f8fafc; }
.nav-sec.has-active > .nav-sec-toggle { color: #1d4ed8; }
.nav-sec-toggle .nav-caret {
  width: .42rem;
  height: .42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  margin-right: .2rem;
}
.nav-sec.is-open > .nav-sec-toggle .nav-caret { transform: rotate(45deg); margin-top: -.2rem; }
.nav-sec.is-collapsible > .nav-sec-body { display: none; }
.nav-sec.is-collapsible.is-open > .nav-sec-body,
.nav-sec.is-searching > .nav-sec-body { display: block; }
.nav-empty { padding: .5rem .75rem; }

/* projects.php member names */
.pj-members { font-size: .84rem; line-height: 1.4; min-width: 140px; }
.pj-members > div { white-space: nowrap; }
.pj-members .badge { font-size: .65rem; font-weight: 500; }
.pj-leader { font-weight: 600; }
.pj-leader-tag { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 6px; vertical-align: 1px; }

/* projects.php minimalist layout */
.pj-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.pj-filter .form-select { width: auto; max-width: 220px; }
.pj-filter-q { flex: 1 1 260px; max-width: 420px; }
.pj-code { font-weight: 700; color: inherit; text-decoration: none; }
.pj-code:hover { text-decoration: underline; }
.pj-meta { font-size: .75rem; color: #6c757d; line-height: 1.35; }
.pj-status { font-size: .68rem; margin-top: .3rem; cursor: help; }
.pj-title-cell { min-width: 220px; max-width: 360px; }
.pj-title { font-weight: 500; line-height: 1.35; }
.pj-filing { margin-top: .3rem; font-size: .8rem; }
.pj-actions { display: inline-flex; flex-wrap: nowrap; gap: .35rem; align-items: center; justify-content: flex-end; }
.pj-actions form { margin: 0; }
.pj-more { line-height: 1; padding: .25rem .55rem; font-weight: 700; }
.pj-callout { background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e; font-size: .85rem; padding: .6rem 1rem; }
.pj-help { margin-top: 1rem; border: 1px solid rgba(0,0,0,.08); border-radius: 10px; background: #fff; }
.pj-help > summary { cursor: pointer; padding: .65rem 1rem; font-size: .85rem; font-weight: 600; color: #495057; list-style: none; }
.pj-help > summary::-webkit-details-marker { display: none; }
.pj-help > summary::before { content: "ⓘ "; }
.pj-help[open] > summary { border-bottom: 1px solid rgba(0,0,0,.06); }
.pj-help-body { padding: .85rem 1rem; display: grid; gap: .6rem; font-size: .85rem; }
.pj-help-body p { margin: .15rem 0 0; color: #495057; }
@media (max-width: 575.98px) {
    .pj-filter .form-select { max-width: none; flex: 1 1 45%; }
    .pj-filter-q { max-width: none; }
}
.pj-adviser { font-size: .85rem; white-space: nowrap; }

/* index.php student "My group" card */
.mg-card { background: #fff; border: 1px solid rgba(0,0,0,.08); border-left: 5px solid #6c757d; border-radius: 12px; padding: 1rem 1.1rem; }
.mg-card.mg-is-leader { border-left-color: #d97706; background: linear-gradient(90deg, #fffbeb 0, #fff 45%); }
.mg-card.mg-is-member { border-left-color: #2563eb; background: linear-gradient(90deg, #eff6ff 0, #fff 45%); }
.mg-none { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.mg-top { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.25rem; }
.mg-role-badge { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; border-radius: 10px; background: #fff; border: 1px solid rgba(0,0,0,.08); }
.mg-role-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; color: #fff; background: #2563eb; flex-shrink: 0; }
.mg-is-leader .mg-role-icon { background: #d97706; }
.mg-info { flex: 1 1 260px; min-width: 0; }
.mg-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.mg-members { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.mg-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; padding: .25rem .6rem; border-radius: 999px; background: #f1f3f5; border: 1px solid rgba(0,0,0,.06); }
.mg-chip small { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }
.mg-chip-leader { background: #fef3c7; border-color: #fcd34d; font-weight: 600; }
.mg-chip-leader small { color: #92400e; }
.mg-hint { margin-top: .7rem; color: #495057; }

/* adviser_invite.php */
.ai-wrap { max-width: 720px; margin: 0 auto; }
.ai-card { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: 1.25rem; }
.ai-share { border-color: rgba(13,110,253,.25); background: #f8fbff; }
.ai-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.ai-avatar { width: 52px; height: 52px; border-radius: 50%; background: #212529; color: #fff; display: grid; place-items: center; font-size: 1.35rem; font-weight: 600; flex-shrink: 0; }
.ai-section { border-top: 1px solid rgba(0,0,0,.06); margin-top: 1rem; padding-top: .85rem; }
.ai-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; margin-bottom: .35rem; }
.ai-group { border: 1px solid rgba(0,0,0,.08); border-radius: 10px; padding: .85rem; margin-bottom: .75rem; }
.ai-group:last-child { margin-bottom: 0; }

/* advisees.php reports */
.adv-report .adv-report-group td { background: #f1f3f5; font-size: .9rem; }
@media print {
    .adv-report .adv-report-group td { background: #e9ecef !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* forgot_password.php method switch */
.fp-methods { display: flex; gap: .25rem; padding: .25rem; border-radius: 10px; background: #eef2f7; }
.fp-methods a {
  flex: 1; text-align: center; padding: .4rem .5rem; border-radius: 8px;
  font-size: .85rem; font-weight: 600; color: #475569; text-decoration: none;
}
.fp-methods a.active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* duplicate_accounts.php */
.dup-bulkbar {
  position: sticky; top: 64px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .55rem .75rem; margin-bottom: .85rem;
  background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px;
  box-shadow: var(--app-shadow);
}
.dup-group .users-avatar { width: 32px; height: 32px; border-radius: 8px; font-size: .7rem; flex-shrink: 0; }
.dup-group tr.dup-keep > td { background: color-mix(in srgb, var(--app-success) 7%, transparent); }

/* security_log.php */
.sec-table code { font-size: .85rem; color: var(--app-text); }

/* Quick action tiles (project.php hub + dashboard) */
.hub-actions { background: var(--app-surface, #fff); border: 1px solid var(--app-border); border-radius: 12px; padding: .75rem; }
.hub-actions-label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--app-muted, #64748b); margin: 0 0 .5rem .15rem; }
.hub-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.hub-tile { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--app-border); border-radius: 10px; color: inherit; text-decoration: none; background: var(--app-surface, #fff); transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.hub-tile:hover { border-color: var(--app-accent, #0f766e); box-shadow: 0 2px 10px rgba(15, 23, 42, .08); transform: translateY(-1px); color: inherit; }
.hub-tile-icon { width: 2rem; height: 2rem; border-radius: 8px; background: var(--app-bg, #f1f5f9); color: var(--app-accent, #0f766e); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hub-tile-text { display: grid; min-width: 0; }
.hub-tile-text strong { font-size: .9rem; line-height: 1.25; }
.hub-tile-text small { font-size: .75rem; color: var(--app-muted, #64748b); line-height: 1.3; overflow-wrap: anywhere; }
.hub-tile.is-attention { border-color: #f59e0b; background: #fffbeb; }
.hub-tile.is-attention .hub-tile-icon { background: #fef3c7; color: #b45309; }
.hub-tile-count { margin-left: auto; align-self: center; font-size: .75rem; font-weight: 700; background: #f59e0b; color: #fff; border-radius: 999px; padding: .05rem .5rem; }
.hub-timeline { background: var(--app-surface, #fff); border: 1px solid var(--app-border); border-radius: 12px; overflow: hidden; }
.hub-timeline-item { display: flex; gap: 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--app-border); }
.hub-timeline-item:last-child { border-bottom: 0; }
.hub-timeline-date { width: 3.4rem; flex-shrink: 0; text-align: center; border-right: 2px solid var(--app-border); padding-right: .75rem; }
.hub-timeline-date strong { display: block; font-size: .9rem; }
.hub-timeline-date span { font-size: .72rem; color: var(--app-muted, #64748b); }
.hub-timeline-body { min-width: 0; flex: 1; }
.hub-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.hub-chips span { font-size: .72rem; background: #f1f5f9; color: #334155; border-radius: 999px; padding: .1rem .55rem; }
.hub-summary { padding: .2rem .15rem .75rem; margin-bottom: .6rem; border-bottom: 1px dashed var(--app-border); }
.hub-summary-title { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.hub-summary-meta { font-size: .82rem; color: var(--app-muted, #64748b); margin-top: .15rem; }
.hub-revisions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .5rem; }
.hub-rev-chip { font-size: .74rem; border: 1px solid var(--app-border); border-radius: 999px; padding: .15rem .6rem; text-decoration: none; color: inherit; background: var(--app-bg, #f8fafc); }
.hub-rev-chip:hover { border-color: var(--app-accent, #0f766e); color: inherit; }

/* project.php manuscripts: revision → final → RC approval → panel */
.ms-flow { display: flex; flex-wrap: wrap; gap: .35rem; }
.ms-flow-step { font-size: .76rem; background: var(--app-bg, #f1f5f9); border: 1px solid var(--app-border); border-radius: 999px; padding: .15rem .65rem .15rem .2rem; display: inline-flex; align-items: center; gap: .35rem; }
.ms-flow-step b { width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--app-accent, #0f766e); color: #fff; font-size: .7rem; display: inline-flex; align-items: center; justify-content: center; }
.manuscript-item.is-final { border-left: 4px solid #b45309 !important; background: #fffbeb; }
.ms-panel-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-top: .5rem; border-top: 1px dashed var(--app-border); }
.fd-approve { min-width: 11rem; }
.fd-remarks { max-width: 16rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--app-text, #334155); }

/* Manuscript adviser review status + history */
.ms-review-state { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem .65rem; border-radius: 8px; border: 1px solid var(--app-border); background: var(--app-surface, #fff); }
.ms-review-state.ms-review-success { border-left: 4px solid #198754; }
.ms-review-state.ms-review-warning { border-left: 4px solid #d97706; }
.ms-review-state.ms-review-danger { border-left: 4px solid #dc3545; }
.ms-review-state.ms-review-info { border-left: 4px solid #0dcaf0; }
.ms-review-state.ms-review-secondary { border-left: 4px solid #94a3b8; }
.ms-review-remarks { flex-basis: 100%; font-size: .9rem; }
.ms-review-history summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.ms-review-list { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .45rem; }
.ms-review-list li { border-left: 2px solid var(--app-border); padding-left: .6rem; }
.mr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; }
.mr-stat { display: grid; padding: .7rem .9rem; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface, #fff); color: inherit; text-decoration: none; }
.mr-stat strong { font-size: 1.4rem; line-height: 1.1; }
.mr-stat span { font-size: .78rem; color: var(--app-muted, #64748b); }
.mr-stat.mr-stat-warn strong { color: #b45309; }
.mr-stat:hover { border-color: var(--app-accent, #0f766e); color: inherit; }
.mr-remarks { max-width: 22rem; }
.pg-visibility { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.pg-visibility:empty { display: none; }
.pg-visibility > div, .pg-visibility > form { padding: .5rem .7rem; border: 1px dashed var(--app-border); border-radius: 8px; }
.pg-visibility > form { border: 0; padding: 0; }
/* register.php duplicate-account notice */
.signup-dup-list { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .3rem; }
.signup-dup-user { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; background: rgba(255, 255, 255, .7); border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px; padding: .1rem .45rem; }

/* profile.php notification settings */
.notify-list { display: grid; margin-bottom: .5rem; }
.notify-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--app-border); }
.notify-row:last-child { border-bottom: 0; }
.notify-row .form-check-input { width: 2.6em; height: 1.35em; cursor: pointer; }

/* consultations.php search + record form */
.cn-head-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cn-search { background: var(--app-surface, #fff); border: 1px solid var(--app-border); border-radius: 12px; padding: .75rem; margin-bottom: .75rem; display: grid; gap: .5rem; }
.cn-search-main { display: flex; gap: .4rem; }
.cn-search-main .form-control { flex: 1 1 auto; }
.cn-search-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cn-search-filters .form-select { width: auto; max-width: 220px; }
.cn-date { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--app-muted, #64748b); margin: 0; }
.cn-date .form-control { width: auto; }
.cn-search-hint { font-size: .75rem; color: var(--app-muted, #64748b); display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.cn-review-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem .9rem; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 10px; font-size: .9rem; }
.cn-record.is-unapproved { border-left: 4px solid #f59e0b; background: #fffdf5; }
.cn-review-note { margin-top: .4rem; font-size: .85rem; background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; border-radius: 8px; padding: .4rem .6rem; }
.cn-review-note span { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cn-panel-review > summary { color: #92400e; }
.cn-active-filter { font-size: .82rem; background: #eff6ff; color: #1e40af; border-radius: 8px; padding: .35rem .65rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cn-active-filter a { color: inherit; font-weight: 600; text-decoration: none; }
.cn-quickfilter { display: flex; gap: .5rem; align-items: center; }
.cn-quickfilter .form-control { max-width: 420px; }
.cn-quickfilter-count { font-size: .75rem; color: var(--app-muted, #64748b); white-space: nowrap; font-weight: 600; }
.cn-empty-filter { font-size: .88rem; color: var(--app-muted, #64748b); padding: .9rem 1.25rem; }
.cn-group-link { font-weight: 700; color: inherit; text-decoration: none; }
.cn-group-link:hover { text-decoration: underline; }
.cn-item-sub { font-size: .84rem; color: #334155; margin-top: .1rem; }
.cn-item-members { font-size: .78rem; color: var(--app-muted, #64748b); margin-top: .1rem; }
.cn-item-members::before { content: "Members: "; font-weight: 600; }
.cn-record mark, .cn-item mark { background: #fef08a; color: inherit; padding: 0 .1rem; border-radius: 3px; }
.cn-step { display: flex; align-items: center; gap: .5rem; font-weight: 650; font-size: .92rem; margin-bottom: .5rem; }
.cn-step > span { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #0f172a; color: #fff; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cn-gpick { border: 1px solid var(--app-border); border-radius: 10px; overflow: hidden; }
.cn-gpick-tools { display: flex; gap: .5rem; align-items: center; padding: .5rem; border-bottom: 1px solid var(--app-border); background: var(--app-bg, #f8fafc); }
.cn-gpick-selected { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem .75rem; font-size: .85rem; font-weight: 600; background: #ecfdf5; color: #065f46; border-bottom: 1px solid var(--app-border); }
.cn-gpick-list { max-height: 300px; overflow-y: auto; }
.cn-gpick-item { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border-bottom: 1px solid var(--app-border); cursor: pointer; margin: 0; }
.cn-gpick-item:last-of-type { border-bottom: 0; }
.cn-gpick-item:hover { background: var(--app-bg, #f8fafc); }
.cn-gpick-item.is-picked { background: #f0fdf4; box-shadow: inset 3px 0 0 #16a34a; }
.cn-gpick-item input { margin-top: .25rem; flex-shrink: 0; }
.cn-gpick-body { display: grid; gap: .1rem; min-width: 0; }
.cn-gpick-top { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
.cn-gpick-stage { font-size: .7rem; font-weight: 600; background: #f1f5f9; color: #475569; border-radius: 999px; padding: .05rem .5rem; }
.cn-gpick-last { font-size: .75rem; color: var(--app-muted, #64748b); }
.cn-gpick-title { font-size: .85rem; color: #334155; }
.cn-gpick-members { font-size: .76rem; color: var(--app-muted, #64748b); }
.cn-gpick.is-collapsed .cn-gpick-tools,
.cn-gpick.is-collapsed .cn-gpick-item:not(.is-picked) { display: none; }
.cn-topic-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.cn-topic-chip { border: 1px dashed var(--app-border); background: transparent; border-radius: 999px; font-size: .75rem; padding: .15rem .6rem; color: #475569; }
.cn-topic-chip:hover { border-style: solid; background: var(--app-bg, #f1f5f9); }
@media (max-width: 575.98px) {
  .cn-search-filters .form-select, .cn-date { flex: 1 1 45%; max-width: none; }
  .cn-date .form-control { flex: 1 1 auto; }
  .cn-head-actions { width: 100%; }
}

/* consultations.php: action tiles, tabs, form card, history items */
.cx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.cx-stat { display: flex; align-items: center; gap: .7rem; padding: .65rem .85rem; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface, #fff); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.cx-stat:hover { border-color: var(--app-accent, #0f766e); box-shadow: 0 2px 10px rgba(15, 23, 42, .08); color: inherit; }
.cx-stat-num { font-size: 1.45rem; font-weight: 700; line-height: 1; min-width: 1.7rem; text-align: center; color: var(--app-text, #0f172a); }
.cx-stat-text { display: grid; min-width: 0; }
.cx-stat-text strong { font-size: .86rem; line-height: 1.25; }
.cx-stat-text small { font-size: .74rem; line-height: 1.3; color: var(--app-muted, #64748b); }
.cx-stat.is-zero .cx-stat-num { color: #94a3b8; }
.cx-stat.is-warn { border-color: #f59e0b; background: #fffbeb; }
.cx-stat.is-warn .cx-stat-num { color: #b45309; }
.cx-stat.is-danger { border-color: #fca5a5; background: #fef2f2; }
.cx-stat.is-danger .cx-stat-num { color: #b91c1c; }
.cx-tabs { margin-bottom: 1rem; }
.cx-tabs .ui-tab-count.is-warn { background: #f59e0b; color: #fff; }
.cx-panel { scroll-margin-top: 80px; }
.cx-card { background: var(--app-surface, #fff); border: 1px solid var(--app-border); border-radius: 12px; padding: 1.1rem 1.25rem 1.25rem; }
.cx-card.is-review { border-color: #fcd34d; box-shadow: inset 4px 0 0 #f59e0b; }
.cx-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--app-border); }
.cx-h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.cx-lead { font-size: .85rem; color: var(--app-muted, #64748b); margin: .25rem 0 0; max-width: 48rem; }
.cx-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--app-border); }
.cx-filters { background: var(--app-surface, #fff); border: 1px solid var(--app-border); border-radius: 12px; padding: .6rem; margin-bottom: .75rem; display: grid; gap: .45rem; }
.cx-filter-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cx-filter-q { flex: 1 1 240px; min-width: 0; width: auto; }
.cx-filter-row .form-select { width: auto; flex: 0 1 auto; max-width: 200px; }
.cx-dates { display: inline-flex; gap: .4rem; align-items: center; }
.cx-filter-row .cn-date .form-control { width: 8.9rem; }
.cx-rec .cn-item-main { flex: 1 1 260px; }
.cx-rec-date { width: 3.3rem; flex-shrink: 0; align-self: flex-start; text-align: center; border-right: 2px solid var(--app-border); padding-right: .6rem; }
.cx-rec-date strong { display: block; font-size: .88rem; line-height: 1.2; }
.cx-rec-date span { font-size: .72rem; color: var(--app-muted, #64748b); }
.cx-rec-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; }
.cx-rec-topics { font-weight: 600; font-size: .95rem; margin-top: .2rem; overflow-wrap: anywhere; }
.cx-chip { font-size: .7rem; font-weight: 600; background: #f1f5f9; color: #475569; border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.cx-rec.is-target { animation: cx-target 2.4s ease-out; }
@keyframes cx-target { 0% { background: #dbeafe; } 100% { background: transparent; } }
.cx-hint { font-size: .8rem; color: #92400e; margin-top: .3rem; }
.cx-hint.is-ok { color: #166534; }
.cx-closed > summary { font-size: .85rem; font-weight: 600; color: var(--app-accent, #0f766e); cursor: pointer; width: fit-content; }
.cx-empty-title { display: block; font-weight: 650; color: var(--app-text, #0f172a); margin-bottom: .15rem; }
.cx-empty-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
#requestList > .cn-subhead { margin-top: 0; }
.cx-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .35rem 1rem; margin: .55rem 0 .4rem; font-size: .84rem; }
.cx-facts dt { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--app-muted, #64748b); }
.cx-facts dd { margin: 0; }
.cx-review-actions { display: flex; flex-direction: column; gap: .4rem; width: 13.5rem; flex-shrink: 0; }
.cx-return > summary { list-style: none; }
.cx-return > summary::-webkit-details-marker { display: none; }
.cx-return-form { display: grid; gap: .4rem; margin-top: .4rem; }
@media (max-width: 575.98px) {
  .cx-stats { grid-template-columns: 1fr 1fr; }
  .cx-stat { flex-direction: column; align-items: flex-start; gap: .3rem; padding: .6rem .7rem; }
  .cx-rec-date { display: none; }
  .cx-filter-row .form-select { flex: 1 1 45%; max-width: none; }
  .cx-dates { flex: 1 1 100%; }
  .cx-dates .cn-date { flex: 1 1 50%; }
  .cx-filter-row .cn-date .form-control { width: auto; flex: 1 1 auto; }
  .cx-filter-row .btn-dark { flex: 1 1 auto; }
  .cx-card { padding: .9rem; }
  .cx-rec .cn-item-side { flex-basis: 100%; }
  .cx-review-actions { width: 100%; }
  .cx-form-actions .btn { flex: 1 1 100%; }
}
