/*
 * AIEdu Platform - Academic SaaS UI/UX Stylesheet
 * 
 * Complies with 14 Immutable Technical Rules:
 * - Scoped namespace: .aiedu-platform-root
 * - Help Tooltip: Floating Dark Slate (#0f172a), white text, 8px radius
 * - Single-row toolbar: flex-wrap nowrap, synced 34-38px height
 * - Card semantic border-top: 4px solid (#0284c7, #f59e0b, #10b981, #ef4444)
 * - 100dvh viewport height and touch target >= 48px
 * - Dual Theme: Light & Dark
 * 
 * @author Luong Huu Nam
 * @version 1.5.4
 */

/* ==========================================================================
   CSS Variables & Themes
   ========================================================================== */
.aiedu-platform-root,
.aiedu-cms-wrapper {
    /* Light Theme (Default Academic SaaS) */
    --aiedu-bg: #f8fafc;
    --aiedu-surface: #ffffff;
    --aiedu-surface-subtle: #f1f5f9;
    --aiedu-surface-hover: #e2e8f0;
    --aiedu-border: #e2e8f0;
    --aiedu-border-strong: #cbd5e1;
    --aiedu-text: #0f172a;
    --aiedu-text-muted: #64748b;
    --aiedu-primary: #0284c7;
    --aiedu-primary-hover: #0369a1;
    --aiedu-primary-light: #e0f2fe;
    --aiedu-accent-overview: #0284c7;
    --aiedu-accent-warning: #f59e0b;
    --aiedu-accent-success: #10b981;
    --aiedu-accent-danger: #ef4444;
    --aiedu-radius: 10px;
    --aiedu-radius-sm: 6px;
    --aiedu-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --aiedu-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
    --aiedu-control-height: 36px;
}

