/* ==========================================================================
   ОНЛАЙН-ШКОЛА «ОГОНЁК» - DESIGN SYSTEM & PREMIUM MOBILE RESPONSIVE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Primary Fire Palette */
  --primary: #FF5722;
  --primary-hover: #E64A19;
  --primary-light: #FBE9E7;
  --primary-glow: rgba(255, 87, 34, 0.22);
  
  --amber: #FF9800;
  --amber-light: #FFF3E0;
  --yellow-spark: #FFC107;
  --fire-red: #D84315;
  
  /* Background Palette */
  --bg-main: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #FFFDF9;
  --bg-accent: #FFF5EE;
  
  /* Text & Border Palette */
  --text-main: #2C2825;
  --text-muted: #7A726C;
  --text-light: #A39B94;
  --border-color: #EFE8DF;
  --border-hover: #FFD8C6;
  
  /* Status Colors */
  --success: #4CAF50;
  --info: #2196F3;

  /* Shadows */
  --shadow-sm: 0 4px 14px rgba(44, 40, 37, 0.05);
  --shadow-md: 0 10px 30px rgba(44, 40, 37, 0.08);
  --shadow-lg: 0 20px 50px rgba(255, 87, 34, 0.12);
  --shadow-flame: 0 10px 30px rgba(255, 87, 34, 0.3);

  /* Radius */
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

.heading-lg { font-size: 3.2rem; letter-spacing: -0.02em; }
.heading-md { font-size: 2.4rem; letter-spacing: -0.01em; }
.heading-sm { font-size: 1.6rem; }

/* Top Announcement Banner */
.announcement-bar {
  background: linear-gradient(90deg, #FF5722 0%, #FF8F00 100%);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.announcement-bar .tag {
  background: rgba(255, 255, 255, 0.25);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 12px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.logo-flame {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFE0B2 0%, #FF5722 100%);
  border-radius: 50%;
  box-shadow: var(--shadow-flame);
  overflow: hidden;
}

.logo-flame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-header-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.user-chip-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #FF7043 0%, #FF5722 100%);
  color: white;
  box-shadow: var(--shadow-flame);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(255, 87, 34, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--border-hover);
}

.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

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

.btn-danger {
  background: #FFEBEE;
  color: #D32F2F;
  border-color: #FFCDD2;
}

.btn-danger:hover {
  background: #D32F2F;
  color: white;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.88rem;
}

/* Hero Section */
.hero-section {
  padding: 70px 0 90px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.badge-tag {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
}

.badge-tag.orange {
  background: #FFEBE6;
  color: var(--primary);
  border: 1px solid #FFCCBC;
}

.badge-tag.amber {
  background: #FFF8E1;
  color: #E65100;
  border: 1px solid #FFE082;
}

.hero-title { margin-bottom: 24px; }
.hero-title span { color: var(--primary); display: inline-block; }
.hero-description { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 36px; max-width: 580px; }

.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.hero-mascot-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-mascot-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  text-align: center;
  width: 100%;
}

.mascot-image-lg {
  max-width: 440px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.floating-streak-badge {
  position: absolute;
  top: 24px;
  left: -20px;
  background: var(--bg-card);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  gap: 14px;
}

.streak-icon { font-size: 1.8rem; }
.streak-text strong { display: block; font-size: 1.05rem; color: var(--primary); }
.streak-text span { font-size: 0.85rem; color: var(--text-muted); }

/* Feature Grid Cards */
.section { padding: 90px 0; }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-subtitle { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; font-size: 0.9rem; margin-bottom: 12px; }

.feature-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 36px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 24px;
}

.card-title { font-size: 1.35rem; margin-bottom: 12px; }
.card-desc { color: var(--text-muted); font-size: 0.98rem; line-height: 1.5; }

/* Teachers Section */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.teacher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.teacher-avatar-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #FFE082, #FFB74D);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.18);
}

.teacher-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.teacher-role {
  font-size: 0.92rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 14px;
}

.teacher-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.teacher-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pricing Section */
.pricing-section {
  background: #FAF7F2;
  border-top: 1px solid var(--border-color);
}

.pricing-card-wrap {
  max-width: 540px;
  margin: 0 auto;
}

