:root {
    --p-bg: #f5f7fa;
    --p-surface: #ffffff;
    --p-surface-soft: #f8fafc;
    --p-border: #e2e8f0;
    --p-border-strong: #cbd5e1;
    --p-ink: #1a202c;
    --p-ink-muted: #64748b;
    --p-ink-soft: #94a3b8;
    --p-primary: #3b82f6;
    --p-primary-strong: #2563eb;
    --p-primary-soft: #eff6ff;
    --p-success: #10b981;
    --p-success-soft: #ecfdf5;
    --p-danger: #ef4444;
    --p-danger-soft: #fef2f2;
    --p-warning: #f59e0b;
    --p-warning-soft: #fffbeb;
    --p-info: #0ea5e9;
    --p-info-soft: #f0f9ff;
    --p-radius-sm: 8px;
    --p-radius: 12px;
    --p-radius-lg: 16px;
    --p-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --p-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --p-shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.12);
}

body.parent-theme {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif !important;
    color: var(--p-ink);
    background: var(--p-bg) !important;
    min-height: 100vh;
    display: block !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    margin: 0;
    padding: 0;
}
body.parent-theme a { color: var(--p-primary); text-decoration: none; }
body.parent-theme a:hover { color: var(--p-primary-strong); }
body.parent-theme h1, body.parent-theme h2, body.parent-theme h3, body.parent-theme h4, body.parent-theme h5 {
    color: var(--p-ink);
    letter-spacing: -0.01em;
    text-align: left;
}
body.parent-theme h1 { font-weight: 700; }
body.parent-theme h2 { font-weight: 700; font-size: 1.6rem; }
body.parent-theme h3 { font-weight: 700; font-size: 1.25rem; }
body.parent-theme h4 { font-weight: 600; font-size: 1.05rem; }

body.parent-theme .p-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* ===== Top navigation ===== */
body.parent-theme .p-nav {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
}
body.parent-theme .p-nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
body.parent-theme .p-brand {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--p-ink);
    letter-spacing: -0.01em;
    text-decoration: none;
}
body.parent-theme .p-brand:hover { color: var(--p-ink); }
body.parent-theme .p-nav-links {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-left: 1.5rem;
}
body.parent-theme .p-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    color: var(--p-ink-muted);
    font-weight: 500;
    font-size: 0.925rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
body.parent-theme .p-nav-link i { font-size: 0.9rem; }
body.parent-theme .p-nav-link:hover {
    background: var(--p-surface-soft);
    color: var(--p-ink);
    text-decoration: none;
}
body.parent-theme .p-nav-link.active {
    color: var(--p-primary-strong);
    background: var(--p-primary-soft);
}

body.parent-theme .p-nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

body.parent-theme .p-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--p-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
body.parent-theme .p-avatar:hover { background: var(--p-primary-strong); }

body.parent-theme .p-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: var(--p-surface);
    border-radius: var(--p-radius);
    box-shadow: var(--p-shadow-lg);
    border: 1px solid var(--p-border);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.15s ease;
    z-index: 1200;
}
body.parent-theme .p-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
body.parent-theme .p-menu-header {
    padding: 0.75rem 0.75rem 0.85rem;
    border-bottom: 1px solid var(--p-border);
    margin-bottom: 0.35rem;
}
body.parent-theme .p-menu-name { font-weight: 700; }
body.parent-theme .p-menu-sub { color: var(--p-ink-muted); font-size: 0.85rem; }
body.parent-theme .p-menu-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: var(--p-ink);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
}
body.parent-theme .p-menu-item i { width: 18px; text-align: center; color: var(--p-ink-muted); }
body.parent-theme .p-menu-item:hover { background: var(--p-primary-soft); color: var(--p-primary-strong); text-decoration: none; }
body.parent-theme .p-menu-item:hover i { color: var(--p-primary-strong); }
body.parent-theme .p-menu-item.danger { color: var(--p-danger); }
body.parent-theme .p-menu-item.danger:hover { background: var(--p-danger-soft); color: #b91c1c; }
body.parent-theme .p-menu-item.danger i { color: var(--p-danger); }
body.parent-theme .p-menu-item.danger:hover i { color: #b91c1c; }

/* Mobile toggle */
body.parent-theme .p-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--p-border-strong);
    color: var(--p-ink);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
}