/* Dark Theme */
.aiedu-platform-root[data-theme="dark"],
.aiedu-cms-wrapper[data-theme="dark"] {
    --aiedu-bg: #0f172a;
    --aiedu-surface: #1e293b;
    --aiedu-surface-subtle: #334155;
    --aiedu-surface-hover: #334155;
    --aiedu-border: #334155;
    --aiedu-border-strong: #475569;
    --aiedu-text: #f8fafc;
    --aiedu-text-muted: #94a3b8;
    --aiedu-primary: #38bdf8;
    --aiedu-primary-hover: #0284c7;
    --aiedu-primary-light: rgba(56, 189, 248, 0.15);
    --aiedu-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --aiedu-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Root Container & Layout (100dvh)
   ========================================================================== */
.aiedu-platform-root,
.aiedu-cms-wrapper {
    display: flex;
    min-height: calc(100dvh - 60px);
    max-height: 100dvh;
    background-color: var(--aiedu-bg);
    color: var(--aiedu-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    border-radius: var(--aiedu-radius);
    border: 1px solid var(--aiedu-border);
    box-shadow: var(--aiedu-shadow);
    overflow: hidden;
    box-sizing: border-box;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.aiedu-platform-root *,
.aiedu-cms-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   Sidebar Navigation (Academic SaaS Style)
   ========================================================================== */
.aiedu-cms-sidebar {
    width: 250px;
    background: var(--aiedu-surface);
    border-right: 1px solid var(--aiedu-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.aiedu-cms-brand {
    padding: 20px;
    border-bottom: 1px solid var(--aiedu-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiedu-cms-brand h2 {
    margin: 0;
    color: var(--aiedu-text);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.aiedu-cms-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.aiedu-cms-tab {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--aiedu-text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    user-select: none;
}

.aiedu-cms-tab:hover {
    background: var(--aiedu-surface-hover);
    color: var(--aiedu-text);
}

.aiedu-cms-tab.active {
    background: var(--aiedu-primary-light);
    color: var(--aiedu-primary);
    font-weight: 600;
    border-left-color: var(--aiedu-primary);
}

.aiedu-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   Main Content Area & Header
   ========================================================================== */
.aiedu-cms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--aiedu-bg);
}

.aiedu-cms-header {
    height: 64px;
    padding: 0 24px;
    background: var(--aiedu-surface);
    border-bottom: 1px solid var(--aiedu-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.aiedu-cms-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--aiedu-text);
}

.aiedu-cms-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.aiedu-theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--aiedu-radius-sm);
    border: 1px solid var(--aiedu-border);
    background: var(--aiedu-surface-subtle);
    color: var(--aiedu-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aiedu-theme-toggle-btn:hover {
    background: var(--aiedu-surface-hover);
    color: var(--aiedu-primary);
}

.aiedu-cms-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--aiedu-text);
    padding: 6px 12px;
    background: var(--aiedu-surface-subtle);
    border: 1px solid var(--aiedu-border);
    border-radius: 999px;
}

.aiedu-cms-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ==========================================================================
   Rule 4: Single-Row Toolbar (34px - 38px Standard Height)
   ========================================================================== */
.aiedu-single-row-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
    width: 100%;
}

.aiedu-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.aiedu-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.aiedu-toolbar-input,
.aiedu-toolbar-select,
.aiedu-toolbar-btn,
.aiedu-cms-btn {
    height: var(--aiedu-control-height);
    min-height: var(--aiedu-control-height);
    max-height: var(--aiedu-control-height);
    line-height: normal;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--aiedu-radius-sm);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.aiedu-toolbar-input,
.aiedu-toolbar-select {
    padding: 0 12px;
    background: var(--aiedu-surface);
    color: var(--aiedu-text);
    border: 1px solid var(--aiedu-border-strong);
    transition: all 0.2s ease;
}

.aiedu-toolbar-input:focus,
.aiedu-toolbar-select:focus {
    border-color: var(--aiedu-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--aiedu-primary-light);
}

.aiedu-toolbar-search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 260px;
}

.aiedu-toolbar-search-box svg {
    position: absolute;
    left: 10px;
    color: var(--aiedu-text-muted);
    pointer-events: none;
}

.aiedu-toolbar-search-box input {
    width: 100%;
    padding-left: 34px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.aiedu-cms-btn,
.aiedu-toolbar-btn {
    background: var(--aiedu-primary);
    color: #ffffff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.aiedu-cms-btn:hover,
.aiedu-toolbar-btn:hover {
    background: var(--aiedu-primary-hover);
    transform: translateY(-1px);
}

.aiedu-btn-secondary {
    background: var(--aiedu-surface-subtle);
    color: var(--aiedu-text);
    border: 1px solid var(--aiedu-border-strong);
}

.aiedu-btn-secondary:hover {
    background: var(--aiedu-surface-hover);
    color: var(--aiedu-text);
}

/* ==========================================================================
   Rule 5: Visual Accents & Border-Top Cards
   ========================================================================== */
.aiedu-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.aiedu-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .aiedu-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .aiedu-grid-4 {
        grid-template-columns: 1fr;
    }
}

.aiedu-card {
    background: var(--aiedu-surface);
    border: 1px solid var(--aiedu-border);
    border-radius: var(--aiedu-radius);
    padding: 20px;
    box-shadow: var(--aiedu-shadow);
    transition: all 0.2s ease;
}

/* 4px Solid Semantic Border-Top */
.aiedu-card.accent-overview {
    border-top: 4px solid var(--aiedu-accent-overview);
}

.aiedu-card.accent-warning {
    border-top: 4px solid var(--aiedu-accent-warning);
}

.aiedu-card.accent-success {
    border-top: 4px solid var(--aiedu-accent-success);
}

.aiedu-card.accent-danger {
    border-top: 4px solid var(--aiedu-accent-danger);
}

/* Quarterly Statistics Grid & Cards */
.aiedu-quarter-grid {
    display: grid;
    gap: 18px;
    margin-top: 4px;
    margin-bottom: 24px;
    width: 100%;
}

.aiedu-quarter-grid.cols-1 {
    grid-template-columns: 1fr;
}

.aiedu-quarter-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aiedu-quarter-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aiedu-quarter-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .aiedu-quarter-grid.cols-3,
    .aiedu-quarter-grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .aiedu-quarter-grid.cols-2,
    .aiedu-quarter-grid.cols-3,
    .aiedu-quarter-grid.cols-4 {
        grid-template-columns: 1fr;
    }
}

.aiedu-card.accent-quarter-1 {
    border-top: 4px solid #2563eb;
}
.aiedu-card.accent-quarter-2 {
    border-top: 4px solid #059669;
}
.aiedu-card.accent-quarter-3 {
    border-top: 4px solid #d97706;
}
.aiedu-card.accent-quarter-4 {
    border-top: 4px solid #7c3aed;
}

.aiedu-card.accent-quarter-1 .aiedu-quarter-badge {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}
.aiedu-card.accent-quarter-2 .aiedu-quarter-badge {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}
.aiedu-card.accent-quarter-3 .aiedu-quarter-badge {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}
.aiedu-card.accent-quarter-4 .aiedu-quarter-badge {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-card.accent-quarter-1 .aiedu-quarter-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.aiedu-platform-root[data-theme="dark"] .aiedu-card.accent-quarter-2 .aiedu-quarter-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
.aiedu-platform-root[data-theme="dark"] .aiedu-card.accent-quarter-3 .aiedu-quarter-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}
.aiedu-platform-root[data-theme="dark"] .aiedu-card.accent-quarter-4 .aiedu-quarter-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.aiedu-quarter-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Rule 3: Metrics Cards */
.aiedu-metric-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--aiedu-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aiedu-metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.aiedu-metric-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--aiedu-text);
    line-height: 1.1;
}

