/* ==========================================================================
   Grouply Component Library (Apple Dark Glass Style)
   True Black OLED #000000 | Unbounded + Inter | Neutral Translucent Glass (Zero Blue)
   ========================================================================== */

/* --------------------------------------------------------------------------
   App Header (Apple Frosted Glass)
   -------------------------------------------------------------------------- */
.app-header {
  padding: 10px 18px 2px 18px;
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 50;
}

/* Telegram Fullscreen: Offset header to clear floating pills (✕ Закрыть and v ...) */
.in-telegram .app-header {
  padding-top: max(var(--tg-content-safe-top, 0px), 52px);
}


.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-img {
  height: 19px;
  width: auto;
  max-width: 125px;
  object-fit: contain;
  display: block;
}

.brand-badge {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--color-text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.user-avatar:active {
  transform: scale(0.95);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Cards & Surfaces (Apple Dark Glass - Sleek, Unbloated)
   -------------------------------------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Typographic Identity Labels (Pure text + icon, ZERO colored pill badges)
   -------------------------------------------------------------------------- */
.identity-role {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.identity-role.leader {
  color: #fbbf24;
}

.identity-role.deputy {
  color: #d1d5db;
}

/* --------------------------------------------------------------------------
   Buttons (Apple Solid Tactile White & Frosted Glass, ZERO BLUE)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--min-touch-target);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease, background 0.15s ease;
  user-select: none;
  outline: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.92;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none !important;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.btn-primary svg {
  stroke: #000000;
}

.btn-primary:active {
  background: #e5e5ea;
  color: #000000;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   Form Controls
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  min-height: var(--min-touch-target);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none;
}

.form-control::placeholder {
  color: var(--color-text-dim);
}

.form-control:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* --------------------------------------------------------------------------
   Info Key-Value Rows
   -------------------------------------------------------------------------- */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--color-text-muted);
  font-size: 13px;
}

.info-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.2px;
  color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   Apple Glass Floating Dock Bottom Navigation with Interactive Gliding Glass Pill
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: max(14px, var(--safe-bottom));
  left: 14px;
  right: 14px;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(22, 22, 26, 0.68);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  padding: 5px 6px;
  z-index: 60;
  touch-action: pan-x;
  user-select: none;
}

/* The interactive floating/sliding glass capsule ("стекло, которое можно юлозить") */
.dock-glass-slider {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.17);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, width;
}

.dock-glass-slider.is-dragging {
  transition: none !important; /* Immediate 60fps tracking while sliding finger */
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.nav-item {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 9999px;
  transition: color 0.18s ease, transform 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item span:not(.nav-icon) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item.active {
  color: #ffffff;
  font-weight: 600;
}

.nav-item.active .nav-icon {
  transform: translateY(-1px);
}

.nav-item svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-item.active svg {
  stroke: #ffffff;
}

/* --------------------------------------------------------------------------
   Apple Glass Segmented Switcher (Переключатель в стиле Apple)
   -------------------------------------------------------------------------- */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 3px;
  gap: 3px;
  user-select: none;
}

.segmented-btn {
  flex: 1;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: rgba(255, 255, 255, 0.60);
  border: none;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.segmented-btn.active {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.segmented-btn:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   No Group Alert Banner (doctrine component matching user mock)
   -------------------------------------------------------------------------- */
.no-group-banner {
  background: linear-gradient(135deg, #FF5514 0%, #EA3B00 100%);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 26px rgba(255, 68, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease;
  user-select: none;
}

.no-group-banner.interactive {
  cursor: pointer;
}

.no-group-banner.interactive:active {
  transform: scale(0.98);
}

.no-group-banner-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  flex-shrink: 0;
  display: block;
}

.no-group-banner-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.no-group-banner-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.18;
  letter-spacing: -0.4px;
  margin: 0;
}

.no-group-banner-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.35;
  margin-top: 5px;
  opacity: 0.96;
}

/* --------------------------------------------------------------------------
   Modal Dialog Overlay (Apple Frosted Glass)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 37, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: rgba(22, 28, 44, 0.88);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 22px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
  color: #ffffff;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.modal-close-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   Toast Notifications System
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 68px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90%;
  width: 360px;
}

.toast {
  pointer-events: auto;
  background: rgba(20, 26, 42, 0.90);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 16px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-hide {
  animation: toastOut 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   Schedule Specific Styles
   -------------------------------------------------------------------------- */
.schedule-lesson-card {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  position: relative;
  box-shadow: var(--shadow-card);
}

.schedule-lesson-card.is-current {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(135deg, rgba(16, 40, 28, 0.45) 0%, rgba(255, 255, 255, 0.045) 100%);
}

.schedule-lesson-card.is-current::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #34d399, transparent);
}

.lesson-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lesson-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.lesson-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 3px 9px;
  border-radius: var(--radius-xs);
}

.schedule-empty-slot {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}

.schedule-empty-slot:hover, .schedule-empty-slot:active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(0.99);
}

.schedule-break-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   Bell Schedule Reference Table
   -------------------------------------------------------------------------- */
.bell-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  margin-top: 12px;
}

.bell-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.bell-table th {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

.bell-table th:last-child {
  border-right: none;
}

.bell-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 11.5px;
  color: var(--color-text-primary);
}

.bell-table td:last-child {
  border-right: none;
}

.bell-table tr:last-child td {
  border-bottom: none;
}

.bell-table .num-col {
  font-weight: 800;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  width: 36px;
}

.bell-table .break-row td {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 10px;
}

/* --------------------------------------------------------------------------
   Homework & Announcements Specific Styles
   -------------------------------------------------------------------------- */
