/* ═══════════════════════════════════════════════════════════════
   EduSaaS Dashboard — dashboard.css
   Modern green-themed SaaS-style learning platform
═══════════════════════════════════════════════════════════════ */

/* ── Viewport lock ── */
html:has(.esd-body) {
    overflow: hidden;
    height: 100%;
    margin-top: 0 !important;
    padding-top: 0 !important;
}
html:has(.esd-body) body {
    overflow: hidden;
    height: 100%;
    margin-top: 0 !important;
}


/* ── Variables ── */
:root {
    --esd-green-50:   #eaf3ed;
    --esd-green-100:  #d1ede0;
    --esd-green-200:  #b7d9c8;
    --esd-green-400:  #3a8a64;
    --esd-green-500:  #3a8a64;
    --esd-green-600:  #2d6a4f;
    --esd-green-700:  #1a4d2e;
    --esd-green-800:  #163d25;
    --esd-green-900:  #0f2d1b;

    --esd-sidebar-bg:    #0b1e12;
    --esd-sidebar-w:     256px;
    --esd-topbar-h:      58px;

    --esd-bg:        #f4f7f5;
    --esd-surface:   #ffffff;
    --esd-border:    #e5ede8;

    --esd-text-1:    #111827;
    --esd-text-2:    #374151;
    --esd-text-3:    #6b7280;
    --esd-text-4:    #9ca3af;

    --esd-blue-500:   #3b82f6;
    --esd-blue-100:   #dbeafe;
    --esd-amber-500:  #f59e0b;
    --esd-amber-100:  #fef3c7;
    --esd-purple-500: #8b5cf6;
    --esd-purple-100: #ede9fe;
    --esd-red-500:    #ef4444;
    --esd-red-100:    #fee2e2;

    --esd-shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --esd-shadow:     0 2px 8px rgba(0,0,0,0.08);
    --esd-shadow-md:  0 4px 16px rgba(0,0,0,0.10);
    --esd-radius-sm:  8px;
    --esd-radius:     12px;
    --esd-radius-lg:  16px;

    --esd-font-ui:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --esd-font-head:  'Outfit', 'DM Sans', sans-serif;

    --esd-transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & base ── */
.esd-body *,
.esd-body *::before,
.esd-body *::after {
    box-sizing: border-box;
}

.esd-body {
    margin: 0;
    padding: 0;
    font-family: var(--esd-font-ui);
    font-size: 14px;
    color: var(--esd-text-1);
    background: var(--esd-bg);
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Hide the default WP admin bar and theme elements */
.esd-body #wpadminbar,
.esd-body .site-header,
.esd-body .site-footer,
.esd-body .wp-block-template-part {
    display: none !important;
}

.esd-body.admin-bar { margin-top: 0 !important; }
.esd-body.admin-bar .esd-sidebar { top: 0; }

/* WP admin bar pushes html element down by 32px — neutralise completely */
html:has(.esd-body) { margin-top: 0 !important; padding-top: 0 !important; }
html:has(.esd-body.admin-bar) { margin-top: 0 !important; }

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */

.esd-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--esd-sidebar-w);
    height: 100vh;
    max-height: 100vh;
    background: var(--esd-sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: transform var(--esd-transition);
}

/* Brand */
.esd-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.esd-brand__logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--esd-green-500), var(--esd-green-700));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}

.esd-brand__name {
    display: block;
    font-family: var(--esd-font-head);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.esd-brand__tagline {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* Navigation */
.esd-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.esd-nav__section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.28);
    padding: 14px 8px 6px;
    text-transform: uppercase;
}

.esd-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--esd-transition);
    margin-bottom: 2px;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.esd-nav__item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
}

.esd-nav__item.is-active {
    background: rgba(34,197,94,0.14);
    color: var(--esd-green-400);
}

.esd-nav__item.is-active .esd-nav__icon {
    color: var(--esd-green-400);
}

.esd-nav__icon {
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color var(--esd-transition);
}

/* Sidebar footer */
.esd-sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 4px;
}

.esd-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    flex: 1;
    min-width: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--esd-transition), box-shadow var(--esd-transition);
}

.esd-user-card:hover {
    background: rgba(255,255,255,0.09);
}

.esd-user-card.is-active {
    background: rgba(34,197,94,0.12);
    box-shadow: inset 0 0 0 1px rgba(34,197,94,0.25);
}

.esd-user-card__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(34,197,94,0.3);
}

.esd-user-card__info {
    flex: 1;
    min-width: 0;
}

.esd-user-card__name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.esd-user-card__role {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-top: 1px;
}

.esd-logout-btn {
    color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--esd-transition);
}

.esd-logout-btn:hover {
    color: var(--esd-red-500);
    background: rgba(239,68,68,0.1);
}

/* ═══════════════════════════════════════════════
   MAIN AREA
═══════════════════════════════════════════════ */

.esd-main {
    margin-left: var(--esd-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    transition: margin-left var(--esd-transition);
}

/* Top bar */
.esd-topbar {
    height: var(--esd-topbar-h);
    background: var(--esd-surface);
    border-bottom: 1px solid var(--esd-border);
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    padding-left: 20px;
    position: relative;
    z-index: 10;
    box-shadow: var(--esd-shadow-sm);
    overflow: visible;
    flex-shrink: 0;
}

/* Keep menu toggle vertically centered */
.esd-topbar > .esd-menu-toggle {
    align-self: center;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Breadcrumb */
.esd-topbar > .esd-topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    align-self: center;
    padding-left: 4px;
}

/* Actions area */
.esd-topbar > .esd-topbar__actions {
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    align-self: center;
    margin-left: auto;
}

.esd-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--esd-text-2);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--esd-transition);
    padding: 0;
}

.esd-menu-toggle:hover { background: var(--esd-green-50); color: var(--esd-green-600); }

.esd-topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.esd-topbar__site {
    font-size: 13px;
    color: var(--esd-text-3);
}

.esd-topbar__sep {
    color: var(--esd-text-4);
    font-size: 13px;
}

.esd-topbar__page {
    font-size: 14px;
    font-weight: 600;
    color: var(--esd-text-1);
}

.esd-topbar__greeting {
    font-size: 13px;
    color: var(--esd-text-3);
    font-weight: 500;
}

/* Content */
.esd-content {
    flex: 1;
    overflow-y: auto;
}

.esd-content-inner {
    padding: 28px 32px 48px;
    max-width: 1200px;
}

/* ── Loading overlay ── */
.esd-content-inner.is-loading {
    pointer-events: none;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════ */

.esd-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.esd-page-title {
    font-family: var(--esd-font-head);
    font-size: 26px;
    font-weight: 700;
    color: var(--esd-text-1);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.esd-page-subtitle {
    font-size: 14px;
    color: var(--esd-text-3);
    margin: 0;
    line-height: 1.5;
}

.esd-date-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--esd-green-700);
    background: var(--esd-green-50);
    border: 1px solid var(--esd-green-200);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ═══════════════════════════════════════════════
   STATS STRIP
═══════════════════════════════════════════════ */

.esd-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.esd-stats-strip--compact {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
}

.esd-stat-pill {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--esd-shadow-sm);
    transition: box-shadow var(--esd-transition);
}

.esd-stat-pill:hover {
    box-shadow: var(--esd-shadow);
}

.esd-stat-pill__icon {
    font-size: 22px;
    line-height: 1;
}

.esd-stat-pill__val {
    display: block;
    font-family: var(--esd-font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--esd-text-1);
    line-height: 1.1;
}