.aiedu-metric-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--aiedu-text-muted);
}

.aiedu-metric-subtext {
    font-size: 13.5px;
    color: var(--aiedu-text-muted);
    margin-top: 8px;
}

/* ==========================================================================
   Rule 2: Help Tooltip (.aiedu-tooltip-trigger)
   ========================================================================== */
.aiedu-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: var(--aiedu-text-muted);
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
    position: relative;
    outline: none;
    transition: color 0.2s ease;
}

.aiedu-tooltip-trigger:hover,
.aiedu-tooltip-trigger:focus {
    color: var(--aiedu-primary);
}

.aiedu-tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: #0f172a;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    text-align: left;
    text-transform: none;
}

.aiedu-tooltip-trigger:hover::after,
.aiedu-tooltip-trigger:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Rule 3: 2-Column Standard Form Alignment (320px Left Column)
   ========================================================================== */
.aiedu-form-row-2col {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--aiedu-border);
    gap: 24px;
}

.aiedu-form-col-left {
    width: 320px;
    flex-shrink: 0;
}

.aiedu-form-title-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--aiedu-text);
    display: flex;
    align-items: center;
    margin: 0;
}

.aiedu-form-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Input Fields inside Form */
.aiedu-cms-input,
.aiedu-form-col-right input[type="text"],
.aiedu-form-col-right input[type="date"],
.aiedu-form-col-right input[type="number"],
.aiedu-form-col-right select,
.aiedu-form-col-right textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--aiedu-text);
    background: var(--aiedu-surface);
    border: 1px solid var(--aiedu-border-strong);
    border-radius: var(--aiedu-radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.aiedu-cms-input:focus,
.aiedu-form-col-right input:focus,
.aiedu-form-col-right select:focus,
.aiedu-form-col-right textarea:focus {
    border-color: var(--aiedu-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--aiedu-primary-light);
}

/* ==========================================================================
   Academic Tables
   ========================================================================== */
.aiedu-cms-table-wrapper {
    background: var(--aiedu-surface);
    border: 1px solid var(--aiedu-border);
    border-radius: var(--aiedu-radius);
    overflow: hidden;
    box-shadow: var(--aiedu-shadow);
}

.aiedu-cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    text-align: left;
}

.aiedu-cms-table th {
    background: var(--aiedu-surface-subtle);
    color: #0f172a;
    font-weight: 700;
    font-size: 14.5px;
    padding: 13px 14px;
    border-bottom: 2px solid var(--aiedu-border-strong);
    white-space: nowrap;
    letter-spacing: 0.015em;
}

.aiedu-cms-table thead tr:first-child th {
    color: #0f172a;
    font-weight: 700;
    font-size: 14.5px;
    border-bottom: 2px solid var(--aiedu-border-strong);
}

.aiedu-platform-root[data-theme="dark"] .aiedu-cms-table th,
.aiedu-platform-root[data-theme="dark"] .aiedu-cms-table thead tr:first-child th {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

.aiedu-cms-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--aiedu-border);
    color: var(--aiedu-text);
    vertical-align: middle;
    font-size: 14.5px;
    line-height: 1.5;
}

.aiedu-cms-table tbody tr:hover {
    background-color: var(--aiedu-surface-hover);
}

/* Column Filter Row in Table Header */
.aiedu-table-filter-row th {
    padding: 6px 10px;
    background: var(--aiedu-surface);
    border-bottom: 2px solid var(--aiedu-border);
}