.pricing-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary);
  padding: 44px 36px;
  box-shadow: 0 12px 36px rgba(255, 107, 0, 0.12);
  position: relative;
  text-align: center;
  transition: var(--transition);
}

.pricing-card:hover {
  box-shadow: 0 16px 44px rgba(255, 107, 0, 0.18);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 18px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.35);
  white-space: nowrap;
}

.pricing-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.price-value {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.price-period {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pricing-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Application Card */
.application-section {
  background: linear-gradient(135deg, #FFF3E0 0%, #FAF7F2 100%);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 90px 0;
}

.application-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-hover);
  max-width: 860px;
  margin: 0 auto;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ==========================================================================
   AUTHENTICATED DASHBOARD & WINDOW BAR
   ========================================================================== */

.platform-window {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 720px;
}

.window-topbar {
  background: #FAF7F2;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.window-dots { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #FF5F56; }
.dot.yellow { background: #FFBD2E; }
.dot.green { background: #27C93F; }

.window-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.92rem;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* App Body Layout */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 680px;
}

.app-sidebar {
  background: #FCFAF7;
  border-right: 1px solid var(--border-color);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.app-content {
  padding: 24px 32px;
  overflow-y: auto;
  min-height: auto;
  box-sizing: border-box;
}

/* Student Dashboard Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 1.15rem;
}

.streak-widget-hero {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  border-radius: var(--radius-md);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  border: 1px solid #FFE082;
}

.streak-big-flame {
  display: flex;
  align-items: center;
  gap: 18px;
}

.streak-counter-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--fire-red);
  line-height: 1.1;
}

.streak-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.calendar-day-box {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px;
}

.calendar-day-box.completed {
  background: #FFEBE6;
  border-color: #FFAB91;
  color: var(--fire-red);
}

/* Chat Component */
.chat-box {
  display: flex;
  flex-direction: column;
  height: 520px;
  min-height: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.chat-message.self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble {
  background: var(--bg-main);
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
}

.chat-message.self .chat-bubble {
  background: var(--primary);
  color: white;
}

.chat-author {
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.chat-input-area {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  background: var(--bg-card-subtle);
  flex-shrink: 0;
}

/* ==========================================================================
   DIRECT MESSAGES & PHOTO ATTACHMENTS (STUDENT <-> TEACHER)
   ========================================================================== */

.chat-subtabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chat-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: white;
  border: 1.5px solid var(--border-color);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chat-subtab-btn:hover {
  background: var(--bg-main);
  border-color: #CBD5E1;
  color: var(--text-main);
}

.chat-subtab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

.chat-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--fire-red);
  color: white;
}

.chat-subtab-btn.active .chat-tab-badge {
  background: white;
  color: var(--fire-red);
}

/* Two-column DM layout */
.dm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 520px;
  min-height: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dm-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.dm-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: white;
  flex-shrink: 0;
}

.dm-search-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  outline: none;
  transition: var(--transition);
}

.dm-search-input:focus {
  border-color: var(--primary);
}

.dm-dialogs-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dm-dialog-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
  text-align: left;
  width: 100%;
  flex-shrink: 0;
}

.dm-dialog-card:hover {
  background: white;
  border-color: var(--border-color);
}

.dm-dialog-card.active {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.12);
}

.dm-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE082, #FFB74D);
  color: #5D4037;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.dm-dialog-info {
  flex: 1;
  min-width: 0;
}

.dm-dialog-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.dm-dialog-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-dialog-time {
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dm-dialog-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dm-dialog-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-dialog-group-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: #ECEFF1;
  color: #455A64;
  margin-bottom: 2px;
  font-weight: 600;
}

.dm-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-card);
}

.dm-conv-header {
  padding: 12px 18px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.dm-mobile-back-btn {
  display: none;
}

.dm-conv-partner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dm-student-contacts-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #FFFDF9;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  align-items: center;
  flex-shrink: 0;
}

.dm-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: white;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.dm-contact-pill:hover {
  border-color: var(--primary-light);
  background: #FFF9F5;
}

.dm-contact-pill.active {
  border-color: var(--primary);
  background: #FFF3E0;
  color: #E65100;
  font-weight: 700;
}

.dm-contact-pill-avatar {
  font-size: 0.85rem;
}