.esd-stat-pill__lbl {
    display: block;
    font-size: 11px;
    color: var(--esd-text-3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   MODULE CARDS GRID
═══════════════════════════════════════════════ */

.esd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.esd-section-title {
    font-family: var(--esd-font-head);
    font-size: 17px;
    font-weight: 700;
    color: var(--esd-text-1);
    margin: 0;
}

.esd-module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.esd-module-card {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    padding: 20px;
    box-shadow: var(--esd-shadow-sm);
    transition: all var(--esd-transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.esd-module-card:hover {
    box-shadow: var(--esd-shadow-md);
    border-color: var(--esd-green-200);
    transform: translateY(-1px);
}

.esd-module-card--blue:hover   { border-color: #bfdbfe; }
.esd-module-card--amber:hover  { border-color: #fde68a; }
.esd-module-card--purple:hover { border-color: #ddd6fe; }
.esd-module-card--green:hover  { border-color: #bbf7d0; }
.esd-module-card--indigo:hover { border-color: #95d5b2; }

.esd-module-card__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.esd-module-card__icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.esd-module-card__title {
    font-family: var(--esd-font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--esd-text-1);
    margin: 0 0 3px;
    letter-spacing: -0.01em;
}

.esd-module-card__desc {
    font-size: 12.5px;
    color: var(--esd-text-3);
    margin: 0;
    line-height: 1.4;
}

.esd-module-card__stats {
    display: flex;
    gap: 24px;
}

.esd-module-card__stat-val {
    display: block;
    font-family: var(--esd-font-head);
    font-size: 19px;
    font-weight: 700;
    color: var(--esd-text-1);
    line-height: 1.1;
}

.esd-module-card__stat-lbl {
    display: block;
    font-size: 11px;
    color: var(--esd-text-4);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.esd-module-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.esd-module-card__pct {
    font-size: 12px;
    color: var(--esd-text-3);
}

.esd-btn-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--esd-green-600);
    text-decoration: none;
    transition: color var(--esd-transition);
}

.esd-btn-link:hover { color: var(--esd-green-700); }

/* ═══════════════════════════════════════════════
   PROGRESS BARS
═══════════════════════════════════════════════ */

.esd-progress-bar {
    height: 6px;
    background: var(--esd-green-100);
    border-radius: 99px;
    overflow: hidden;
}

.esd-progress-bar--lg {
    height: 10px;
}

.esd-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--esd-green-400), var(--esd-green-600));
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.esd-progress-bar__fill--amber {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.esd-progress-bar__fill--purple {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}

.esd-progress-bar__fill--blue {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.esd-progress-bar__fill--indigo {
    background: linear-gradient(90deg, #52b788, #2d6a4f);
}

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */

.esd-card {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    box-shadow: var(--esd-shadow-sm);
    overflow: hidden;
}

.esd-card--flush .esd-module-frame { border-radius: 0; padding: 0; }

.esd-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--esd-border);
    gap: 12px;
    flex-wrap: wrap;
}

.esd-card__title {
    font-family: var(--esd-font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--esd-text-1);
    margin: 0;
}

.esd-card__sub {
    font-size: 12px;
    color: var(--esd-text-3);
    margin: 2px 0 0;
}

/* ═══════════════════════════════════════════════
   TWO COLUMN LAYOUT
═══════════════════════════════════════════════ */

.esd-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 0;
}

/* ═══════════════════════════════════════════════
   ACTIVITY LIST
═══════════════════════════════════════════════ */

.esd-activity-list {
    padding: 4px 0;
}

.esd-activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--esd-green-50);
    transition: background var(--esd-transition);
}

.esd-activity-item:last-child { border-bottom: none; }
.esd-activity-item:hover { background: var(--esd-green-50); }

.esd-activity-item__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.esd-activity-item__body {
    flex: 1;
    min-width: 0;
}

.esd-activity-item__detail {
    font-size: 13px;
    color: var(--esd-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.esd-activity-item__time {
    font-size: 11px;
    color: var(--esd-text-4);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   QUICK LAUNCH
═══════════════════════════════════════════════ */

.esd-quick-launch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
}

.esd-quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--esd-radius-sm);
    background: var(--esd-green-50);
    border: 1px solid var(--esd-green-100);
    color: var(--esd-green-700);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--esd-transition);
    cursor: pointer;
}

.esd-quick-btn:hover {
    background: var(--esd-green-100);
    border-color: var(--esd-green-200);
    color: var(--esd-green-800);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════ */

.esd-tabs {
    display: flex;
    gap: 2px;
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius);
    padding: 4px;
    margin-bottom: 16px;
    width: fit-content;
}

.esd-tab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--esd-text-3);
    cursor: pointer;
    transition: all var(--esd-transition);
}

.esd-tab:hover { color: var(--esd-text-1); background: var(--esd-green-50); }

.esd-tab.is-active {
    background: #2d6a4f;
    color: white;
    font-weight: 600;
}

.esd-tab-panel { display: none; }
.esd-tab-panel.is-active { display: block; }

/* ═══════════════════════════════════════════════
   MODULE FRAME (wraps shortcode content)
═══════════════════════════════════════════════ */

.esd-module-frame {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    padding: 4px;
    box-shadow: var(--esd-shadow-sm);
}

.esd-module-frame--flush {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* Ensure plugin content inherits fonts */
.esd-module-frame * {
    font-family: var(--esd-font-ui);
}

/* ═══════════════════════════════════════════════
   MODULE STATS ROW
═══════════════════════════════════════════════ */

.esd-module-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.esd-mini-stat {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-sm);
    padding: 8px 14px;
    text-align: center;
    box-shadow: var(--esd-shadow-sm);
}

.esd-mini-stat__val {
    display: block;
    font-family: var(--esd-font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--esd-green-600);
    line-height: 1.1;
}

.esd-mini-stat__lbl {
    display: block;
    font-size: 10px;
    color: var(--esd-text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   PROGRESS BANNER
═══════════════════════════════════════════════ */

.esd-progress-banner {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: var(--esd-shadow-sm);
}

.esd-progress-banner__label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--esd-text-2);
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════
   SCORE BANNER (progress page)
═══════════════════════════════════════════════ */

.esd-score-banner {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    padding: 24px;
    display: flex;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
    box-shadow: var(--esd-shadow-sm);
    flex-wrap: wrap;
}

.esd-score-banner__title {
    font-family: var(--esd-font-head);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--esd-text-1);
}

.esd-score-banner__sub {
    font-size: 13px;
    color: var(--esd-text-3);
    margin: 0 0 16px;
}

.esd-score-breakdown { display: flex; flex-direction: column; gap: 8px; }

.esd-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--esd-text-2);
}

.esd-score-row span { width: 90px; flex-shrink: 0; }

.esd-mini-bar {
    flex: 1;
    height: 6px;
    background: var(--esd-green-100);
    border-radius: 99px;
    overflow: hidden;
}

.esd-mini-bar div {
    height: 100%;
    background: linear-gradient(90deg, var(--esd-green-400), var(--esd-green-600));
    border-radius: 99px;
    transition: width 0.8s ease;
}

.esd-score-row b {
    width: 64px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--esd-text-1);
}

/* ═══════════════════════════════════════════════
   PROGRESS GRID
═══════════════════════════════════════════════ */

.esd-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.esd-progress-card {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--esd-shadow-sm);
    transition: box-shadow var(--esd-transition);
}

.esd-progress-card:hover {
    box-shadow: var(--esd-shadow-md);
}

.esd-progress-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.esd-progress-card__icon {
    font-size: 24px;
    flex-shrink: 0;
}

.esd-progress-card__head h3 {
    font-family: var(--esd-font-head);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--esd-text-1);
}

.esd-progress-card__head p {
    font-size: 12px;
    color: var(--esd-text-3);
    margin: 0;
}

.esd-progress-card__badge {
    margin-left: auto;
    flex-shrink: 0;
}

.esd-progress-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--esd-green-50);
    border-radius: var(--esd-radius-sm);
    padding: 10px;
}

.esd-progress-card__stats div {
    text-align: center;
}

.esd-progress-card__stats span {
    display: block;
    font-size: 10px;
    color: var(--esd-text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
}

.esd-progress-card__stats strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--esd-text-1);
}

/* ═══════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════ */

.esd-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--esd-green-100);
    color: var(--esd-green-700);
    border: 1px solid var(--esd-green-200);
}

