/* =========================================================
   V16 - ULTRA PREMIUM DASHBOARD
   Enterprise SaaS-grade design system
   ========================================================= */

:root {
  --xp-primary: #6366f1;
  --xp-primary-light: #818cf8;
  --xp-primary-dark: #4f46e5;
  --xp-secondary: #0ea5e9;
  --xp-success: #10b981;
  --xp-warning: #f59e0b;
  --xp-danger: #ef4444;
  --xp-info: #6366f1;
  --xp-purple: #a855f7;
  --xp-pink: #ec4899;
  --xp-orange: #f97316;
  --xp-teal: #14b8a6;
  --xp-bg: #f8fafc;
  --xp-bg-elevated: #ffffff;
  --xp-bg-subtle: #f1f5f9;
  --xp-surface: #ffffff;
  --xp-ink: #0f172a;
  --xp-ink-secondary: #475569;
  --xp-muted: #94a3b8;
  --xp-border: #e2e8f0;
  --xp-border-light: #f1f5f9;
  --xp-ring: rgba(99, 102, 241, .15);
  --xp-radius: 16px;
  --xp-radius-sm: 10px;
  --xp-radius-lg: 20px;
  --xp-radius-xl: 24px;
  --xp-shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --xp-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --xp-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --xp-shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --xp-shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --xp-shadow-xl: 0 25px 50px -12px rgba(0,0,0,.12);
  --xp-transition: all .25s cubic-bezier(.4,0,.2,1);
  --xp-transition-fast: all .15s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes xp-fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes xp-slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes xp-pulse { 0%,100% { opacity:1; } 50% { opacity:.7; } }
@keyframes xp-count { from { opacity:0; transform:scale(.8); } to { opacity:1; transform:scale(1); } }
@keyframes xp-shimmer { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }
@keyframes xp-float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }

.xp-animate { animation: xp-fadeIn .5s ease both; }
.xp-animate-delay-1 { animation-delay: .1s; }
.xp-animate-delay-2 { animation-delay: .2s; }
.xp-animate-delay-3 { animation-delay: .3s; }
.xp-animate-delay-4 { animation-delay: .4s; }

/* =========================================================
   DASHBOARD SHELL
   ========================================================= */
.xp-dashboard {
  --xp-accent: var(--xp-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--xp-bg);
  min-height: 100vh;
  color: var(--xp-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   WELCOME HERO
   ========================================================= */
.xp-hero {
  position: relative;
  border-radius: var(--xp-radius-xl);
  padding: 32px 36px;
  margin-bottom: 28px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 35%, #7c3aed 70%, #a855f7 100%);
  box-shadow: 0 20px 40px rgba(99,102,241,.25);
}

.xp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .5;
}

.xp-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
}

.xp-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.xp-hero-main {
  flex: 1;
  min-width: 0;
}

.xp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.12);
}

.xp-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.xp-hero-desc {
  margin: 0;
  font-size: .92rem;
  line-height: 1.65;
  color: rgba(255,255,255,.82);
  max-width: 520px;
}

.xp-hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.xp-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  min-width: 260px;
}

.xp-hero-stat {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--xp-radius-sm);
  padding: 16px;
  text-align: center;
  transition: var(--xp-transition-fast);
}

.xp-hero-stat:hover {
  background: rgba(255,255,255,.16);
  transform: translateY(-2px);
}

.xp-hero-stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}

.xp-hero-stat-label {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* =========================================================
   STAT CARDS - PREMIUM
   ========================================================= */
.xp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.xp-stat {
  background: var(--xp-surface);
  border: 1px solid var(--xp-border);
  border-radius: var(--xp-radius);
  padding: 22px;
  box-shadow: var(--xp-shadow-xs);
  transition: var(--xp-transition);
  position: relative;
  overflow: hidden;
}

.xp-stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  transition: height .25s ease;
}

.xp-stat:hover {
  box-shadow: var(--xp-shadow-md);
  transform: translateY(-3px);
  border-color: transparent;
}

.xp-stat:hover::after {
  height: 4px;
}