.dm-contact-pill-badge {
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.dm-conv-banner {
  padding: 10px 18px;
  background: #FFF8E1;
  border-bottom: 1px solid #FFE082;
  font-size: 0.85rem;
  color: #795548;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-messages-container {
  flex: 1 1 0%;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-main);
}

.dm-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  gap: 2px;
}

.dm-msg.self {
  align-self: flex-end;
  align-items: flex-end;
}

.dm-msg.other {
  align-self: flex-start;
  align-items: flex-start;
}

.dm-msg-bubble {
  padding: 10px 14px 6px 14px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  word-break: break-word;
  position: relative;
  min-width: 80px;
}

.dm-msg.self .dm-msg-bubble {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  border-bottom-right-radius: 4px;
}

.dm-msg.other .dm-msg-bubble {
  border-bottom-left-radius: 4px;
}

.dm-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.72rem;
  user-select: none;
  line-height: 1;
}

.dm-msg.self .dm-bubble-footer {
  color: rgba(255, 255, 255, 0.85);
}

.dm-msg.other .dm-bubble-footer {
  color: var(--text-muted);
}

.dm-status-check {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -2px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.dm-status-check.sent {
  color: rgba(255, 255, 255, 0.65);
}

.dm-status-check.read {
  color: #E0F7FA;
  text-shadow: 0 0 4px rgba(255,255,255,0.4);
}

/* Chat Photo Attachment */
.chat-photo-thumb-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 6px;
  border: 1.5px solid rgba(0,0,0,0.1);
  cursor: pointer;
  display: inline-block;
  max-width: 200px;
  background: #000;
}

.chat-photo-thumb {
  display: block;
  max-width: 100%;
  max-height: 140px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.chat-photo-thumb-wrapper:hover .chat-photo-thumb {
  transform: scale(1.03);
  opacity: 0.92;
}

.chat-photo-zoom-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Photo Upload Attachment Bar */
.chat-attachment-preview-bar {
  padding: 8px 16px;
  background: #FFF3E0;
  border-top: 1px solid #FFE0B2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeIn 0.2s ease-out;
}

.attachment-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #E65100;
}

.attachment-preview-pill img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #FFB74D;
}

.attachment-remove-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #D84315;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
}

.attachment-remove-btn:hover {
  background: rgba(216, 67, 21, 0.1);
}

.chat-btn-attach {
  background: white;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-btn-attach:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #FFF8E1;
}

/* Lightbox Modal */
.image-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 16, 14, 0.92);
  backdrop-filter: blur(10px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.lightbox-content-box {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  object-fit: contain;
}

.lightbox-topbar {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3010;
}

.lightbox-action-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  transition: var(--transition);
}

.lightbox-action-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

/* Table Responsive Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  min-width: 680px;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  vertical-align: middle;
}

.data-table th {
  background: var(--bg-main);
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Form Controls & Beautiful Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: white;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 48px !important;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  user-select: none;
}

.btn-toggle-password:hover {
  transform: scale(1.15);
  opacity: 0.85;
}


/* ==========================================================================
   ADVANCED HOMEWORK SYSTEM STYLES
   ========================================================================== */

.hw-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.hw-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.hw-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.hw-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.hw-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.hw-status-pill.pending {
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFE082;
}

.hw-status-pill.submitted {
  background: #E3F2FD;
  color: #1565C0;
  border: 1px solid #90CAF9;
}

.hw-status-pill.graded {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.hw-file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #FFF8E1;
  border: 1px dashed #FFB74D;
  border-radius: var(--radius-sm);
  color: #E65100;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 12px 0 16px;
  transition: var(--transition);
}

.hw-file-attachment:hover {
  background: #FFE082;
  transform: translateY(-1px);
}

.hw-solution-box {
  background: #FAFAFA;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-top: 16px;
}

.hw-grade-hero {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  border: 2px solid #81C784;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.hw-grade-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2E7D32;
}

.hw-feedback-quote {
  background: white;
  border-left: 4px solid #4CAF50;
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.55;
  margin-top: 10px;
}

.teacher-submission-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.teacher-submission-card.graded {
  border-color: #A5D6A7;
  background: #FAFCFA;
}

.teacher-submission-card.pending {
  border-color: #90CAF9;
  background: #FDFEFF;
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(44, 40, 37, 0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 20px;
}

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

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
}