.esd-badge--blue   { background: var(--esd-blue-100); color: #1d4ed8; border-color: #bfdbfe; }
.esd-badge--amber  { background: var(--esd-amber-100); color: #92400e; border-color: #fde68a; }
.esd-badge--purple { background: var(--esd-purple-100); color: #5b21b6; border-color: #ddd6fe; }
.esd-badge--green  { background: var(--esd-green-100); color: var(--esd-green-700); border-color: var(--esd-green-200); }
.esd-badge--indigo { background: #eaf3ed; color: #1a4d2e; border-color: #95d5b2; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */

.esd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--esd-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--esd-transition);
    text-decoration: none;
    font-family: var(--esd-font-ui);
}

.esd-btn--primary {
    background: var(--esd-green-600);
    color: white;
    border-color: var(--esd-green-600);
}

.esd-btn--primary:hover {
    background: var(--esd-green-700);
    border-color: var(--esd-green-700);
    color: white;
}

.esd-btn--ghost {
    background: transparent;
    color: var(--esd-text-2);
    border-color: var(--esd-border);
}

.esd-btn--ghost:hover {
    background: var(--esd-green-50);
    border-color: var(--esd-green-200);
    color: var(--esd-green-700);
}

.esd-btn--sm {
    padding: 5px 12px;
    font-size: 12.5px;
}

.esd-btn--danger {
    background: var(--esd-red-100);
    color: var(--esd-red-500);
    border-color: #fecaca;
}

.esd-btn--danger:hover {
    background: var(--esd-red-500);
    color: white;
}

/* ═══════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════ */

.esd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.esd-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--esd-text-3);
    border-bottom: 1px solid var(--esd-border);
    background: var(--esd-green-50);
}

.esd-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--esd-border);
    color: var(--esd-text-2);
    vertical-align: middle;
}

.esd-table tr:last-child td { border-bottom: none; }
.esd-table tr:hover td { background: var(--esd-green-50); }

.esd-student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.esd-student-cell div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.esd-student-cell strong {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--esd-text-1);
}

.esd-student-cell span {
    font-size: 11.5px;
    color: var(--esd-text-3);
}

.esd-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--esd-border);
}

/* ═══════════════════════════════════════════════
   DETAIL GRID (teacher student detail)
═══════════════════════════════════════════════ */

.esd-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 20px;
}

.esd-detail-stat {
    background: var(--esd-green-50);
    border: 1px solid var(--esd-green-100);
    border-radius: var(--esd-radius);
    padding: 14px;
    text-align: center;
}

.esd-detail-stat span {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
}

.esd-detail-stat strong {
    display: block;
    font-family: var(--esd-font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--esd-green-700);
    margin-bottom: 2px;
}

.esd-detail-stat small {
    font-size: 11px;
    color: var(--esd-text-3);
}

/* ═══════════════════════════════════════════════
   PLUGIN STATUS GRID (admin)
═══════════════════════════════════════════════ */

.esd-plugin-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 16px;
}

.esd-plugin-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--esd-radius-sm);
    border: 1px solid;
    font-size: 13px;
    font-weight: 500;
}

.esd-plugin-status.is-active {
    background: var(--esd-green-50);
    border-color: var(--esd-green-200);
    color: var(--esd-green-700);
}

.esd-plugin-status.is-inactive {
    background: #fafafa;
    border-color: var(--esd-border);
    color: var(--esd-text-3);
}

.esd-plugin-status__icon { font-size: 18px; }
.esd-plugin-status__name { flex: 1; font-size: 12.5px; }

.esd-plugin-status__dot {
    font-size: 11px;
    font-weight: 600;
}

.is-active .esd-plugin-status__dot { color: var(--esd-green-600); }
.is-inactive .esd-plugin-status__dot { color: var(--esd-text-4); }

/* ═══════════════════════════════════════════════
   EMPTY / ERROR STATES
═══════════════════════════════════════════════ */

.esd-empty-state {
    padding: 28px 20px;
    text-align: center;
    color: var(--esd-text-3);
    font-size: 13.5px;
}

.esd-plugin-missing {
    padding: 48px 24px;
    text-align: center;
    color: var(--esd-text-2);
}

.esd-plugin-missing__icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.esd-plugin-missing h3 {
    font-family: var(--esd-font-head);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--esd-text-1);
}

.esd-plugin-missing p {
    font-size: 14px;
    color: var(--esd-text-3);
    margin: 0 0 20px;
}

.esd-access-denied {
    padding: 60px 24px;
    text-align: center;
}

.esd-access-denied h2 {
    font-family: var(--esd-font-head);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--esd-red-500);
}

/* ═══════════════════════════════════════════════
   LOADING STATE
═══════════════════════════════════════════════ */

.esd-loading-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    color: var(--esd-text-3);
    font-size: 13.5px;
}

.esd-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--esd-green-200);
    border-top-color: var(--esd-green-500);
    border-radius: 50%;
    animation: esd-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes esd-spin {
    to { transform: rotate(360deg); }
}

/* Page transition shimmer */
.esd-content-inner.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: esd-shimmer 1.2s infinite;
}

@keyframes esd-shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════
   OVERLAY (mobile)
═══════════════════════════════════════════════ */

.esd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--esd-transition);
}

.esd-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .esd-stats-strip { grid-template-columns: repeat(2, 1fr); }
    .esd-module-grid { grid-template-columns: 1fr; }
    .esd-progress-grid { grid-template-columns: 1fr; }
    .esd-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --esd-sidebar-w: 260px;
    }

    .esd-sidebar {
        transform: translateX(-100%);
    }

    .esd-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }

    .esd-main {
        margin-left: 0;
    }

    .esd-menu-toggle {
        display: flex;
    }

    .esd-content-inner {
        padding: 20px 16px 40px;
    }

    .esd-stats-strip { grid-template-columns: repeat(2, 1fr); }
    .esd-two-col { grid-template-columns: 1fr; }
    .esd-page-header { flex-direction: column; }
    .esd-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .esd-stats-strip { grid-template-columns: 1fr 1fr; }
    .esd-quick-launch { grid-template-columns: 1fr; }
    .esd-module-card__stats { flex-wrap: wrap; gap: 12px; }
}

/* ═══════════════════════════════════════════════
   SCROLLBAR STYLING
═══════════════════════════════════════════════ */

.esd-body ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.esd-body ::-webkit-scrollbar-track { background: transparent; }
.esd-body ::-webkit-scrollbar-thumb {
    background: var(--esd-green-200);
    border-radius: 99px;
}

.esd-body ::-webkit-scrollbar-thumb:hover {
    background: var(--esd-green-400);
}

/* ═══════════════════════════════════════════════
   PLUGIN CONTENT INTEGRATION
   Normalize styles from sub-plugins
═══════════════════════════════════════════════ */

.esd-module-frame .wrap,
.esd-module-frame .container {
    max-width: 100% !important;
    padding: 16px !important;
    margin: 0 !important;
}

/* Prevent plugin backgrounds from overriding ours */
.esd-module-frame > div > * {
    max-width: 100%;
}

/* ── Smooth fade on module load ── */
@keyframes esd-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.esd-content-inner {
    animation: esd-fade-in 0.25s ease forwards;
}

/* ═══════════════════════════════════════════════
   STORAGE QUOTA WIDGET
═══════════════════════════════════════════════ */

.esd-storage-widget {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    box-shadow: var(--esd-shadow-sm);
    padding: 18px 22px 16px;
    margin-bottom: 28px;
    transition: border-color 0.3s;
}

.esd-storage-widget.is-limited {
    border-color: #ef4444;
    background: #fff7f7;
}

.esd-storage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.esd-storage-header__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.esd-storage-icon {
    font-size: 16px;
    line-height: 1;
}

.esd-storage-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--esd-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.esd-storage-label {
    font-size: 13px;
    color: var(--esd-text-secondary);
}

.esd-storage-label--warning {
    color: #b45309;
    font-weight: 600;
}

.esd-storage-label--critical {
    color: #dc2626;
    font-weight: 700;
}

.esd-storage-sep {
    margin: 0 3px;
    opacity: 0.5;
}

/* The track */
.esd-storage-bar {
    height: 10px;
    background: var(--esd-green-100);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

/* The fill — default green */
.esd-storage-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--esd-green-400), var(--esd-green-600));
    border-radius: 99px;
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
    position: relative;
}

/* Animated shimmer on the fill */
.esd-storage-bar__fill::after {
    content: '';
    position: absolute;
    top: 0; left: -60%; right: 0; bottom: 0;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: esd-shimmer 2.4s ease-in-out infinite;
    border-radius: 99px;
}

@keyframes esd-shimmer {
    0%   { left: -60%; }
    100% { left: 110%; }
}

.esd-storage-bar__fill--warning {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.esd-storage-bar__fill--critical {
    background: linear-gradient(90deg, #f87171, #dc2626);
    animation: esd-storage-pulse 1.6s ease-in-out infinite;
}

@keyframes esd-storage-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.82; }
}