.badge-subject {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.homework-card {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  box-shadow: var(--shadow-card);
}

.homework-card.deadline-today {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, rgba(38, 20, 20, 0.6) 0%, rgba(255, 255, 255, 0.045) 100%);
}

.homework-card.deadline-today::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 60%, transparent 100%);
}

.homework-card.is-completed {
  opacity: 0.55;
  border-color: rgba(255, 255, 255, 0.04);
}

.announcement-card {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

/* --------------------------------------------------------------------------
   «Важная информация» / Закреплённые объявления
   (Благородное тёмно-серое стекло с красно-оранжевым градиентом)
   -------------------------------------------------------------------------- */
.pinned-banner,
.announcement-card.is-pinned {
  background: linear-gradient(135deg, rgba(32, 24, 26, 0.92) 0%, rgba(24, 24, 28, 0.96) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pinned-banner::before,
.announcement-card.is-pinned::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 60%, transparent 100%);
}

.pinned-banner:active,
.announcement-card.is-pinned:active {
  transform: scale(0.99);
}

.pinned-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #f97316;
  text-transform: uppercase;
}

.pinned-tag-icon {
  width: 14px;
  height: 14px;
  color: #ef4444;
  animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

/* --------------------------------------------------------------------------
   Leaders Chat Specific Styles
   -------------------------------------------------------------------------- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 480px;
  position: relative;
}

.chat-header {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chat-messages-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 14px 4px;
}

.chat-bubble-wrap {
  display: flex;
  gap: 10px;
  max-width: 86%;
}

.chat-bubble-wrap.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-wrap.theirs {
  align-self: flex-start;
}

.chat-bubble {
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-bubble.mine {
  background: #ffffff;
  color: #000000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.chat-bubble.mine .chat-bubble-footer {
  color: rgba(0, 0, 0, 0.55);
}

.chat-bubble.theirs {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble-author {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-bubble-author .author-name {
  color: #ffffff;
}

.chat-bubble-author .author-group {
  color: var(--color-text-muted);
  font-size: 10px;
}

.chat-bubble-footer {
  font-size: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  opacity: 0.65;
}

.chat-input-bar {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 6px 8px 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: #ffffff;
}

.chat-input-field::placeholder {
  color: var(--color-text-dim);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.chat-send-btn svg {
  stroke: #000000;
}

.chat-send-btn:active {
  transform: scale(0.9);
}

/* --------------------------------------------------------------------------
   Attendance Roll-Call Toggle
   -------------------------------------------------------------------------- */
.attendance-toggle-group {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.attendance-toggle-btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 7px 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-muted);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.attendance-toggle-btn.active.present {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.25);
}

.attendance-toggle-btn.active.absent {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
  box-shadow: inset 0 1px 0 rgba(248, 113, 113, 0.25);
}

.attendance-toggle-btn.active.excused {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  box-shadow: inset 0 1px 0 rgba(251, 191, 36, 0.25);
}

.attendance-toggle-btn:active {
  transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   Modal Dialogs (Apple Dark Glass)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 22, 26, 0.92);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

.modal-description {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Auth Gate Component (Apple Pitch-Black Glass)
   -------------------------------------------------------------------------- */
.auth-gate-card {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 30px auto;
  max-width: 440px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.8; }
}

/* ==========================================================================
   Animated Splash Screen (Apple Dark Glass + Mari El Student Vibes)
   ========================================================================== */
.app-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  user-select: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.app-splash-overlay.splash-fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.splash-content {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  animation: splashContentIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashContentIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-illustration-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatArtwork 3.4s ease-in-out infinite;
}

.splash-glow-ring {
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 2.8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes floatArtwork {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.splash-svg-art {
  width: 130px;
  height: 130px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

/* Steam Animation */
@keyframes steamDrift {
  0% {
    stroke-dashoffset: 70;
    opacity: 0;
    transform: translateY(4px);
  }
  25% {
    opacity: 0.85;
  }
  75% {
    opacity: 0.4;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
    transform: translateY(-9px);
  }
}

.steam-line {
  stroke-dasharray: 70;
  animation: steamDrift 2.4s ease-in-out infinite;
}

.steam-1 {
  animation-delay: 0s;
}

.steam-2 {
  animation-delay: 0.75s;
}

.steam-3 {
  animation-delay: 1.4s;
}

/* Radio waves pulse (RMT) */
@keyframes radioPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.96); }
  50% { opacity: 0.8; transform: scale(1.04); }
}

.radio-wave {
  transform-origin: 120px 70px;
  animation: radioPulse 2s ease-in-out infinite;
}

.radio-2 {
  animation-delay: 0.6s;
}

/* Sparkles blink */
@keyframes sparkleBlink {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.3); }
}

.splash-sparkle {
  animation: sparkleBlink 1.8s ease-in-out infinite;
}

.s2 { animation-delay: 0.6s; }
.s3 { animation-delay: 1.2s; }

/* Brand and Text */
.splash-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: -4px;
}

.splash-logo-img {
  height: 22px;
  width: auto;
  opacity: 0.9;
}

.splash-greeting {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  margin: 0;
  transition: opacity 0.25s ease;
}

.splash-phrase-bubble {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-phrase {
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.splash-phrase.phrase-changing {
  opacity: 0;
  transform: translateY(4px);
}

/* Minimalist Apple Progress Bar */
.splash-loader-bar {
  width: 120px;
  height: 3px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-top: 6px;
}

.splash-loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), #ffffff, rgba(255, 255, 255, 0.2));
  border-radius: 99px;
  animation: splashLoaderSlide 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes splashLoaderSlide {
  0% { left: -45%; }
  100% { left: 100%; }
}

.splash-footer-note {
  font-size: 11.5px;
  color: var(--color-text-dim);
  font-weight: 500;
  letter-spacing: 0.2px;
}