.aiedu-col-filter-input,
.aiedu-col-filter-select {
    width: 100%;
    height: 30px;
    padding: 0 6px;
    font-size: 12.5px;
    font-weight: 500;
    border: 1px solid var(--aiedu-border-strong);
    border-radius: var(--aiedu-radius-sm);
    background-color: var(--aiedu-surface) !important;
    color: var(--aiedu-text) !important;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
    cursor: pointer;
}

.aiedu-col-filter-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.aiedu-col-filter-input:focus,
.aiedu-col-filter-select:focus {
    border-color: var(--aiedu-primary);
    box-shadow: 0 0 0 2px var(--aiedu-primary-light);
}

/* Specific Dark Mode overrides for dropdown contrast */
.aiedu-platform-root[data-theme="dark"] .aiedu-col-filter-input,
.aiedu-platform-root[data-theme="dark"] .aiedu-col-filter-select {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-col-filter-select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Future Tasks Highlight (Bold Green & Soft Green Background) */
.aiedu-cms-table tbody tr.aiedu-row-future {
    color: #15803d !important;
    font-weight: 700 !important;
    background-color: rgba(34, 197, 94, 0.08) !important;
}

.aiedu-cms-table tbody tr.aiedu-row-future td {
    color: #15803d !important;
    font-weight: 700 !important;
}

.aiedu-cms-table tbody tr.aiedu-row-future:hover {
    background-color: rgba(34, 197, 94, 0.14) !important;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-cms-table tbody tr.aiedu-row-future {
    color: #4ade80 !important;
    background-color: rgba(34, 197, 94, 0.15) !important;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-cms-table tbody tr.aiedu-row-future td {
    color: #4ade80 !important;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-cms-table tbody tr.aiedu-row-future:hover {
    background-color: rgba(34, 197, 94, 0.22) !important;
}

.aiedu-action-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aiedu-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--aiedu-radius-sm);
    border: 1px solid var(--aiedu-border);
    background: var(--aiedu-surface);
    color: var(--aiedu-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.aiedu-action-btn.delete:hover {
    color: var(--aiedu-accent-danger);
    border-color: var(--aiedu-accent-danger);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.aiedu-cms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    overflow-y: auto;
    padding: 40px 16px;
}

.aiedu-cms-modal-content {
    background: var(--aiedu-surface);
    color: var(--aiedu-text);
    max-width: 600px;
    margin: auto;
    border-radius: var(--aiedu-radius);
    border: 1px solid var(--aiedu-border);
    box-shadow: var(--aiedu-shadow-lg);
    overflow: hidden;
    animation: aieduModalIn 0.2s ease-out;
}

@keyframes aieduModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.aiedu-cms-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.aiedu-cms-close {
    font-size: 20px;
    cursor: pointer;
    color: var(--aiedu-text-muted);
    line-height: 1;
}

.aiedu-cms-close:hover {
    color: var(--aiedu-accent-danger);
}

.aiedu-cms-form-group {
    padding: 12px 24px;
}

.aiedu-cms-form-group label,
.aiedu-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--aiedu-text);
}

/* ==========================================================================
   Academic Sub-Tabs Navigation (3D Luxury Hub)
   ========================================================================== */
.aiedu-subtabs-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 6px;
    background: var(--aiedu-surface-subtle);
    border: 1px solid var(--aiedu-border-strong);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aiedu-subtab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    padding: 0 20px;
    background: linear-gradient(180deg, var(--aiedu-surface) 0%, var(--aiedu-surface-subtle) 100%);
    border: 1px solid var(--aiedu-border-strong);
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--aiedu-text);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    outline: none;
    position: relative;
}

.aiedu-subtab-btn svg {
    transition: transform 0.2s ease;
}