/* Warning banner shown when limit is reached */
.esd-storage-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 13px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--esd-radius);
    animation: esd-fade-in 0.35s ease forwards;
}

.esd-storage-warning__icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.esd-storage-warning__body {
    font-size: 13.5px;
    line-height: 1.55;
    color: #7f1d1d;
}

.esd-storage-warning__body strong {
    color: #991b1b;
}

/* Dark-mode-friendly overrides */
@media (prefers-color-scheme: dark) {
    .esd-storage-widget.is-limited {
        background: rgba(239, 68, 68, 0.06);
    }
    .esd-storage-warning {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.35);
    }
    .esd-storage-warning__body {
        color: #fca5a5;
    }
    .esd-storage-warning__body strong {
        color: #fca5a5;
    }
}




/* ═══════════════════════════════════════════════════════════════
   TEACHER PANEL — in-page dashboard styles
═══════════════════════════════════════════════════════════════ */

/* ── Inner tab nav ── */
.tp-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 2px solid var(--esd-border);
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tp-tabs::-webkit-scrollbar { display: none; }

.tp-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px 12px;
    border: none;
    background: none;
    font-family: var(--esd-font-ui);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--esd-text-3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 160ms ease, border-color 160ms ease;
    letter-spacing: -0.01em;
}
.tp-tab:hover { color: var(--esd-text-1); }
.tp-tab--active {
    color: #2d6a4f;
    border-bottom-color: #2d6a4f;
}
.tp-tab__icon { font-size: 15px; line-height: 1; }