body.parent-theme .p-mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}
body.parent-theme .p-mobile-drawer.open { display: block; }
body.parent-theme .p-mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 82vw);
    background: var(--p-surface);
    padding: 1.25rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--p-shadow-lg);
}
body.parent-theme .p-mobile-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--p-ink);
    font-size: 1.1rem;
}
body.parent-theme .p-mobile-close:hover { background: var(--p-primary-soft); color: var(--p-primary-strong); }
body.parent-theme .p-mobile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--p-ink);
    font-weight: 600;
    text-decoration: none;
}
body.parent-theme .p-mobile-link i { width: 20px; text-align: center; color: var(--p-ink-muted); }
body.parent-theme .p-mobile-link:hover, body.parent-theme .p-mobile-link.active {
    background: var(--p-primary-soft);
    color: var(--p-primary-strong);
    text-decoration: none;
}
body.parent-theme .p-mobile-link:hover i, body.parent-theme .p-mobile-link.active i { color: var(--p-primary-strong); }

@media (max-width: 900px) {
    body.parent-theme .p-nav-links { display: none; }
    body.parent-theme .p-nav-toggle { display: inline-flex; }
}

/* ===== Cards / surfaces ===== */
body.parent-theme .p-card,
body.parent-theme .p-card-solid {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow-sm);
    padding: 1.5rem 1.75rem;
}
body.parent-theme .p-card + .p-card,
body.parent-theme .p-card-solid + .p-card,
body.parent-theme .p-card + .p-card-solid,
body.parent-theme .p-card-solid + .p-card-solid {
    margin-top: 1.25rem;
}
body.parent-theme .p-card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.125rem;
    margin: 0 0 1rem 0;
    color: var(--p-ink);
}
body.parent-theme .p-card-title .p-badge-count {
    font-size: 0.75rem;
    background: var(--p-primary-soft);
    color: var(--p-primary-strong);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
}
body.parent-theme .p-card-subtitle { color: var(--p-ink-muted); margin-top: -0.5rem; margin-bottom: 1rem; }

body.parent-theme .p-grid { display: grid; gap: 1.25rem; align-items: stretch; justify-items: stretch; }
body.parent-theme .p-grid-2 { grid-template-columns: 1fr 1fr; }
body.parent-theme .p-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
body.parent-theme .p-grid > .p-card,
body.parent-theme .p-grid > .p-card-solid {
    height: 100%;
    margin: 0;
    align-self: stretch;
}
@media (max-width: 900px) {
    body.parent-theme .p-grid-2, body.parent-theme .p-grid-3 { grid-template-columns: 1fr; }
}

/* ===== Buttons ===== */
body.parent-theme .p-btn,
body.parent-theme .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.925rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
}
body.parent-theme a.p-btn-primary,
body.parent-theme button.p-btn-primary,
body.parent-theme input.p-btn-primary,
body.parent-theme .p-btn-primary,
body.parent-theme a.btn-primary,
body.parent-theme button.btn-primary,
body.parent-theme input.btn-primary,
body.parent-theme .btn-primary {
    background: var(--p-primary);
    color: #ffffff !important;
    border-color: var(--p-primary);
}
body.parent-theme a.p-btn-primary:hover,
body.parent-theme button.p-btn-primary:hover,
body.parent-theme input.p-btn-primary:hover,
body.parent-theme .p-btn-primary:hover,
body.parent-theme a.btn-primary:hover,
body.parent-theme button.btn-primary:hover,
body.parent-theme input.btn-primary:hover,
body.parent-theme .btn-primary:hover {
    background: var(--p-primary-strong);
    border-color: var(--p-primary-strong);
    color: #ffffff !important;
}
body.parent-theme .p-btn-ghost,
body.parent-theme .btn-secondary {
    background: var(--p-surface);
    color: var(--p-ink);
    border-color: var(--p-border);
}
body.parent-theme .p-btn-ghost:hover,
body.parent-theme .btn-secondary:hover {
    background: var(--p-surface-soft);
    color: var(--p-ink);
    border-color: var(--p-border-strong);
}
body.parent-theme .p-btn-outline,
body.parent-theme .btn-outline-primary {
    background: var(--p-surface);
    color: var(--p-primary-strong);
    border-color: var(--p-border);
}
body.parent-theme .p-btn-outline:hover,
body.parent-theme .btn-outline-primary:hover {
    background: var(--p-primary-soft);
    color: var(--p-primary-strong);
    border-color: var(--p-primary-soft);
}
body.parent-theme .p-btn-danger,
body.parent-theme .btn-danger,
body.parent-theme .btn-outline-danger {
    background: var(--p-surface);
    color: var(--p-danger);
    border-color: var(--p-border);
}
body.parent-theme .p-btn-danger:hover,
body.parent-theme .btn-danger:hover,
body.parent-theme .btn-outline-danger:hover {
    background: var(--p-danger-soft);
    color: #b91c1c;
    border-color: var(--p-danger-soft);
}
body.parent-theme .p-btn-sm,
body.parent-theme .btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
body.parent-theme .p-btn-block { width: 100%; }