.aiedu-subtab-btn:hover {
    transform: translateY(-2px);
    color: var(--aiedu-text);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.aiedu-subtab-btn:hover svg {
    transform: scale(1.08);
}

.aiedu-subtab-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* 3D Active State: Teaching Statistics (Royal Blue 3D Gradient) */
.aiedu-subtab-btn[data-subtab="teaching"].active {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    color: #ffffff !important;
    font-weight: 700;
    border-color: #1e40af;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45), 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.aiedu-subtab-btn[data-subtab="teaching"].active svg {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.aiedu-subtab-btn[data-subtab="teaching"].active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.aiedu-subtab-btn[data-subtab="teaching"].active:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 3D Active State: Research Statistics (Imperial Purple 3D Gradient) */
.aiedu-subtab-btn[data-subtab="research"].active {
    background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
    color: #ffffff !important;
    font-weight: 700;
    border-color: #6b21a8;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.45), 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.aiedu-subtab-btn[data-subtab="research"].active svg {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.aiedu-subtab-btn[data-subtab="research"].active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.55), 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.aiedu-subtab-btn[data-subtab="research"].active:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Dark Mode 3D Enhancements */
.aiedu-platform-root[data-theme="dark"] .aiedu-subtabs-nav {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

.aiedu-platform-root[data-theme="dark"] .aiedu-subtab-btn {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.aiedu-platform-root[data-theme="dark"] .aiedu-subtab-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.aiedu-platform-root[data-theme="dark"] .aiedu-subtab-btn[data-subtab="teaching"].active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-color: #60a5fa;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.55), 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.aiedu-platform-root[data-theme="dark"] .aiedu-subtab-btn[data-subtab="research"].active {
    background: linear-gradient(135deg, #6b21a8 0%, #a855f7 100%);
    border-color: #c084fc;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.55), 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.aiedu-chart-card {
    background: var(--aiedu-surface);
    border: 1px solid var(--aiedu-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.aiedu-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.aiedu-chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--aiedu-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.aiedu-chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ==========================================================================
   Hero Banner & Badges (Prominent Top Row)
   ========================================================================== */
.aiedu-card-hero {
    background: linear-gradient(135deg, var(--aiedu-surface) 0%, var(--aiedu-surface-subtle) 100%);
    border: 1px solid var(--aiedu-border);
    border-top: 4px solid var(--aiedu-primary);
    border-radius: var(--aiedu-radius);
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: var(--aiedu-shadow);
}

.aiedu-hero-subtext {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--aiedu-text);
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}

.aiedu-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.4;
    background: var(--aiedu-surface);
    border: 1px solid var(--aiedu-border-strong);
    color: var(--aiedu-text);
}

.aiedu-hero-badge.badge-primary {
    background: rgba(37, 99, 235, 0.09);
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--aiedu-primary);
}

.aiedu-hero-badge.badge-success {
    background: rgba(16, 185, 129, 0.09);
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
}

.aiedu-hero-badge.badge-warning {
    background: rgba(245, 158, 11, 0.09);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.aiedu-hero-badge.badge-purple {
    background: rgba(147, 51, 234, 0.09);
    border-color: rgba(147, 51, 234, 0.3);
    color: #9333ea;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-hero-badge.badge-primary {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-hero-badge.badge-success {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-hero-badge.badge-warning {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.aiedu-platform-root[data-theme="dark"] .aiedu-hero-badge.badge-purple {
    background: rgba(168, 85, 247, 0.16);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
}

/* ==========================================================================
   2-Column Side-by-Side Chart Grid
   ========================================================================== */
.aiedu-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.aiedu-chart-grid .aiedu-chart-card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aiedu-chart-grid .aiedu-chart-container {
    flex: 1;
    min-height: 310px;
}

@media (max-width: 980px) {
    .aiedu-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Responsive & Mobile Touch Targets (>= 48px)
   ========================================================================== */
@media (max-width: 768px) {
    .aiedu-platform-root,
    .aiedu-cms-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
    }

    .aiedu-cms-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--aiedu-border);
    }

    .aiedu-cms-menu {
        display: flex;
        overflow-x: auto;
        padding: 4px;
    }

    .aiedu-cms-tab {
        min-height: 48px;
        padding: 10px 16px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .aiedu-cms-tab.active {
        border-left: none;
        border-bottom-color: var(--aiedu-primary);
    }

    .aiedu-form-row-2col {
        flex-direction: column;
        gap: 8px;
    }

    .aiedu-form-col-left {
        width: 100%;
    }

    .aiedu-single-row-toolbar {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   AI Assistant (WordPress 7.1 AI Connector) Styles & Keyframe Animations
   ========================================================================== */
.aiedu-btn-ai {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #8b5cf6 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}
.aiedu-btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5) !important;
    filter: brightness(1.06);
}
@keyframes aieduAiPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}
@keyframes aieduAiProgress {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 60%; }
    100% { transform: translateX(350%); width: 30%; }
}