/* ── Stats strip ── */
.tp-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tp-stat {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius);
    padding: 20px 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--esd-shadow-sm);
    transition: box-shadow var(--esd-transition), transform var(--esd-transition);
}
.tp-stat:hover { box-shadow: var(--esd-shadow-md); transform: translateY(-2px); }
.tp-stat__emoji { font-size: 30px; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.tp-stat__body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-stat__val {
    font-family: var(--esd-font-head);
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}
.tp-stat--indigo  .tp-stat__val { color: #2d6a4f; }
.tp-stat--emerald .tp-stat__val { color: #2d6a4f; }
.tp-stat--amber   .tp-stat__val { color: #d97706; }

.tp-stat__lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--esd-text-3);
    margin-top: 4px;
}
.tp-stat__sub { font-size: 11.5px; color: var(--esd-text-4); }

.tp-stat__cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: filter var(--esd-transition);
    flex-shrink: 0;
}
.tp-stat__cta:hover { filter: brightness(0.88); }
.tp-stat__cta--indigo  { background: #2d6a4f; color: #fff; }
.tp-stat__cta--emerald { background: #2d6a4f; color: #fff; }
.tp-stat__cta--amber   { background: #d97706; color: #fff; }

/* ── Alert banner ── */
.tp-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: var(--esd-radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    border: 1px solid;
    font-size: 13.5px;
    line-height: 1.5;
}
.tp-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tp-alert > span   { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.tp-alert strong   { display: block; font-weight: 700; margin-bottom: 3px; }
.tp-alert p        { margin: 0; }
.tp-alert a        { color: #2d6a4f; font-weight: 700; text-decoration: none; }

/* ── Card ── */
.tp-card {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius-lg);
    box-shadow: var(--esd-shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}
.tp-card__hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--esd-border);
    flex-wrap: wrap;
}
.tp-card__hd-left { min-width: 0; }
.tp-card__title {
    font-family: var(--esd-font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--esd-text-1);
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}
.tp-card__sub { font-size: 12.5px; color: var(--esd-text-3); margin: 0; }

/* ── Buttons ── */
.tp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-family: var(--esd-font-ui);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter var(--esd-transition);
    white-space: nowrap;
}
.tp-btn:hover { filter: brightness(0.88); }
.tp-btn--primary { background: #2d6a4f; color: #fff; }
.tp-btn--ghost {
    background: transparent;
    border: 1.5px solid #2d6a4f;
    color: #2d6a4f;
}
.tp-btn--ghost:hover { background: #eaf3ed; filter: none; }

/* ── Table ── */
.tp-scroll { overflow-x: auto; }
.tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tp-table th {
    background: #f9fafb;
    color: var(--esd-text-3);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .06em;
    padding: 10px 18px;
    text-align: left;
    border-bottom: 1px solid var(--esd-border);
}
.tp-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--esd-text-2);
    vertical-align: middle;
}
.tp-table tr:last-child td { border-bottom: none; }
.tp-table tr:hover td { background: #fafafa; }
.tp-name   { font-weight: 700; color: var(--esd-text-1); }
.tp-muted  { color: var(--esd-text-4); font-size: 12px; }
.tp-link   { font-size: 12px; font-weight: 700; color: #2d6a4f; text-decoration: none; white-space: nowrap; }
.tp-link:hover { color: #1a4d2e; }

/* ── Badges ── */
.tp-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.tp-badge--blue   { background: #dbeafe; color: #1d4ed8; }
.tp-badge--amber  { background: #fef3c7; color: #92400e; }
.tp-badge--purple { background: #ede9fe; color: #6d28d9; }
.tp-badge--green  { background: #d1ede0; color: #1a4d2e; }

/* ── Empty state ── */
.tp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    gap: 10px;
}
.tp-empty__ico { font-size: 42px; }
.tp-empty h4   { font-size: 15px; font-weight: 700; color: var(--esd-text-1); margin: 0; }
.tp-empty p    { font-size: 13.5px; color: var(--esd-text-3); margin: 0; max-width: 360px; line-height: 1.65; }

/* ── Loading ── */
.tp-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 32px 22px;
    color: var(--esd-text-3);
    font-size: 13.5px;
}
.tp-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--esd-border);
    border-top-color: #2d6a4f;
    border-radius: 50%;
    animation: tp-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ── Steps grid ── */
.tp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.tp-step {
    background: var(--esd-surface);
    border: 1px solid var(--esd-border);
    border-radius: var(--esd-radius);
    padding: 22px 22px 20px;
    box-shadow: var(--esd-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--esd-transition), transform var(--esd-transition);
}
.tp-step:hover { box-shadow: var(--esd-shadow-md); transform: translateY(-2px); }
.tp-step--indigo  { border-top: 3px solid #2d6a4f; }
.tp-step--emerald { border-top: 3px solid #2d6a4f; }
.tp-step--amber   { border-top: 3px solid #d97706; }
.tp-step--purple  { border-top: 3px solid #8b5cf6; }

.tp-step__n {
    position: absolute;
    top: 14px; right: 16px;
    font-family: var(--esd-font-head);
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    opacity: 0.06;
    color: var(--esd-text-1);
    pointer-events: none;
    user-select: none;
}
.tp-step__ico   { font-size: 26px; }
.tp-step__title { font-size: 14px; font-weight: 700; color: var(--esd-text-1); margin: 4px 0 0; }
.tp-step__body  { font-size: 12.5px; color: var(--esd-text-3); line-height: 1.65; margin: 0; flex: 1; }

/* ── FAQ accordion ── */
.tp-faqs { padding: 6px 22px 18px; }
.tp-faq {
    border-bottom: 1px solid var(--esd-border);
    padding: 12px 0;
}
.tp-faq:last-child { border-bottom: none; }
.tp-faq summary {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--esd-text-1);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    gap: 8px;
}
.tp-faq summary::-webkit-details-marker { display: none; }
.tp-faq summary::after { content: '+'; color: #2d6a4f; font-size: 18px; font-weight: 400; flex-shrink: 0; }
details[open].tp-faq summary::after { content: '−'; }
.tp-faq p { font-size: 13px; color: var(--esd-text-3); line-height: 1.7; margin: 8px 0 0; }

/* ── Shortcode wrapper ── */
.tp-shortcode-wrap { padding: 20px 22px; }
.tp-shortcode-wrap * { font-family: var(--esd-font-ui) !important; }

/* ── Responsive ── */
@media (max-width: 720px) {
    .tp-stats-strip { grid-template-columns: 1fr; }
    .tp-steps       { grid-template-columns: 1fr 1fr; }
    .tp-table th:nth-child(n+3),
    .tp-table td:nth-child(n+3) { display: none; }
}
@media (max-width: 480px) {
    .tp-steps { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════════════════════════
   TEACHER PANEL — full native dashboard
═══════════════════════════════════════════════════════════════ */

/* ── Stats row ── */
.tp-stats-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; margin-bottom:24px; }
.tp-stat-card { background:var(--esd-surface); border:1px solid var(--esd-border); border-top:3px solid transparent; border-radius:var(--esd-radius); padding:20px 22px; display:flex; align-items:flex-start; gap:14px; box-shadow:var(--esd-shadow-sm); transition:box-shadow var(--esd-transition),transform var(--esd-transition); }
.tp-stat-card:hover { box-shadow:var(--esd-shadow-md); transform:translateY(-1px); }
.tp-stat-card--indigo { border-top-color:#2d6a4f; }
.tp-stat-card--green  { border-top-color:#2d6a4f; }
.tp-stat-card--amber  { border-top-color:#d97706; }
.tp-stat-card__icon { font-size:30px; line-height:1; flex-shrink:0; padding-top:2px; }
.tp-stat-card__body { flex:1; min-width:0; }
.tp-stat-card__value { font-family:var(--esd-font-head); font-size:36px; font-weight:800; line-height:1; letter-spacing:-0.04em; }
.tp-stat-card--indigo .tp-stat-card__value { color:#2d6a4f; }
.tp-stat-card--green  .tp-stat-card__value { color:#2d6a4f; }
.tp-stat-card--amber  .tp-stat-card__value { color:#d97706; }
.tp-stat-card__label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--esd-text-3); margin-top:6px; }
.tp-stat-card__sub { font-size:11.5px; color:var(--esd-text-4); margin-top:3px; }
.tp-stat-card__action { display:inline-flex; align-items:center; padding:8px 14px; border-radius:8px; font-size:12px; font-weight:700; text-decoration:none; white-space:nowrap; align-self:flex-end; flex-shrink:0; transition:filter var(--esd-transition); }
.tp-stat-card__action:hover { filter:brightness(.88); }
.tp-stat-card__action--indigo { background:#2d6a4f; color:#fff; }
.tp-stat-card__action--green  { background:#2d6a4f; color:#fff; }
.tp-stat-card__action--amber  { background:#d97706; color:#fff; }

/* ── Banner ── */
.tp-banner { display:flex; align-items:flex-start; gap:12px; border-radius:var(--esd-radius); padding:14px 18px; margin-bottom:24px; border:1px solid; }
.tp-banner--warning { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.tp-banner__icon { font-size:20px; flex-shrink:0; padding-top:1px; }
.tp-banner__body p { margin:4px 0 0; font-size:13px; line-height:1.6; }
.tp-banner__body a { color:#2d6a4f; font-weight:700; text-decoration:none; }

/* ── Dashboard card wrapper ── */
.tp-card--dashboard { background:var(--esd-surface); border:1px solid var(--esd-border); border-radius:var(--esd-radius-lg); box-shadow:var(--esd-shadow-sm); margin-bottom:24px; overflow:hidden; }

/* ── Dashboard layout: sidebar + main ── */
.tp-dash-layout { display:flex; min-height:540px; }

/* ── Sidebar ── */
.tp-dash-sidebar { width:240px; min-width:240px; border-right:1px solid var(--esd-border); display:flex; flex-direction:column; background:var(--esd-surface); }
.tp-dash-sidebar__header { padding:14px 18px 12px; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--esd-text-3); display:flex; align-items:center; gap:8px; border-bottom:2px solid #2d6a4f; background:#f9fafb; flex-shrink:0; }
.tp-dash-count { background:#2d6a4f; color:#fff; border-radius:999px; padding:2px 8px; font-size:11px; font-weight:700; }
.tp-dash-sidebar__list { flex:1; overflow-y:auto; }
.tp-dash-sidebar__empty { padding:20px; font-size:13px; color:var(--esd-text-3); line-height:1.6; }
.tp-dash-sidebar__footer { padding:12px; border-top:1px solid var(--esd-border); flex-shrink:0; }

/* Student list items */
.tp-student-item { padding:11px 18px; cursor:pointer; border-left:3px solid transparent; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--esd-border); transition:all var(--esd-transition); }
.tp-student-item:hover { background:#eaf3ed; border-left-color:#2d6a4f; }
.tp-student-item--active { background:#eaf3ed; border-left-color:#2d6a4f; }
.tp-student-item__avatar { width:34px; height:34px; border-radius:50%; background:#2d6a4f; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0; }
.tp-student-item__name { font-weight:600; font-size:13.5px; color:var(--esd-text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tp-student-item__login { font-size:11.5px; color:var(--esd-text-4); }

/* ── Main panel ── */
.tp-dash-main { flex:1; min-width:0; padding:24px; overflow-y:auto; }

/* ── Student header ── */
.tp-sthdr { display:flex; align-items:center; gap:14px; background:var(--esd-surface); border:1px solid var(--esd-border); border-radius:var(--esd-radius); padding:18px 22px; margin-bottom:20px; box-shadow:var(--esd-shadow-sm); }
.tp-sthdr__avatar { width:48px; height:48px; border-radius:50%; background:#2d6a4f; color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:700; flex-shrink:0; }
.tp-sthdr__info { flex:1; min-width:0; }
.tp-sthdr__info strong { display:block; font-size:17px; font-weight:700; color:var(--esd-text-1); }
.tp-sthdr__info span { font-size:12.5px; color:var(--esd-text-3); }

/* ── Per-student tab nav ── */
.tp-tab-nav { display:flex; gap:0; border-bottom:2px solid var(--esd-border); margin-bottom:24px; overflow-x:auto; scrollbar-width:none; }
.tp-tab-nav::-webkit-scrollbar { display:none; }
.tp-tab { display:inline-flex; align-items:center; gap:6px; padding:9px 18px 11px; border:none; background:none; font-family:var(--esd-font-ui); font-size:13px; font-weight:600; color:var(--esd-text-3); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; white-space:nowrap; transition:color 180ms,border-color 180ms; letter-spacing:-0.01em; }
.tp-tab:hover { color:var(--esd-text-1); }
.tp-tab--active { color:#2d6a4f; border-bottom-color:#2d6a4f; font-weight:700; }

/* ── Stat card grid (inside panels) ── */
.tp-grid4 { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; margin-bottom:20px; }
.tp-sc { background:var(--esd-surface); border:1px solid var(--esd-border); border-radius:var(--esd-radius-sm); padding:16px 18px; box-shadow:var(--esd-shadow-sm); }
.tp-sc__val { font-family:var(--esd-font-head); font-size:26px; font-weight:800; line-height:1; color:var(--esd-text-1); }
.tp-sc__val--green { color:#2d6a4f; } .tp-sc__val--blue { color:#2d6a4f; } .tp-sc__val--amber { color:#d97706; } .tp-sc__val--red { color:#ef4444; }
.tp-sc__lbl { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--esd-text-3); margin-top:6px; }

/* ── Section containers ── */
.tp-section { background:var(--esd-surface); border:1px solid var(--esd-border); border-radius:var(--esd-radius); margin-bottom:20px; overflow:hidden; }
.tp-section__hdr { padding:13px 18px; border-bottom:1px solid var(--esd-border); display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:14px; font-weight:600; color:var(--esd-text-1); }

/* ── Table ── */
.tp-table-wrap { overflow-x:auto; }
.tp-table { width:100%; border-collapse:collapse; font-size:13px; }
.tp-table th { background:#f9fafb; color:var(--esd-text-3); font-weight:700; text-transform:uppercase; font-size:10.5px; letter-spacing:.06em; padding:10px 14px; text-align:left; border-bottom:1px solid var(--esd-border); }
.tp-table td { padding:11px 14px; border-bottom:1px solid #f3f4f6; color:var(--esd-text-2); vertical-align:middle; }
.tp-table tr:last-child td { border-bottom:none; }
.tp-table tr:hover td { background:#fafafa; }

/* ── Badges ── */
.tp-badge { display:inline-block; font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.tp-badge--green  { background:#d1ede0; color:#1a4d2e; }
.tp-badge--blue   { background:#dbeafe; color:#1d4ed8; }
.tp-badge--amber  { background:#fef3c7; color:#92400e; }
.tp-badge--red    { background:#fee2e2; color:#991b1b; }
.tp-badge--purple { background:#ede9fe; color:#6d28d9; }

/* ── Buttons ── */
.tp-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:700; text-decoration:none; border:none; cursor:pointer; transition:filter var(--esd-transition); white-space:nowrap; font-family:var(--esd-font-ui); }
.tp-btn:hover { filter:brightness(.88); }
.tp-btn--primary { background:#2d6a4f; color:#fff; }
.tp-btn--danger  { background:#ef4444; color:#fff; }
.tp-btn--ghost   { background:#e5e7eb; color:var(--esd-text-1); }
.tp-btn--ghost:hover { background:#d1d5db; filter:none; }
.tp-btn--outline { background:transparent; border:1.5px solid #2d6a4f; color:#2d6a4f; }
.tp-btn--outline:hover { background:#eaf3ed; filter:none; }
.tp-btn--sm  { padding:6px 12px; font-size:12px; }
.tp-btn--full { width:100%; justify-content:center; }

/* ── Reset bar ── */
.tp-reset-bar { background:#fee2e2; border:1px solid #fca5a5; border-radius:8px; padding:12px 16px; margin-bottom:18px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.tp-reset-bar span { font-size:13px; color:#7f1d1d; font-weight:500; }

/* ── Empty state ── */
.tp-empty { display:flex; flex-direction:column; align-items:center; text-align:center; padding:48px 24px; gap:8px; color:var(--esd-text-3); }
.tp-empty__icon { font-size:40px; }
.tp-empty h4 { font-size:15px; font-weight:700; color:var(--esd-text-1); margin:0; }
.tp-empty p { font-size:13.5px; margin:0; max-width:320px; line-height:1.6; }

/* ── Loading spinner ── */
.tp-loading { display:flex; align-items:center; gap:10px; padding:28px 18px; color:var(--esd-text-3); font-size:13.5px; }
.tp-loading__spinner { width:18px; height:18px; border:2px solid var(--esd-border); border-top-color:#2d6a4f; border-radius:50%; animation:tp-spin .7s linear infinite; flex-shrink:0; }
@keyframes tp-spin { to { transform:rotate(360deg); } }

/* ── Messages ── */
.tp-msg { padding:12px 16px; border-radius:8px; font-size:13.5px; font-weight:500; margin-top:12px; }
.tp-msg--error   { background:#fee2e2; border:1px solid #fca5a5; color:#991b1b; }
.tp-msg--success { background:#d1ede0; border:1px solid #6ee7b7; color:#1a4d2e; }

/* ── Modal ── */
.tp-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:9999; display:flex; align-items:center; justify-content:center; }
.tp-modal-overlay--danger .tp-modal { border:2px solid #fca5a5; }
.tp-modal-overlay--danger .tp-modal__header { background:#fef2f2; border-bottom-color:#fca5a5; }
.tp-modal-overlay--danger .tp-modal__header h3 { color:#ef4444; }
.tp-modal { background:#fff; border-radius:12px; width:500px; max-width:94vw; box-shadow:0 12px 40px rgba(0,0,0,.2); }
.tp-modal--sm { width:420px; }
.tp-modal__header { padding:20px 24px 16px; border-bottom:1px solid var(--esd-border); display:flex; align-items:center; justify-content:space-between; }
.tp-modal__header h3 { margin:0; font-size:18px; font-weight:700; color:var(--esd-text-1); }
.tp-modal__close { background:none; border:none; font-size:22px; cursor:pointer; color:var(--esd-text-3); line-height:1; padding:0; }
.tp-modal__body { padding:22px 24px; }
.tp-modal__intro { margin:0 0 18px; color:var(--esd-text-3); font-size:13.5px; line-height:1.6; }
.tp-modal__footer { padding:14px 24px 22px; border-top:1px solid var(--esd-border); display:flex; justify-content:flex-end; gap:10px; }

/* ── Form fields ── */
.tp-field { margin-bottom:18px; }
.tp-field label { display:block; font-weight:600; font-size:13.5px; margin-bottom:7px; color:var(--esd-text-1); }
.tp-field input,.tp-field textarea { width:100%; padding:10px 12px; border:1px solid var(--esd-border); border-radius:8px; font-size:13.5px; font-family:var(--esd-font-ui); background:#eaf3ed; color:var(--esd-text-1); transition:border-color .2s,background .2s; outline:none; }
.tp-field input:focus,.tp-field textarea:focus { border-color:#2d6a4f; background:#fff; box-shadow:0 0 0 3px rgba(45,106,79,0.12); }
.tp-field small { display:block; margin-top:5px; color:var(--esd-text-4); font-size:12px; }

/* ── Toast ── */
.tp-toast { position:fixed; top:24px; right:24px; background:#fff; padding:14px 18px; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.15); z-index:10000; min-width:280px; font-size:14px; font-weight:600; color:var(--esd-text-1); border-left:4px solid #2d6a4f; animation:tp-toast-in .25s ease; }
.tp-toast--success { border-left-color:#2d6a4f; }
.tp-toast--error   { border-left-color:#ef4444; }
.tp-toast--hide    { animation:tp-toast-out .3s ease forwards; }
@keyframes tp-toast-in  { from { transform:translateX(120%); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes tp-toast-out { from { transform:translateX(0); opacity:1; } to { transform:translateX(120%); opacity:0; } }

/* ── Setup guide collapsible ── */
.tp-setup-guide { border:1px solid var(--esd-border); border-radius:var(--esd-radius-lg); background:var(--esd-surface); margin-bottom:24px; overflow:hidden; box-shadow:var(--esd-shadow-sm); }
.tp-setup-guide__toggle { padding:16px 22px; font-size:14px; font-weight:700; color:var(--esd-text-1); cursor:pointer; list-style:none; display:flex; justify-content:space-between; }
.tp-setup-guide__toggle::-webkit-details-marker { display:none; }
.tp-setup-guide__toggle::after { content:'+'; color:#2d6a4f; font-size:20px; font-weight:300; }
details[open] .tp-setup-guide__toggle::after { content:'2'; }
.tp-setup-guide > div { padding:0 22px 22px; }

/* ── Steps grid ── */
.tp-steps-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.tp-step { background:var(--esd-surface); border:1px solid var(--esd-border); border-top:3px solid transparent; border-radius:var(--esd-radius); padding:20px; display:flex; flex-direction:column; gap:7px; position:relative; overflow:hidden; transition:box-shadow var(--esd-transition),transform var(--esd-transition); }
.tp-step:hover { box-shadow:var(--esd-shadow-md); transform:translateY(-2px); }
.tp-step--indigo { border-top-color:#2d6a4f; } .tp-step--green { border-top-color:#2d6a4f; } .tp-step--amber { border-top-color:#d97706; } .tp-step--purple { border-top-color:#8b5cf6; }
.tp-step__num { position:absolute; top:10px; right:14px; font-family:var(--esd-font-head); font-size:52px; font-weight:800; opacity:.05; pointer-events:none; user-select:none; line-height:1; }
.tp-step__icon { font-size:24px; }
.tp-step__title { font-size:13.5px; font-weight:700; color:var(--esd-text-1); margin:3px 0 0; }
.tp-step__body { font-size:12.5px; color:var(--esd-text-3); line-height:1.65; margin:0; flex:1; }

/* ── FAQ ── */
.tp-card { background:var(--esd-surface); border:1px solid var(--esd-border); border-radius:var(--esd-radius-lg); box-shadow:var(--esd-shadow-sm); overflow:hidden; margin-bottom:24px; }
.tp-card__header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 22px; border-bottom:1px solid var(--esd-border); }
.tp-card__title { font-family:var(--esd-font-head); font-size:15px; font-weight:700; color:var(--esd-text-1); margin:0; }
.tp-faq { padding:4px 22px 18px; }
.tp-faq__item { border-bottom:1px solid var(--esd-border); padding:12px 0; }
.tp-faq__item:last-child { border-bottom:none; }
.tp-faq__q { font-size:13.5px; font-weight:600; color:var(--esd-text-1); cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; user-select:none; }
.tp-faq__q::-webkit-details-marker { display:none; }
.tp-faq__q::after { content:'+'; color:#2d6a4f; font-size:20px; font-weight:300; line-height:1; }
details[open] .tp-faq__q::after { content:'2'; }
.tp-faq__a { font-size:13px; color:var(--esd-text-3); line-height:1.7; margin:8px 0 0; }

/* ── Responsive ── */
@media (max-width: 760px) {
    .tp-dash-layout { flex-direction:column; }
    .tp-dash-sidebar { width:100%; min-width:0; max-height:200px; border-right:none; border-bottom:1px solid var(--esd-border); }
    .tp-stats-row { grid-template-columns:1fr; }
    .tp-steps-grid { grid-template-columns:1fr; }
    .tp-grid4 { grid-template-columns:repeat(2,1fr); }
}





/* ═══════════════════════════════════════════════════════════════
   DAILY LEARNER MODULE  —  Brilliant-style step system
   dl-* components
═══════════════════════════════════════════════════════════════ */

/* ── Progress strip ── */
.dl-progress-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: var(--esd-surface);
    border-bottom: 1px solid var(--esd-border);
    margin-bottom: 0;
}
.dl-progress-strip__dots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dl-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--esd-surface-2, #f3f4f6);
    border: 2px solid var(--esd-border);
    color: var(--esd-text-3);
    transition: all 0.25s ease;
    cursor: default;
    user-select: none;
}
.dl-dot.is-current {
    background: var(--esd-primary, #2d6a4f);
    border-color: var(--esd-primary, #2d6a4f);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(45,106,79,0.15);
}
.dl-dot.is-correct {
    background: #d1ede0;
    border-color: #6ee7b7;
    color: #1a4d2e;
}
.dl-dot.is-wrong {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}
.dl-progress-strip__label {
    font-size: 13px;
    color: var(--esd-text-3);
    margin-left: auto;
    white-space: nowrap;
}

/* ── Stage ── */
.dl-stage {
    padding: 0;
    min-height: 400px;
}
.dl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 24px;
    color: var(--esd-text-3);
    font-size: 14px;
}

/* ── Problem shell ── */
.dl-problem-shell {
    display: flex;
    flex-direction: column;
}

/* ── Card header ── */
.dl-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 24px 14px;
    border-bottom: 1px solid var(--esd-border);
    background: var(--esd-surface);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.dl-card-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dl-subject-icon {
    font-size: 22px;
    line-height: 1;
}
.dl-subject-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: block;
}
.dl-topic-label {
    font-size: 11px;
    color: var(--esd-text-3);
    display: block;
    margin-top: 1px;
}
.dl-card-header__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dl-difficulty-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}
.dl-difficulty-badge--easy   { background: #d1ede0; color: #1a4d2e; border-color: #6ee7b7; }
.dl-difficulty-badge--medium { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.dl-difficulty-badge--hard   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.dl-problem-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--esd-text-3);
    background: var(--esd-surface-2, #f3f4f6);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--esd-border);
}
.dl-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}
.dl-context-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* ── Step pill track ── */
.dl-pill-track {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--esd-surface-2, #f9fafb);
    border-bottom: 1px solid var(--esd-border);
}
.dl-pill-track::-webkit-scrollbar { display: none; }
.dl-pill-track__pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--esd-text-3);
    background: transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.dl-pill-track__pill-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--esd-border);
    color: var(--esd-text-3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.dl-pill-track__pill.is-active {
    color: var(--esd-primary, #2d6a4f);
    background: rgba(45,106,79,0.08);
}
.dl-pill-track__pill.is-active .dl-pill-track__pill-num {
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}
.dl-pill-track__pill.is-done {
    color: var(--esd-text-3);
}
.dl-pill-track__pill.is-done .dl-pill-track__pill-num {
    background: #d1ede0;
    color: #1a4d2e;
}
.dl-pill-track__pill.is-done .dl-pill-track__pill-num::after {
    content: '✓';
    font-size: 10px;
}
.dl-pill-track__pill.is-done .dl-pill-track__pill-label {
    display: none;
}
.dl-pill-track__sep {
    width: 20px;
    height: 2px;
    background: var(--esd-border);
    flex-shrink: 0;
    margin: 0 2px;
    border-radius: 2px;
    transition: background 0.3s ease;
}
.dl-pill-track__sep.is-done {
    background: #6ee7b7;
}

/* ── Steps container ── */
.dl-steps-container {
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ── Individual step card ── */
.dl-step-card {
    padding: 28px 28px 24px;
    border-bottom: 1px solid var(--esd-border);
    animation: dl-step-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
    position: relative;
}
.dl-step-card:last-child {
    border-bottom: none;
}
@keyframes dl-step-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Locked state */
.dl-step-card.is-locked {
    background: var(--esd-surface-2, #f9fafb);
    opacity: 0.82;
}
.dl-step-card.is-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.dl-step-card.is-locked .dl-step-action {
    display: none;
}

/* ── Step label ── */
.dl-step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.dl-step-label__num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dl-step-card.is-locked .dl-step-label__num {
    background: #6ee7b7;
    color: #1a4d2e;
}
.dl-step-label__num.is-wrong-state {
    background: #ef4444;
}
.dl-step-label__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--esd-text-1);
    letter-spacing: -0.01em;
}
.dl-step-label__type {
    font-size: 11px;
    font-weight: 600;
    color: var(--esd-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: auto;
}

/* ── Step body ── */
.dl-step-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.dl-step-body--row {
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}

/* ── Step text content ── */
.dl-step-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--esd-text-1);
}
.dl-step-text strong {
    color: var(--esd-primary, #2d6a4f);
    font-weight: 700;
}
.dl-step-text em {
    font-style: normal;
    background: #fef9c3;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}
.dl-step-formula {
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #a7f3d0;
    border-radius: 12px;
    color: var(--esd-primary, #2d6a4f);
    letter-spacing: 0.02em;
    font-family: 'Georgia', serif;
}
.dl-step-context {
    font-size: 13px;
    color: var(--esd-text-3);
    background: var(--esd-surface-2, #f3f4f6);
    border-left: 3px solid var(--esd-border);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    line-height: 1.5;
}

/* ── Visual panel ── */
.dl-step-visual {
    flex-shrink: 0;
}
.dl-visual-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: var(--esd-surface-2, #f9fafb);
    border: 1px solid var(--esd-border);
    display: inline-block;
    max-width: 100%;
}
.dl-svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Variable chips ── */
.dl-var-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
}
.dl-var-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--esd-surface);
    border: 1.5px solid var(--esd-border);
    font-size: 13px;
    animation: dl-chip-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.dl-var-chip__name {
    font-weight: 700;
    color: var(--esd-primary, #2d6a4f);
    font-size: 13px;
    font-family: 'Georgia', serif;
}
.dl-var-chip__eq {
    color: var(--esd-text-3);
    font-size: 12px;
}
.dl-var-chip__val {
    font-weight: 700;
    color: var(--esd-text-1);
    font-size: 14px;
}
.dl-var-chip__unit {
    font-size: 11px;
    color: var(--esd-text-3);
}
@keyframes dl-chip-pop {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Symbol table ── */
.dl-symbol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dl-symbol-table tr + tr td { border-top: 1px solid var(--esd-border); }
.dl-symbol-table td { padding: 7px 10px; vertical-align: top; }
.dl-symbol-table__sym {
    font-weight: 700;
    color: var(--esd-primary, #2d6a4f);
    white-space: nowrap;
    font-family: 'Georgia', serif;
    font-size: 14px;
    width: 90px;
}
.dl-symbol-table__mean { color: var(--esd-text-2); line-height: 1.5; }

/* ── Step action area ── */
.dl-step-action {
    margin-top: 20px;
}

/* Tap-to-continue */
.dl-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
}
.dl-continue-btn:hover {
    background: var(--esd-green-700, #1a5e3a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45,106,79,0.25);
}
.dl-continue-btn:active { transform: translateY(0); }
.dl-continue-btn .dl-btn-arrow {
    font-size: 16px;
    transition: transform 0.18s ease;
}
.dl-continue-btn:hover .dl-btn-arrow { transform: translateX(3px); }

/* ── Micro-answer input ── */
.dl-micro-answer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dl-micro-prompt {
    font-size: 14px;
    font-weight: 600;
    color: var(--esd-text-1);
    line-height: 1.5;
}
.dl-micro-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dl-micro-input {
    width: 120px;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--esd-border);
    border-radius: 8px;
    background: var(--esd-surface);
    color: var(--esd-text-1);
    text-align: center;
    transition: border-color 0.2s ease;
    outline: none;
    -moz-appearance: textfield;
}
.dl-micro-input::-webkit-outer-spin-button,
.dl-micro-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.dl-micro-input:focus { border-color: var(--esd-primary, #2d6a4f); box-shadow: 0 0 0 3px rgba(45,106,79,0.12); }
.dl-micro-input.is-correct { border-color: #10b981; background: #d1ede0; color: #1a4d2e; }
.dl-micro-input.is-wrong   { border-color: #ef4444; background: #fee2e2; color: #991b1b; }
.dl-micro-unit {
    font-size: 14px;
    color: var(--esd-text-3);
    font-weight: 600;
}
.dl-micro-submit {
    padding: 10px 18px;
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}
.dl-micro-submit:hover { background: var(--esd-green-700, #1a5e3a); }
.dl-micro-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Feedback states */
.dl-micro-feedback {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    animation: dl-step-in 0.25s ease both;
}
.dl-micro-feedback.is-visible { display: block; }
.dl-micro-feedback--correct {
    background: #d1ede0;
    border: 1px solid #6ee7b7;
    color: #1a4d2e;
}
.dl-micro-feedback--wrong {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}
.dl-micro-feedback--explain {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}
.dl-micro-feedback__icon { font-size: 15px; margin-right: 6px; }
.dl-attempt-dots {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}
.dl-attempt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--esd-border);
    transition: background 0.2s ease;
}
.dl-attempt-dot.used { background: #ef4444; }

/* MCQ for steps */
.dl-step-mcq {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dl-step-mcq-prompt {
    font-size: 14px;
    font-weight: 600;
    color: var(--esd-text-1);
    margin-bottom: 4px;
}
.dl-step-mcq__opt {
    padding: 11px 16px;
    border: 2px solid var(--esd-border);
    border-radius: 8px;
    background: var(--esd-surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    color: var(--esd-text-1);
}
.dl-step-mcq__opt:hover:not(.is-locked-opt) {
    border-color: var(--esd-primary, #2d6a4f);
    background: rgba(45,106,79,0.04);
}
.dl-step-mcq__opt.is-correct {
    border-color: #10b981;
    background: #d1ede0;
    color: #1a4d2e;
    cursor: default;
}
.dl-step-mcq__opt.is-wrong {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}
.dl-step-mcq__opt.is-locked-opt { cursor: default; }
.dl-step-mcq__opt.is-revealed {
    border-color: #10b981;
    background: #d1ede0;
    color: #1a4d2e;
    cursor: default;
}

/* ── Final answer step ── */
.dl-final-answer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.dl-final-prompt {
    font-size: 15px;
    font-weight: 600;
    color: var(--esd-text-1);
}
.dl-final-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dl-final-input {
    min-width: 160px;
    padding: 12px 18px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid var(--esd-border);
    border-radius: 10px;
    background: var(--esd-surface);
    color: var(--esd-text-1);
    text-align: center;
    transition: border-color 0.2s ease;
    outline: none;
    -moz-appearance: textfield;
}
.dl-final-input::-webkit-outer-spin-button,
.dl-final-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.dl-final-input:focus { border-color: var(--esd-primary, #2d6a4f); box-shadow: 0 0 0 4px rgba(45,106,79,0.12); }
.dl-final-unit { font-size: 15px; font-weight: 600; color: var(--esd-text-3); }
.dl-final-submit {
    padding: 12px 24px;
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}
.dl-final-submit:hover { background: var(--esd-green-700, #1a5e3a); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,106,79,0.25); }
.dl-final-mcq {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.dl-final-mcq__opt {
    padding: 14px 16px;
    border: 2px solid var(--esd-border);
    border-radius: 10px;
    background: var(--esd-surface);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s ease;
    color: var(--esd-text-1);
}
.dl-final-mcq__opt:hover:not(.is-selected) {
    border-color: var(--esd-primary, #2d6a4f);
    background: rgba(45,106,79,0.04);
    transform: translateY(-1px);
}
.dl-final-mcq__opt.is-correct { border-color: #10b981; background: #d1ede0; color: #1a4d2e; cursor: default; }
.dl-final-mcq__opt.is-wrong   { border-color: #ef4444; background: #fee2e2; color: #991b1b; }
.dl-final-mcq__opt.is-selected { cursor: default; }
.dl-final-mcq__opt.is-revealed { border-color: #10b981; background: #d1ede0; color: #1a4d2e; cursor: default; }

/* Final answer feedback */
.dl-final-feedback {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
    animation: dl-step-in 0.25s ease both;
}
.dl-final-feedback.is-visible { display: block; }
.dl-final-feedback--correct { background: #d1ede0; border: 1.5px solid #6ee7b7; color: #1a4d2e; }
.dl-final-feedback--wrong   { background: #fee2e2; border: 1.5px solid #fca5a5; color: #7f1d1d; }

/* ── Reveal / solution step ── */
.dl-reveal-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
}
.dl-reveal-banner__icon { font-size: 28px; flex-shrink: 0; }
.dl-reveal-banner__msg { line-height: 1.4; }
.dl-reveal-banner__msg small { display: block; font-size: 12px; font-weight: 500; margin-top: 2px; opacity: 0.8; }
.dl-reveal-banner--correct { background: #d1ede0; border: 1.5px solid #6ee7b7; color: #1a4d2e; }
.dl-reveal-banner--wrong   { background: #fee2e2; border: 1.5px solid #fca5a5; color: #7f1d1d; }

.dl-solution-card {
    border: 1.5px solid var(--esd-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px;
}
.dl-solution-card__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--esd-border);
    font-size: 13px;
}
.dl-solution-card__row:last-child { border-bottom: none; }
.dl-solution-card__row--answer { background: var(--esd-surface-2, #f9fafb); }
.dl-solution-card__lbl {
    font-size: 12px;
    font-weight: 600;
    color: var(--esd-text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 120px;
    padding-top: 1px;
    flex-shrink: 0;
}
.dl-solution-card__val {
    font-size: 13px;
    color: var(--esd-text-1);
    font-weight: 500;
    line-height: 1.5;
}
.dl-solution-card__val--answer {
    font-size: 16px;
    font-weight: 800;
    color: var(--esd-primary, #2d6a4f);
}
.dl-next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--esd-primary, #2d6a4f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}
.dl-next-btn:hover {
    background: var(--esd-green-700, #1a5e3a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,106,79,0.3);
}

/* ── Done state ── */
.dl-done-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px 40px;
    gap: 6px;
}
.dl-done-state__icon { font-size: 56px; margin-bottom: 6px; }
.dl-done-state__title {
    font-size: 24px;
    font-weight: 800;
    color: var(--esd-text-1);
    letter-spacing: -0.02em;
    margin: 0;
}
.dl-done-state__sub {
    font-size: 14px;
    color: var(--esd-text-3);
    margin: 0 0 16px;
    line-height: 1.5;
    max-width: 320px;
}
.dl-scorecard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}
.dl-scorecard__circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(var(--esd-primary, #2d6a4f) var(--pct), var(--esd-border) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.dl-scorecard__inner {
    width: 84px;
    height: 84px;
    background: var(--esd-surface);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.dl-scorecard__pct { font-size: 22px; font-weight: 800; color: var(--esd-text-1); line-height: 1; }
.dl-scorecard__lbl { font-size: 10px; font-weight: 600; color: var(--esd-text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.dl-scorecard__stats { display: flex; gap: 24px; }
.dl-scorecard__stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dl-scorecard__stat span { font-size: 20px; font-weight: 800; color: var(--esd-text-1); }
.dl-scorecard__stat small { font-size: 11px; color: var(--esd-text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.dl-scorecard__msg { font-size: 14px; color: var(--esd-text-2); line-height: 1.5; }
.dl-reset-btn {
    margin-top: 12px;
    font-size: 12px;
    opacity: 0.5;
    background: none;
    border: 1px solid var(--esd-border);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--esd-text-3);
    transition: opacity 0.2s;
}
.dl-reset-btn:hover { opacity: 0.9; }

/* ── Responsive ── */
@media (max-width: 680px) {
    .dl-card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .dl-step-card   { padding: 20px 16px 18px; }
    .dl-pill-track  { padding: 10px 14px; }
    .dl-final-mcq   { grid-template-columns: 1fr; }
    .dl-solution-card__lbl { min-width: 90px; }
    .dl-step-body--row { flex-direction: column; }
}