.toast {
  background: var(--text-main);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s ease-out;
}

.toast.success { background: #2E7D32; }
.toast.fire { background: var(--fire-red); }

/* Legal & 152-FZ Styles */
.form-privacy-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

.form-privacy-note a,
.privacy-link-trigger {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.form-privacy-note a:hover,
.privacy-link-trigger:hover {
  color: var(--primary-hover);
}

.footer-legal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}

.footer-legal-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal-links a {
  color: #A39B94;
  text-decoration: underline;
}

.footer-legal-links a:hover {
  color: #FFF;
}

.footer-legal-note {
  color: #7A726C;
  font-size: 0.82rem;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 720px;
  margin: 0 auto;
  z-index: 1999;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(44, 40, 37, 0.14);
  padding: 16px 20px;
  animation: slideUpCookie 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-text-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.cookie-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.45;
  margin: 0;
}

@keyframes slideUpCookie {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 14px 16px;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .cookie-banner-inner .btn {
    width: 100%;
  }
}


/* ==========================================================================
   COMPREHENSIVE & ROBUST MOBILE RESPONSIVENESS (<= 992px & <= 768px)
   ========================================================================== */

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

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

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

@media (max-width: 992px) {
  .feature-grid-3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 768px) {
  .container, .dashboard-container {
    padding: 0 14px;
    width: 100%;
    max-width: 100%;
  }

  /* Header & Navigation */
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    min-height: auto;
    gap: 10px;
  }

  .logo {
    font-size: 1.35rem;
    gap: 8px;
  }

  .logo-flame {
    width: 36px;
    height: 36px;
  }

  #guestNav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 6px;
    scrollbar-width: none;
  }

  #guestNav::-webkit-scrollbar {
    display: none;
  }

  .nav-links {
    gap: 8px;
    white-space: nowrap;
    display: flex;
    padding: 2px;
  }

  .nav-links a {
    font-size: 0.84rem;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    display: inline-block;
  }

  .nav-links a.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }

  .header-actions {
    margin-left: auto;
  }

  .header-actions .btn {
    padding: 8px 14px;
    font-size: 0.84rem;
  }

  .announcement-bar {
    padding: 8px 12px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .announcement-bar .tag {
    font-size: 0.72rem;
    padding: 2px 8px;
  }

  /* Typography */
  .heading-lg {
    font-size: 2rem;
    letter-spacing: -0.01em;
    word-break: break-word;
  }

  .heading-md {
    font-size: 1.55rem;
    letter-spacing: -0.01em;
    word-break: break-word;
  }

  .heading-sm {
    font-size: 1.25rem;
  }

  /* Hero Section */
  .hero-section {
    padding: 32px 0 44px;
  }

  .hero-title {
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 0.98rem;
    margin-bottom: 24px;
    max-width: 100%;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-mascot-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .mascot-image-lg {
    max-width: 100%;
    width: 100%;
  }

  /* Application Section & Form */
  .application-section {
    padding: 44px 0;
  }

  .application-card {
    padding: 22px 14px;
    border-radius: var(--radius-md);
    max-width: 100%;
    width: 100%;
  }

  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    padding: 12px 14px;
  }

  /* Sections */
  .section {
    padding: 44px 0;
  }

  .section-header {
    margin-bottom: 30px;
  }

  .card {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

  .card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    margin-bottom: 16px;
  }

  .card-title {
    font-size: 1.2rem;
  }

  /* Dashboard & Admin Views */
  .dashboard-container {
    padding: 0 10px;
  }

  .platform-window {
    border-radius: var(--radius-md);
    min-height: auto;
  }

  .window-topbar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .window-user-info {
    width: 100%;
    justify-content: space-between;
  }

  .user-header-block {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .user-badge-chip {
    padding: 6px 12px;
    font-size: 0.84rem;
    max-width: 100%;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 10px;
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .app-sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-link {
    padding: 8px 14px;
    font-size: 0.84rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    flex-shrink: 0;
  }

  .app-content {
    padding: 16px 12px;
    max-height: none;
    overflow-x: hidden;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .widget-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .streak-widget-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 14px;
  }

  .streak-counter-number {
    font-size: 2.2rem;
  }

  .streak-calendar-grid {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
  }

  .streak-calendar-grid > div {
    padding: 6px 2px !important;
    min-height: 44px !important;
    font-size: 0.72rem !important;
  }

  /* Chat & DM Component on Mobile */
  .chat-box {
    height: 480px;
    max-height: calc(100vh - 180px);
  }

  .chat-messages {
    padding: 14px 10px;
    gap: 12px;
  }

  .chat-message {
    max-width: 92%;
  }

  .chat-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .chat-input-area {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat-subtabs-nav {
    gap: 6px;
    margin-bottom: 10px;
  }

  .chat-subtab-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .chat-btn-attach {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .chat-photo-thumb {
    max-height: 120px;
    max-width: 160px;
  }

  /* Two-column DM layout becomes single-column card switcher on Mobile */
  .dm-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 480px !important;
    max-height: calc(100vh - 180px) !important;
    min-height: 380px !important;
  }

  .dm-layout:not(.mobile-chat-active) .dm-sidebar {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none !important;
  }

  .dm-layout:not(.mobile-chat-active) .dm-conversation {
    display: none !important;
  }

  .dm-layout.mobile-chat-active .dm-sidebar {
    display: none !important;
  }

  .dm-layout.mobile-chat-active .dm-conversation {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }

  .dm-mobile-back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 4px 10px;
    margin-right: 6px;
    background: #F0F0F0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-main);
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    padding: 20px 14px;
    border-radius: var(--radius-md);
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
  }

  /* Tables on Mobile */
  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .data-table {
    min-width: 560px;
    font-size: 0.85rem;
  }

  .data-table th, .data-table td {
    padding: 10px 12px;
  }

  /* Footer on Mobile */
  footer {
    padding: 32px 0 !important;
    margin-top: 40px !important;
  }

  footer .container {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
    align-items: center !important;
  }
}

@media (max-width: 480px) {
  .user-header-block {
    flex-direction: column;
    align-items: stretch;
  }

  .user-header-block > button {
    width: 100%;
  }

  .modal-card {
    padding: 18px 12px;
  }

}

/* ==========================================================================
   ADMIN FUNNEL & MARKETING ANALYTICS STYLES
   ========================================================================== */
.analytics-grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.kpi-card.kpi-amber::before { background: var(--amber); }
.kpi-card.kpi-green::before { background: #2E7D32; }
.kpi-card.kpi-red::before { background: #D32F2F; }
.kpi-card.kpi-blue::before { background: #1976D2; }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  font-size: 1.3rem;
}

.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.funnel-visual-wrapper {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.funnel-step-item {
  margin-bottom: 16px;
  position: relative;
}

.funnel-step-item:last-child {
  margin-bottom: 0;
}

.funnel-step-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.funnel-step-label {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.funnel-step-stats {
  font-weight: 800;
  color: var(--primary);
}

.funnel-bar-track {
  height: 28px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.funnel-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #FF7043, #FF5722);
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 40px;
}

.funnel-bar-fill.fill-amber {
  background: linear-gradient(90deg, #FFA726, #FF9800);
}

.funnel-bar-fill.fill-green {
  background: linear-gradient(90deg, #66BB6A, #43A047);
}

.funnel-bar-fill.fill-blue {
  background: linear-gradient(90deg, #42A5F5, #1E88E5);
}

.dropoff-badge {
  font-size: 0.72rem;
  background: #FFEBEE;
  color: #C62828;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-left: 10px;
}

.event-type-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-pill-visit { background: #E0F2FE; color: #0369A1; }
.event-pill-view { background: #EDE9FE; color: #6D28D9; }
.event-pill-cta { background: #FEF3C7; color: #B45309; }
.event-pill-form { background: #FFF7ED; color: #C2410C; }
.event-pill-abandon { background: #FEE2E2; color: #B91C1C; }
.event-pill-submit { background: #DCFCE7; color: #15803D; }
.event-pill-auth { background: #F3F4F6; color: #374151; }

/* Marketing Campaigns Hub Styles */
.campaign-card-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.campaign-card-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 107, 44, 0.08);
}

.campaign-meta-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.campaign-url-box {
  background: var(--bg-main);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--primary);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.campaign-stats-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--bg-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.campaign-stat-unit {
  text-align: center;
}

.campaign-stat-val {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  line-height: 1.2;
}

.campaign-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}