/* ===== Forms ===== */
body.parent-theme .form-label,
body.parent-theme .p-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--p-ink);
    margin-bottom: 0.4rem;
}
body.parent-theme .form-control,
body.parent-theme .form-select,
body.parent-theme .p-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: #fff;
    border: 1px solid var(--p-border);
    border-radius: 8px;
    font-size: 0.925rem;
    color: var(--p-ink);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.parent-theme .form-control:focus,
body.parent-theme .form-select:focus,
body.parent-theme .p-input:focus {
    outline: none;
    border-color: var(--p-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
body.parent-theme textarea.form-control { min-height: 120px; resize: vertical; }

/* ===== Alerts ===== */
body.parent-theme .alert,
body.parent-theme .p-alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--p-radius);
    border: 1px solid transparent;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-size: 0.925rem;
}
body.parent-theme .alert-success,
body.parent-theme .p-alert-success { background: var(--p-success-soft); color: #065f46; border-color: rgba(16, 185, 129, 0.25); }
body.parent-theme .alert-danger,
body.parent-theme .p-alert-danger { background: var(--p-danger-soft); color: #991b1b; border-color: rgba(239, 68, 68, 0.3); }
body.parent-theme .alert-warning,
body.parent-theme .p-alert-warning { background: var(--p-warning-soft); color: #92400e; border-color: rgba(245, 158, 11, 0.3); }
body.parent-theme .alert-info,
body.parent-theme .p-alert-info { background: var(--p-info-soft); color: #075985; border-color: rgba(14, 165, 233, 0.3); }
body.parent-theme .alert-light { background: #f8fafc; color: var(--p-ink-muted); border-color: var(--p-border); }

/* ===== Badges / pills ===== */
body.parent-theme .p-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}
body.parent-theme .p-pill-primary { background: var(--p-primary-soft); color: var(--p-primary-strong); border-color: #bfdbfe; }
body.parent-theme .p-pill-success { background: var(--p-success-soft); color: #047857; border-color: #a7f3d0; }
body.parent-theme .p-pill-warning { background: var(--p-warning-soft); color: #b45309; border-color: #fde68a; }
body.parent-theme .p-pill-danger  { background: var(--p-danger-soft);  color: #b91c1c; border-color: #fecaca; }
body.parent-theme .p-pill-info    { background: var(--p-info-soft);    color: #0369a1; border-color: #bae6fd; }
body.parent-theme .p-pill-muted   { background: #f1f5f9; color: var(--p-ink-muted); border-color: #e2e8f0; }

/* ===== Tables ===== */
body.parent-theme .table,
body.parent-theme .p-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}
body.parent-theme .table th,
body.parent-theme .table td,
body.parent-theme .p-table th,
body.parent-theme .p-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.925rem;
    vertical-align: middle;
    background: transparent;
}
body.parent-theme .table thead th,
body.parent-theme .p-table thead th {
    color: var(--p-ink-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--p-border);
}
body.parent-theme .table tbody tr + tr td,
body.parent-theme .p-table tbody tr + tr td { border-top: 1px solid var(--p-border); }

/* ===== Page header ===== */
body.parent-theme .p-page-header {
    margin: 2rem 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
body.parent-theme .p-page-header > div:first-child { min-width: 0; }
body.parent-theme .p-page-header h1 { margin: 0 0 0.4rem 0; font-size: 1.75rem; line-height: 1.2; }
body.parent-theme .p-page-header p { color: var(--p-ink-muted); margin: 0; font-size: 0.95rem; }

/* ===== Hero (kept name for compatibility but now lightweight) ===== */
body.parent-theme .p-hero {
    padding: 1.75rem 0 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--p-border);
}
body.parent-theme .p-hero-content { max-width: 760px; }
body.parent-theme .p-hero h1 {
    color: var(--p-ink);
    font-size: 1.625rem;
    margin: 0 0 0.35rem 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}
body.parent-theme .p-hero p { color: var(--p-ink-muted); margin: 0; font-size: 0.95rem; }
body.parent-theme .p-hero-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== Empty state ===== */
body.parent-theme .p-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--p-ink-muted);
}
body.parent-theme .p-empty i { font-size: 2.25rem; color: var(--p-ink-soft); margin-bottom: 0.75rem; display: block; }
body.parent-theme .p-empty h4 { color: var(--p-ink); margin: 0 0 0.35rem 0; }

/* ===== Footer ===== */
body.parent-theme .p-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--p-ink-muted);
    font-size: 0.85rem;
}
body.parent-theme .p-footer a { color: var(--p-ink-muted); margin: 0 0.3rem; }
body.parent-theme .p-footer a:hover { color: var(--p-primary-strong); }

/* ===== Modal tweaks ===== */
body.parent-theme .modal-content {
    border: none;
    border-radius: var(--p-radius-lg);
    box-shadow: var(--p-shadow-lg);
}
body.parent-theme .modal-header,
body.parent-theme .modal-footer { border-color: var(--p-border); }
body.parent-theme .modal-title { font-weight: 700; }

/* ===== Bootstrap surface compatibility ===== */
body.parent-theme .card {
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    box-shadow: var(--p-shadow-sm);
}
body.parent-theme .card-body { padding: 1.1rem 1.25rem; }
body.parent-theme .badge { font-weight: 600; border-radius: 999px; padding: 0.35em 0.7em; }
body.parent-theme .bg-success { background: var(--p-success) !important; }
body.parent-theme .bg-danger { background: var(--p-danger) !important; }
body.parent-theme .bg-warning { background: var(--p-warning) !important; color: #78350f !important; }
body.parent-theme .bg-info { background: var(--p-info) !important; }
body.parent-theme .bg-primary { background: var(--p-primary) !important; }
body.parent-theme .bg-secondary { background: #64748b !important; }
body.parent-theme .text-muted { color: var(--p-ink-muted) !important; }

/* Utility */
body.parent-theme .p-gap-sm { display: flex; gap: 0.5rem; flex-wrap: wrap; }
body.parent-theme .p-gap { display: flex; gap: 0.75rem; flex-wrap: wrap; }
body.parent-theme .p-mt { margin-top: 1.25rem; }
body.parent-theme .p-mt-lg { margin-top: 2rem; }

/* Hide trainer-specific UI that might otherwise show in role-aware layout */
body.parent-theme .sidebar,
body.parent-theme .mobile-nav-toggle,
body.parent-theme .sidebar-overlay,
body.parent-theme .sidebar-close-toggle,
body.parent-theme .sidebar-scroll-indicator,
body.parent-theme .desktop-profile-container {
    display: none !important;
}
body.parent-theme .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: calc(100vh - 60px);
}
body.parent-theme .content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    width: 100%;
}
body.parent-theme .footer {
    text-align: center;
    padding: 1.5rem 1rem 2.5rem;
    color: var(--p-ink-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--p-border);
    margin-top: 3rem;
}
body.parent-theme .footer a { color: var(--p-ink-muted); text-decoration: none; }
body.parent-theme .footer a:hover { color: var(--p-primary-strong); }

/* Tone down the old cookie banner for parent theme */
body.parent-theme .cookie-consent {
    background-color: var(--p-ink) !important;
}