.xp-stat--indigo::after { background: linear-gradient(90deg, #6366f1, #818cf8); }
.xp-stat--sky::after { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.xp-stat--emerald::after { background: linear-gradient(90deg, #10b981, #34d399); }
.xp-stat--amber::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.xp-stat--rose::after { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.xp-stat--purple::after { background: linear-gradient(90deg, #a855f7, #c084fc); }
.xp-stat--teal::after { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.xp-stat--orange::after { background: linear-gradient(90deg, #f97316, #fb923c); }

.xp-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.xp-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.xp-stat--indigo .xp-stat-icon { background: #eef2ff; color: #6366f1; }
.xp-stat--sky .xp-stat-icon { background: #f0f9ff; color: #0ea5e9; }
.xp-stat--emerald .xp-stat-icon { background: #ecfdf5; color: #10b981; }
.xp-stat--amber .xp-stat-icon { background: #fffbeb; color: #f59e0b; }
.xp-stat--rose .xp-stat-icon { background: #fff1f2; color: #f43f5e; }
.xp-stat--purple .xp-stat-icon { background: #faf5ff; color: #a855f7; }
.xp-stat--teal .xp-stat-icon { background: #f0fdfa; color: #14b8a6; }
.xp-stat--orange .xp-stat-icon { background: #fff7ed; color: #f97316; }

.xp-stat-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
}

.xp-stat-trend--up { background: #ecfdf5; color: #059669; }
.xp-stat-trend--down { background: #fff1f2; color: #e11d48; }
.xp-stat-trend--neutral { background: #f1f5f9; color: #64748b; }

.xp-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--xp-ink);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.03em;
}

.xp-stat-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--xp-muted);
}

/* =========================================================
   ACTION CARDS / SHORTCUTS
   ========================================================= */
.xp-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.xp-action {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--xp-surface);
  border: 1px solid var(--xp-border);
  border-radius: var(--xp-radius);
  padding: 20px;
  box-shadow: var(--xp-shadow-xs);
  text-decoration: none;
  color: inherit;
  transition: var(--xp-transition);
  cursor: pointer;
}

.xp-action:hover {
  box-shadow: var(--xp-shadow-md);
  transform: translateY(-3px);
  border-color: var(--xp-primary);
}

.xp-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  color: #fff;
}

.xp-action--indigo .xp-action-icon { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 4px 12px rgba(99,102,241,.25); }
.xp-action--sky .xp-action-icon { background: linear-gradient(135deg, #0ea5e9, #38bdf8); box-shadow: 0 4px 12px rgba(14,165,233,.25); }
.xp-action--emerald .xp-action-icon { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 4px 12px rgba(16,185,129,.25); }
.xp-action--amber .xp-action-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 4px 12px rgba(245,158,11,.25); }
.xp-action--rose .xp-action-icon { background: linear-gradient(135deg, #f43f5e, #fb7185); box-shadow: 0 4px 12px rgba(244,63,94,.25); }
.xp-action--purple .xp-action-icon { background: linear-gradient(135deg, #a855f7, #c084fc); box-shadow: 0 4px 12px rgba(168,85,247,.25); }
.xp-action--teal .xp-action-icon { background: linear-gradient(135deg, #14b8a6, #2dd4bf); box-shadow: 0 4px 12px rgba(20,184,166,.25); }
.xp-action--orange .xp-action-icon { background: linear-gradient(135deg, #f97316, #fb923c); box-shadow: 0 4px 12px rgba(249,115,22,.25); }

.xp-action-body h4 {
  margin: 0 0 4px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--xp-ink);
}

.xp-action-body p {
  margin: 0;
  font-size: .76rem;
  color: var(--xp-muted);
  line-height: 1.45;
}

/* =========================================================
   PANELS
   ========================================================= */
.xp-panel {
  background: var(--xp-surface);
  border: 1px solid var(--xp-border);
  border-radius: var(--xp-radius);
  box-shadow: var(--xp-shadow-xs);
  overflow: hidden;
  transition: var(--xp-transition);
  margin-bottom: 20px;
}

.xp-panel:hover {
  box-shadow: var(--xp-shadow);
}

.xp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--xp-border-light);
}

.xp-panel-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--xp-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-panel-header p {
  margin: 3px 0 0;
  font-size: .76rem;
  color: var(--xp-muted);
}

.xp-panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-panel-body {
  padding: 20px 24px;
}

.xp-panel-body--tight {
  padding: 0;
}

.xp-panel-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--xp-border-light);
  background: var(--xp-bg-subtle);
}

/* =========================================================
   GRID SYSTEM
   ========================================================= */
.xp-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.xp-grid--2 { grid-template-columns: repeat(2, 1fr); }
.xp-grid--3 { grid-template-columns: repeat(3, 1fr); }
.xp-grid--4 { grid-template-columns: repeat(4, 1fr); }
.xp-grid--2-1 { grid-template-columns: 2fr 1fr; }
.xp-grid--1-2 { grid-template-columns: 1fr 2fr; }

/* =========================================================
   LIST SYSTEM
   ========================================================= */
.xp-list { display: flex; flex-direction: column; }

.xp-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--xp-border-light);
  transition: background .15s ease;
}

.xp-list-item:last-child { border-bottom: none; }
.xp-list-item:hover { background: var(--xp-bg-subtle); }

.xp-list-item-main { flex: 1; min-width: 0; }

.xp-list-item-main strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--xp-ink);
  margin-bottom: 3px;
}

.xp-list-item-main span {
  font-size: .76rem;
  color: var(--xp-muted);
}

.xp-list-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* =========================================================
   BADGES
   ========================================================= */
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.xp-badge--indigo { background: #eef2ff; color: #6366f1; }
.xp-badge--sky { background: #f0f9ff; color: #0ea5e9; }
.xp-badge--emerald { background: #ecfdf5; color: #059669; }
.xp-badge--amber { background: #fffbeb; color: #d97706; }
.xp-badge--rose { background: #fff1f2; color: #e11d48; }
.xp-badge--purple { background: #faf5ff; color: #a855f7; }
.xp-badge--teal { background: #f0fdfa; color: #0d9488; }
.xp-badge--orange { background: #fff7ed; color: #ea580c; }
.xp-badge--slate { background: #f1f5f9; color: #475569; }

/* =========================================================
   BUTTONS
   ========================================================= */
.xp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--xp-radius-sm);
  border: none;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--xp-transition-fast);
  min-height: 40px;
  white-space: nowrap;
  font-family: inherit;
}

.xp-btn--primary {
  background: linear-gradient(135deg, var(--xp-primary), var(--xp-primary-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.2);
}

.xp-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,.28);
}

.xp-btn--secondary {
  background: var(--xp-bg-subtle);
  color: var(--xp-ink-secondary);
  border: 1px solid var(--xp-border);
}

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

.xp-btn--success {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.2);
}

.xp-btn--success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16,185,129,.28);
}

.xp-btn--danger {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244,63,94,.2);
}

.xp-btn--ghost {
  background: transparent;
  color: var(--xp-muted);
  padding: 8px 12px;
}

.xp-btn--ghost:hover {
  background: var(--xp-bg-subtle);
  color: var(--xp-ink);
}

.xp-btn--sm {
  padding: 6px 12px;
  font-size: .72rem;
  min-height: 34px;
}

.xp-btn--lg {
  padding: 12px 24px;
  font-size: .9rem;
  min-height: 48px;
}

.xp-btn--block { width: 100%; }

/* =========================================================
   PROGRESS
   ========================================================= */
.xp-progress {
  height: 8px;
  background: var(--xp-bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.xp-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.xp-progress--indigo .xp-progress-bar { background: linear-gradient(90deg, #6366f1, #818cf8); }
.xp-progress--emerald .xp-progress-bar { background: linear-gradient(90deg, #10b981, #34d399); }
.xp-progress--amber .xp-progress-bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.xp-progress--rose .xp-progress-bar { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.xp-progress--sky .xp-progress-bar { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

/* =========================================================
   WEAK TOPICS / CHART ROWS
   ========================================================= */
.xp-chart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--xp-border-light);
}

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

.xp-chart-label {
  flex: 1;
  font-size: .84rem;
  font-weight: 600;
  color: var(--xp-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xp-chart-bar {
  width: 100px;
  height: 8px;
  background: var(--xp-bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.xp-chart-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.xp-chart-value {
  font-size: .8rem;
  font-weight: 800;
  color: var(--xp-ink);
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* =========================================================
   STUDY PLAN / TIMELINE
   ========================================================= */
.xp-plan-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--xp-border-light);
}

.xp-plan-item:last-child { border-bottom: none; }

.xp-plan-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--xp-primary), var(--xp-primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

.xp-plan-text strong {
  display: block;
  font-size: .86rem;
  font-weight: 700;
  color: var(--xp-ink);
  margin-bottom: 3px;
}

.xp-plan-text span {
  font-size: .76rem;
  color: var(--xp-muted);
}

/* =========================================================
   RESULT CHIP
   ========================================================= */
.xp-result-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
}

.xp-result-chip--high { background: #ecfdf5; color: #059669; }
.xp-result-chip--mid { background: #fffbeb; color: #d97706; }
.xp-result-chip--low { background: #fff1f2; color: #e11d48; }

/* =========================================================
   SUBJECT PILLS
   ========================================================= */
.xp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--xp-bg-subtle);
  border: 1px solid var(--xp-border);
  font-size: .78rem;
  font-weight: 600;
  color: var(--xp-ink-secondary);
  transition: var(--xp-transition-fast);
}

.xp-pill:hover {
  background: #eef2ff;
  border-color: var(--xp-primary);
  color: var(--xp-primary);
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.xp-empty {
  padding: 48px 24px;
  text-align: center;
}

.xp-empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: .35;
  animation: xp-float 3s ease-in-out infinite;
}

.xp-empty h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--xp-ink);
}

.xp-empty p {
  margin: 0;
  font-size: .84rem;
  color: var(--xp-muted);
  line-height: 1.55;
}

/* =========================================================
   TABLE
   ========================================================= */
.xp-table {
  width: 100%;
  border-collapse: collapse;
}

.xp-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--xp-muted);
  background: var(--xp-bg-subtle);
  border-bottom: 1px solid var(--xp-border);
}

.xp-table td {
  padding: 14px 24px;
  font-size: .84rem;
  border-bottom: 1px solid var(--xp-border-light);
  color: var(--xp-ink-secondary);
}

.xp-table tr:last-child td { border-bottom: none; }
.xp-table tbody tr { transition: background .15s ease; }
.xp-table tbody tr:hover td { background: var(--xp-bg-subtle); }

.xp-table strong { color: var(--xp-ink); font-weight: 700; }

/* =========================================================
   QUICK INFO ROW
   ========================================================= */
.xp-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--xp-border-light);
}

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

.xp-info-label {
  font-size: .8rem;
  color: var(--xp-muted);
  flex: 1;
}

.xp-info-value {
  font-size: .84rem;
  font-weight: 700;
  color: var(--xp-ink);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .xp-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .xp-actions { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .xp-grid--2, .xp-grid--3, .xp-grid--4, .xp-grid--2-1, .xp-grid--1-2 { grid-template-columns: 1fr; }
  .xp-hero-stats { min-width: auto; width: 100%; }
}

@media (max-width: 640px) {
  .xp-hero { padding: 22px; border-radius: var(--xp-radius); margin-bottom: 18px; }
  .xp-hero h1 { font-size: 1.35rem; }
  .xp-hero-desc { font-size: .85rem; }
  .xp-hero-cta { flex-direction: column; }
  .xp-hero-cta .xp-btn { width: 100%; }
  .xp-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .xp-hero-stat { padding: 12px; }
  .xp-hero-stat-value { font-size: 1.35rem; }
  .xp-stats { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .xp-stat { padding: 18px; }
  .xp-actions { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .xp-action { flex-direction: row; align-items: center; min-height: auto; padding: 16px; }
  .xp-action-icon { margin-bottom: 0; width: 42px; height: 42px; font-size: 1.1rem; }
  .xp-panel-header { padding: 14px 16px; }
  .xp-panel-body { padding: 16px; }
  .xp-list-item { padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .xp-list-item-actions { width: 100%; }
  .xp-list-item-actions .xp-btn { flex: 1; }
  .xp-chart-bar { width: 70px; }
  .xp-table th, .xp-table td { padding: 10px 14px; font-size: .78rem; }
  .xp-btn { min-height: 44px; padding: 10px 16px; }
  .xp-stat-value { font-size: 1.6rem; }
}

/* =========================================================
   V18 ULTRA PREMIUM APP SHELL
   Student, teacher, institute and parent app pages only.
   ========================================================= */
body.yc-app-role:not(.yc-role-admin),
body.yc-portal-shell.yc-role-parent {
  --app-ink: #07111f;
  --app-muted: #5b6574;
  --app-line: rgba(11, 24, 42, .1);
  --app-panel: rgba(255, 255, 255, .94);
  --app-panel-strong: #ffffff;
  --app-sky: #0ea5e9;
  --app-green: #10b981;
  --app-amber: #f59e0b;
  --app-rose: #f43f5e;
  --app-shadow: 0 18px 46px rgba(15, 23, 42, .1);
  color: var(--app-ink);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, .96) 0%, rgba(244, 253, 249, .94) 45%, rgba(255, 247, 237, .94) 100%);
}

body.yc-app-role:not(.yc-role-admin) .main-layout,
body.yc-portal-shell.yc-role-parent .main-layout {
  background: transparent;
}

body.yc-app-role:not(.yc-role-admin) .content,
body.yc-portal-shell.yc-role-parent .content {
  background: transparent;
}

body.yc-app-role:not(.yc-role-admin) .xp-dashboard,
body.yc-portal-shell.yc-role-parent .xp-dashboard {
  background: transparent;
}

body.yc-app-role:not(.yc-role-admin) .xp-hero,
body.yc-portal-shell.yc-role-parent .xp-hero,
body.yc-app-role:not(.yc-role-admin) .page-hero-card,
body.yc-portal-shell.yc-role-parent .page-hero-card {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(7, 17, 31, .98) 0%, rgba(15, 72, 90, .96) 52%, rgba(17, 94, 89, .94) 100%);
  box-shadow: 0 24px 64px rgba(7, 17, 31, .2);
  overflow: hidden;
}

body.yc-app-role:not(.yc-role-admin) .xp-hero h1,
body.yc-app-role:not(.yc-role-admin) .xp-hero h2,
body.yc-app-role:not(.yc-role-admin) .page-hero-card h1,
body.yc-app-role:not(.yc-role-admin) .page-hero-card h2,
body.yc-portal-shell.yc-role-parent .xp-hero h1,
body.yc-portal-shell.yc-role-parent .xp-hero h2,
body.yc-portal-shell.yc-role-parent .page-hero-card h1,
body.yc-portal-shell.yc-role-parent .page-hero-card h2 {
  color: #fff;
  letter-spacing: 0;
}

body.yc-app-role:not(.yc-role-admin) .xp-hero-desc,
body.yc-app-role:not(.yc-role-admin) .page-hero-card p,
body.yc-portal-shell.yc-role-parent .xp-hero-desc,
body.yc-portal-shell.yc-role-parent .page-hero-card p {
  color: rgba(255, 255, 255, .78);
}

body.yc-app-role:not(.yc-role-admin) .xp-panel,
body.yc-app-role:not(.yc-role-admin) .xp-stat,
body.yc-app-role:not(.yc-role-admin) .xp-action,
body.yc-app-role:not(.yc-role-admin) .card,
body.yc-app-role:not(.yc-role-admin) .table-card,
body.yc-portal-shell.yc-role-parent .xp-panel,
body.yc-portal-shell.yc-role-parent .xp-stat,
body.yc-portal-shell.yc-role-parent .xp-action,
body.yc-portal-shell.yc-role-parent .card,
body.yc-portal-shell.yc-role-parent .table-card {
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--app-panel);
  box-shadow: var(--app-shadow);
}

body.yc-app-role:not(.yc-role-admin) .xp-panel-header,
body.yc-app-role:not(.yc-role-admin) .table-card .card-header,
body.yc-portal-shell.yc-role-parent .xp-panel-header,
body.yc-portal-shell.yc-role-parent .table-card .card-header {
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(248, 250, 252, .72));
}

body.yc-app-role:not(.yc-role-admin) .xp-stat:nth-child(4n+1),
body.yc-portal-shell.yc-role-parent .xp-stat:nth-child(4n+1) { border-top: 3px solid var(--app-sky); }
body.yc-app-role:not(.yc-role-admin) .xp-stat:nth-child(4n+2),
body.yc-portal-shell.yc-role-parent .xp-stat:nth-child(4n+2) { border-top: 3px solid var(--app-green); }
body.yc-app-role:not(.yc-role-admin) .xp-stat:nth-child(4n+3),
body.yc-portal-shell.yc-role-parent .xp-stat:nth-child(4n+3) { border-top: 3px solid var(--app-amber); }
body.yc-app-role:not(.yc-role-admin) .xp-stat:nth-child(4n+4),
body.yc-portal-shell.yc-role-parent .xp-stat:nth-child(4n+4) { border-top: 3px solid var(--app-rose); }

body.yc-app-role:not(.yc-role-admin) .xp-stat-label,
body.yc-app-role:not(.yc-role-admin) .xp-panel-subtitle,
body.yc-portal-shell.yc-role-parent .xp-stat-label,
body.yc-portal-shell.yc-role-parent .xp-panel-subtitle {
  color: var(--app-muted);
}

body.yc-app-role:not(.yc-role-admin) .xp-action,
body.yc-portal-shell.yc-role-parent .xp-action {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

body.yc-app-role:not(.yc-role-admin) .xp-action:hover,
body.yc-portal-shell.yc-role-parent .xp-action:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, .28);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
}

body.yc-app-role:not(.yc-role-admin) .xp-action-icon,
body.yc-portal-shell.yc-role-parent .xp-action-icon {
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .16), rgba(16, 185, 129, .16));
  color: #075985;
}

body.yc-app-role:not(.yc-role-admin) .xp-btn,
body.yc-app-role:not(.yc-role-admin) .btn,
body.yc-portal-shell.yc-role-parent .xp-btn,
body.yc-portal-shell.yc-role-parent .btn {
  border-radius: 10px;
  font-weight: 800;
}

body.yc-app-role:not(.yc-role-admin) .xp-btn-primary,
body.yc-app-role:not(.yc-role-admin) .btn-primary,
body.yc-portal-shell.yc-role-parent .xp-btn-primary,
body.yc-portal-shell.yc-role-parent .btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  box-shadow: 0 12px 26px rgba(14, 165, 233, .22);
}

body.yc-app-role:not(.yc-role-admin) .xp-list-item,
body.yc-portal-shell.yc-role-parent .xp-list-item {
  border-bottom-color: rgba(15, 23, 42, .07);
}

body.yc-app-role:not(.yc-role-admin) .xp-table,
body.yc-app-role:not(.yc-role-admin) table,
body.yc-portal-shell.yc-role-parent .xp-table,
body.yc-portal-shell.yc-role-parent table {
  border-collapse: separate;
  border-spacing: 0;
}

body.yc-app-role:not(.yc-role-admin) .xp-table th,
body.yc-portal-shell.yc-role-parent .xp-table th {
  color: #334155;
  background: #f8fafc;
}

@media (max-width: 920px) {
  body.yc-app-role:not(.yc-role-admin),
  body.yc-portal-shell.yc-role-parent {
    padding-top: 64px;
    padding-bottom: 78px;
    background:
      linear-gradient(160deg, #eff6ff 0%, #f0fdf4 52%, #fff7ed 100%);
  }

  body.yc-app-role:not(.yc-role-admin) .mobile-topbar,
  body.yc-portal-shell.yc-role-parent .mobile-topbar {
    border: 1px solid rgba(255, 255, 255, .56);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.yc-app-role:not(.yc-role-admin) .mobile-topbar .brand-logo,
  body.yc-portal-shell.yc-role-parent .mobile-topbar .brand-logo {
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    color: #fff;
  }

  body.yc-app-role:not(.yc-role-admin) .content,
  body.yc-portal-shell.yc-role-parent .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-hero,
  body.yc-app-role:not(.yc-role-admin) .page-hero-card,
  body.yc-portal-shell.yc-role-parent .xp-hero,
  body.yc-portal-shell.yc-role-parent .page-hero-card {
    border-radius: 16px;
    padding: 18px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-panel,
  body.yc-app-role:not(.yc-role-admin) .xp-stat,
  body.yc-app-role:not(.yc-role-admin) .xp-action,
  body.yc-app-role:not(.yc-role-admin) .card,
  body.yc-app-role:not(.yc-role-admin) .table-card,
  body.yc-portal-shell.yc-role-parent .xp-panel,
  body.yc-portal-shell.yc-role-parent .xp-stat,
  body.yc-portal-shell.yc-role-parent .xp-action,
  body.yc-portal-shell.yc-role-parent .card,
  body.yc-portal-shell.yc-role-parent .table-card {
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
  }

  body.yc-app-role:not(.yc-role-admin) .bottom-nav,
  body.yc-portal-shell.yc-role-parent .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    border: 1px solid rgba(255, 255, 255, .56);
    border-radius: 16px;
    background: rgba(7, 17, 31, .92);
    box-shadow: 0 18px 46px rgba(7, 17, 31, .28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.yc-app-role:not(.yc-role-admin) .bottom-nav a,
  body.yc-portal-shell.yc-role-parent .bottom-nav a {
    color: rgba(255, 255, 255, .68);
  }

  body.yc-app-role:not(.yc-role-admin) .bottom-nav a.is-active,
  body.yc-portal-shell.yc-role-parent .bottom-nav a.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(14, 165, 233, .28), rgba(16, 185, 129, .28));
  }
}

/* =========================================================
   V19 COMPACT APP CARDS
   Mobile cards should fit their text, not feel like wide web panels.
   ========================================================= */
@media (max-width: 920px) {
  body.yc-app-role:not(.yc-role-admin) .content,
  body.yc-portal-shell.yc-role-parent .content {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-dashboard,
  body.yc-portal-shell.yc-role-parent .xp-dashboard {
    gap: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-hero,
  body.yc-app-role:not(.yc-role-admin) .page-hero-card,
  body.yc-app-role:not(.yc-role-admin) .student-hero-card,
  body.yc-app-role:not(.yc-role-admin) .role-hero,
  body.yc-portal-shell.yc-role-parent .xp-hero,
  body.yc-portal-shell.yc-role-parent .page-hero-card,
  body.yc-portal-shell.yc-role-parent .student-hero-card,
  body.yc-portal-shell.yc-role-parent .role-hero {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-hero h1,
  body.yc-app-role:not(.yc-role-admin) .xp-hero h2,
  body.yc-app-role:not(.yc-role-admin) .page-hero-card h1,
  body.yc-app-role:not(.yc-role-admin) .page-head h1,
  body.yc-app-role:not(.yc-role-admin) .student-hero-card h1,
  body.yc-app-role:not(.yc-role-admin) .role-hero h1,
  body.yc-portal-shell.yc-role-parent .xp-hero h1,
  body.yc-portal-shell.yc-role-parent .xp-hero h2,
  body.yc-portal-shell.yc-role-parent .page-hero-card h1,
  body.yc-portal-shell.yc-role-parent .page-head h1,
  body.yc-portal-shell.yc-role-parent .student-hero-card h1,
  body.yc-portal-shell.yc-role-parent .role-hero h1 {
    font-size: 1.12rem;
    line-height: 1.18;
    margin: 0 0 5px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-hero-desc,
  body.yc-app-role:not(.yc-role-admin) .page-hero-card p,
  body.yc-app-role:not(.yc-role-admin) .page-head p,
  body.yc-app-role:not(.yc-role-admin) .student-hero-card p,
  body.yc-app-role:not(.yc-role-admin) .role-hero p,
  body.yc-portal-shell.yc-role-parent .xp-hero-desc,
  body.yc-portal-shell.yc-role-parent .page-hero-card p,
  body.yc-portal-shell.yc-role-parent .page-head p,
  body.yc-portal-shell.yc-role-parent .student-hero-card p,
  body.yc-portal-shell.yc-role-parent .role-hero p {
    font-size: .78rem;
    line-height: 1.35;
    margin: 0;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stats,
  body.yc-app-role:not(.yc-role-admin) .stats-grid,
  body.yc-app-role:not(.yc-role-admin) .role-kpi-grid,
  body.yc-app-role:not(.yc-role-admin) .myexam-kpis,
  body.yc-portal-shell.yc-role-parent .xp-stats,
  body.yc-portal-shell.yc-role-parent .stats-grid,
  body.yc-portal-shell.yc-role-parent .role-kpi-grid,
  body.yc-portal-shell.yc-role-parent .myexam-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-actions,
  body.yc-app-role:not(.yc-role-admin) .action-grid,
  body.yc-app-role:not(.yc-role-admin) .role-action-grid,
  body.yc-portal-shell.yc-role-parent .xp-actions,
  body.yc-portal-shell.yc-role-parent .action-grid,
  body.yc-portal-shell.yc-role-parent .role-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-bottom: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat,
  body.yc-app-role:not(.yc-role-admin) .stats-card,
  body.yc-app-role:not(.yc-role-admin) .role-kpi,
  body.yc-app-role:not(.yc-role-admin) .myexam-kpi,
  body.yc-portal-shell.yc-role-parent .xp-stat,
  body.yc-portal-shell.yc-role-parent .stats-card,
  body.yc-portal-shell.yc-role-parent .role-kpi,
  body.yc-portal-shell.yc-role-parent .myexam-kpi {
    min-height: auto;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat-top,
  body.yc-portal-shell.yc-role-parent .xp-stat-top {
    gap: 6px;
    margin-bottom: 7px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat-icon,
  body.yc-portal-shell.yc-role-parent .xp-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: .9rem;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat-trend,
  body.yc-portal-shell.yc-role-parent .xp-stat-trend {
    padding: 3px 6px;
    font-size: .58rem;
    line-height: 1.1;
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat-value,
  body.yc-app-role:not(.yc-role-admin) .stats-card h3,
  body.yc-app-role:not(.yc-role-admin) .role-kpi strong,
  body.yc-app-role:not(.yc-role-admin) .myexam-kpi strong,
  body.yc-portal-shell.yc-role-parent .xp-stat-value,
  body.yc-portal-shell.yc-role-parent .stats-card h3,
  body.yc-portal-shell.yc-role-parent .role-kpi strong,
  body.yc-portal-shell.yc-role-parent .myexam-kpi strong {
    font-size: 1.18rem;
    line-height: 1.05;
    margin: 0;
    overflow-wrap: anywhere;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-stat-label,
  body.yc-app-role:not(.yc-role-admin) .stats-card p,
  body.yc-app-role:not(.yc-role-admin) .role-kpi span,
  body.yc-app-role:not(.yc-role-admin) .myexam-kpi span,
  body.yc-portal-shell.yc-role-parent .xp-stat-label,
  body.yc-portal-shell.yc-role-parent .stats-card p,
  body.yc-portal-shell.yc-role-parent .role-kpi span,
  body.yc-portal-shell.yc-role-parent .myexam-kpi span {
    font-size: .68rem;
    line-height: 1.2;
    margin-top: 4px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-action,
  body.yc-app-role:not(.yc-role-admin) .action-tile,
  body.yc-app-role:not(.yc-role-admin) .role-action,
  body.yc-portal-shell.yc-role-parent .xp-action,
  body.yc-portal-shell.yc-role-parent .action-tile,
  body.yc-portal-shell.yc-role-parent .role-action {
    min-height: auto;
    padding: 10px;
    border-radius: 10px;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
  }

  body.yc-app-role:not(.yc-role-admin) .xp-action-icon,
  body.yc-portal-shell.yc-role-parent .xp-action-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 9px;
    font-size: .86rem;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-action-body h4,
  body.yc-app-role:not(.yc-role-admin) .action-tile h4,
  body.yc-app-role:not(.yc-role-admin) .role-action strong,
  body.yc-portal-shell.yc-role-parent .xp-action-body h4,
  body.yc-portal-shell.yc-role-parent .action-tile h4,
  body.yc-portal-shell.yc-role-parent .role-action strong {
    font-size: .82rem;
    line-height: 1.18;
    margin: 0 0 3px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-action-body p,
  body.yc-app-role:not(.yc-role-admin) .action-tile p,
  body.yc-app-role:not(.yc-role-admin) .role-action span,
  body.yc-portal-shell.yc-role-parent .xp-action-body p,
  body.yc-portal-shell.yc-role-parent .action-tile p,
  body.yc-portal-shell.yc-role-parent .role-action span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .68rem;
    line-height: 1.25;
    margin: 0;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-panel,
  body.yc-app-role:not(.yc-role-admin) .card,
  body.yc-app-role:not(.yc-role-admin) .table-card,
  body.yc-app-role:not(.yc-role-admin) .list-card,
  body.yc-app-role:not(.yc-role-admin) .student-highlight-card,
  body.yc-portal-shell.yc-role-parent .xp-panel,
  body.yc-portal-shell.yc-role-parent .card,
  body.yc-portal-shell.yc-role-parent .table-card,
  body.yc-portal-shell.yc-role-parent .list-card,
  body.yc-portal-shell.yc-role-parent .student-highlight-card {
    padding: 11px;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
  }

  body.yc-app-role:not(.yc-role-admin) .xp-panel-header,
  body.yc-app-role:not(.yc-role-admin) .xp-panel-body,
  body.yc-portal-shell.yc-role-parent .xp-panel-header,
  body.yc-portal-shell.yc-role-parent .xp-panel-body {
    padding: 10px;
  }

  body.yc-app-role:not(.yc-role-admin) .xp-list-item,
  body.yc-app-role:not(.yc-role-admin) .list-item,
  body.yc-app-role:not(.yc-role-admin) .notice-item,
  body.yc-app-role:not(.yc-role-admin) .child-card,
  body.yc-app-role:not(.yc-role-admin) .myexam-card,
  body.yc-portal-shell.yc-role-parent .xp-list-item,
  body.yc-portal-shell.yc-role-parent .list-item,
  body.yc-portal-shell.yc-role-parent .notice-item,
  body.yc-portal-shell.yc-role-parent .child-card,
  body.yc-portal-shell.yc-role-parent .myexam-card {
    padding: 10px;
    border-radius: 10px;
    gap: 7px;
    box-shadow: none;
  }

  body.yc-app-role:not(.yc-role-admin) .section-heading h2,
  body.yc-app-role:not(.yc-role-admin) .section-head-row h2,
  body.yc-app-role:not(.yc-role-admin) .xp-panel-title,
  body.yc-app-role:not(.yc-role-admin) .card h2,
  body.yc-app-role:not(.yc-role-admin) .card h3,
  body.yc-portal-shell.yc-role-parent .section-heading h2,
  body.yc-portal-shell.yc-role-parent .section-head-row h2,
  body.yc-portal-shell.yc-role-parent .xp-panel-title,
  body.yc-portal-shell.yc-role-parent .card h2,
  body.yc-portal-shell.yc-role-parent .card h3 {
    font-size: .95rem;
    line-height: 1.18;
    margin: 0 0 4px;
  }

  body.yc-app-role:not(.yc-role-admin) .badge,
  body.yc-app-role:not(.yc-role-admin) .pill,
  body.yc-portal-shell.yc-role-parent .badge,
  body.yc-portal-shell.yc-role-parent .pill {
    padding: 4px 7px;
    font-size: .62rem;
    line-height: 1.1;
  }
}

@media (max-width: 360px) {
  body.yc-app-role:not(.yc-role-admin) .xp-actions,
  body.yc-app-role:not(.yc-role-admin) .action-grid,
  body.yc-app-role:not(.yc-role-admin) .role-action-grid,
  body.yc-portal-shell.yc-role-parent .xp-actions,
  body.yc-portal-shell.yc-role-parent .action-grid,
  body.yc-portal-shell.yc-role-parent .role-action-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Desktop "Mobile View" preview uses a narrow body, so mirror app layout even when viewport is wide. */
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) {
  padding-top: 0;
  padding-bottom: 78px;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .main-layout {
  width: min(100% - 16px, 430px) !important;
  margin: 8px auto 92px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .content {
  gap: 10px !important;
  padding: 0 0 8px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-dashboard {
  gap: 10px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero {
  padding: 14px !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-inner {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero h1 {
  font-size: 1.25rem !important;
  line-height: 1.12 !important;
  margin: 6px 0 !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-desc {
  font-size: .78rem !important;
  line-height: 1.35 !important;
  max-width: 30ch !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-cta {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-cta .xp-btn {
  min-height: 38px !important;
  padding: 8px 9px !important;
  font-size: .72rem !important;
  border-radius: 9px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-stats {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-stat {
  min-height: auto !important;
  padding: 9px !important;
  border-radius: 9px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-stat-value {
  font-size: 1.05rem !important;
  line-height: 1.05 !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-hero-stat-label {
  font-size: .58rem !important;
  line-height: 1.1 !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stats,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-actions,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .stats-grid,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .action-grid,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-kpi-grid,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-action-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 10px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-action,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .stats-card,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-kpi,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-action,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .action-tile {
  min-height: auto !important;
  padding: 10px !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat-top {
  gap: 6px !important;
  margin-bottom: 7px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat-icon,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-action-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 9px !important;
  font-size: .86rem !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat-trend {
  max-width: 76px !important;
  padding: 3px 6px !important;
  font-size: .56rem !important;
  line-height: 1.1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat-value {
  font-size: 1.14rem !important;
  line-height: 1.05 !important;
  margin: 0 !important;
  overflow-wrap: anywhere !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-stat-label {
  font-size: .66rem !important;
  line-height: 1.18 !important;
  margin-top: 4px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-action {
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-action-body h4,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .action-tile h4,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-action strong {
  font-size: .82rem !important;
  line-height: 1.18 !important;
  margin: 0 0 3px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-action-body p,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .action-tile p,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .role-action span {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: .68rem !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-panel,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .card,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .table-card {
  padding: 11px !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-panel-header,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-panel-body {
  padding: 10px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-pills {
  gap: 6px !important;
}

body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .xp-pill,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .badge,
body.yc-mobile-preview.yc-app-role:not(.yc-role-admin) .pill {
  padding: 4px 7px !important;
  font-size: .6rem !important;
  line-height: 1.1 !important;
}
