/* ========== CSS Variables ========== */
:root {
    --primary: #1677ff;
    --primary-light: #e6f4ff;
    --primary-dark: #0958d9;
    --success: #52c41a;
    --success-light: #f6ffed;
    --warning: #faad14;
    --warning-light: #fffbe6;
    --danger: #ff4d4f;
    --danger-light: #fff2f0;
    --info: #1677ff;
    
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-placeholder: #999999;
    --border: #e8e8e8;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #001529;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --sidebar-width: 240px;
    --topbar-height: 60px;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    color: var(--primary);
}

.sidebar-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(22,119,255,0.15);
    color: #fff;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.admin-details {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-size: 14px;
    font-weight: 500;
}

.admin-role {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== Top Bar ========== */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    font-size: 20px;
    color: var(--text-secondary);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
}

.search-box input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 16px 0 36px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

.top-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
}

.action-btn:hover {
    background: var(--bg-page);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Page Content ========== */
.page-content {
    flex: 1;
    padding: 24px;
}

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

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #389e0d;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #cf1322;
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========== Tables ========== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table th {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.data-table tr:hover td {
    background: #fafbfc;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

/* ========== Tags/Badges ========== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: #f5f5f5; color: var(--text-secondary); }

/* ========== Forms ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,119,255,0.1);
}

.form-textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ========== Filters ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.filter-bar .form-select,
.filter-bar .form-input {
    width: auto;
    min-width: 150px;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-page);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

.toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-message {
    font-size: 14px;
    flex: 1;
}

/* ========== Dashboard Charts ========== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #f0f5ff 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
}

/* Simple CSS Charts */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 40px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Donut Chart */
.donut-chart {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-visual {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.donut-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-value {
    font-size: 13px;
    font-weight: 600;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-item {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* ========== Content Management Specific ========== */
.content-section {
    margin-bottom: 24px;
}

.content-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.school-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.school-card:hover {
    box-shadow: var(--shadow-sm);
}

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

.school-name {
    font-weight: 600;
    font-size: 15px;
}

.school-majors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.major-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ========== Notification List ========== */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.notification-dot.unread {
    background: var(--danger);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 500;
}

.notification-time {
    font-size: 12px;
    color: var(--text-placeholder);
    margin-top: 2px;
}

/* ========== Progress Bar ========== */
.progress-bar {
    height: 8px;
    background: var(--bg-page);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* ========== Agent Card ========== */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

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

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.agent-name {
    font-weight: 600;
    font-size: 15px;
}

.agent-level {
    font-size: 12px;
    color: var(--text-secondary);
}

.agent-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.agent-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.agent-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== QR Code ========== */
.qr-code-box {
    width: 120px;
    height: 120px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.qr-code-box i {
    font-size: 48px;
    color: var(--text-placeholder);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .form-select,
    .filter-bar .form-input {
        width: 100%;
    }
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-content > * {
    animation: fadeIn 0.3s ease;
}

/* ========== Loading ========== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== Video Management ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.video-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

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

.video-thumb {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.video-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== Toggle Switch ========== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ========== Countdown ========== */
.countdown-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.countdown-item {
    text-align: center;
}

.countdown-number {
    background: var(--danger);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 700;
    min-width: 36px;
}

.countdown-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.countdown-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* ========== AI Test Chat ========== */
.ai-test-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.ai-test-msg.user {
    flex-direction: row-reverse;
}
.ai-test-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ai-test-msg.user .ai-test-avatar {
    background: var(--success);
}
.ai-test-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
    border: 1px solid var(--border);
    word-break: break-word;
}
.ai-test-msg.user .ai-test-bubble {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.ai-test-msg.thinking .ai-test-bubble {
    background: var(--bg-page);
    color: var(--text-secondary);
    font-style: italic;
}
.ai-test-msg.error .ai-test-bubble {
    background: #fff0f0;
    border-color: var(--danger);
    color: var(--danger);
}

/* ========== Top Questions ========== */
.top-questions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.top-q-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-page);
    border-radius: 8px;
}
.top-q-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.top-q-item:nth-child(1) .top-q-rank { background: #e74c3c; }
.top-q-item:nth-child(2) .top-q-rank { background: #e67e22; }
.top-q-item:nth-child(3) .top-q-rank { background: #f39c12; }
.top-q-text {
    flex: 1;
    font-size: 14px;
}
.top-q-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* ========== Form Static ========== */
.form-static {
    padding: 8px 12px;
    background: var(--bg-page);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    min-height: 36px;
    display: flex;
    align-items: center;
}

/* ========== Video Upload ========== */
.video-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-page);
}
.video-upload-zone:hover, .video-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(22, 119, 255, 0.04);
}
.video-upload-zone .upload-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 8px;
}
.video-upload-zone .upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}
.video-upload-zone .upload-hint {
    font-size: 12px;
    color: var(--text-placeholder);
    margin-top: 4px;
}
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.video-item {
    background: var(--bg-page);
    border-radius: 10px;
    padding: 12px;
    position: relative;
}
.video-item .video-thumb {
    width: 100%;
    height: 110px;
    background: #1a1a2e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    margin-bottom: 8px;
}
.video-item .video-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-item .video-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.video-item .video-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.video-item .video-actions button {
    flex: 1;
}


/* ========== [NEW] 1. Reminder Panel (Follow-up Bell) ========== */
.reminder-wrapper {
    position: relative;
}
.reminder-panel {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 200;
    animation: modalIn 0.2s ease;
}
.reminder-panel.active {
    display: block;
}
.reminder-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
}
.reminder-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.reminder-panel-body {
    max-height: 320px;
    overflow-y: auto;
}
.reminder-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}
.reminder-item:hover {
    background: #fafbfc;
}
.reminder-item:last-child {
    border-bottom: none;
}
.reminder-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.reminder-dot.red { background: var(--danger); }
.reminder-dot.orange { background: var(--warning); }
.reminder-dot.yellow { background: #f5d00f; }
.reminder-item-content {
    flex: 1;
}
.reminder-item-text {
    font-size: 13px;
    line-height: 1.5;
}
.reminder-item-text.red { color: var(--danger); }
.reminder-item-text.orange { color: #d48806; }
.reminder-item-text.yellow { color: #b8a100; }
.reminder-item-time {
    font-size: 11px;
    color: var(--text-placeholder);
    margin-top: 2px;
}

/* ========== [NEW] 2. Export/Import Buttons ========== */
.btn-group-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== [NEW] 3. Batch Import Upload Panel ========== */
.import-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-page);
    margin-bottom: 16px;
}
.import-upload-zone:hover, .import-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(22, 119, 255, 0.04);
}
.import-upload-zone .upload-icon {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 8px;
}
.import-upload-zone .upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}
.import-upload-zone .upload-hint {
    font-size: 12px;
    color: var(--text-placeholder);
    margin-top: 4px;
}
.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}
.import-preview-table th,
.import-preview-table td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: left;
}
.import-preview-table th {
    background: var(--bg-page);
    font-weight: 600;
}

/* ========== [NEW] 4. Canvas Charts ========== */
.canvas-chart-container {
    position: relative;
    width: 100%;
}
.canvas-chart-container canvas {
    width: 100%;
    display: block;
}
.chart-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 10;
    white-space: nowrap;
}

/* ========== [NEW] 5. Student Timeline Profile ========== */
.student-profile-expanded {
    animation: fadeIn 0.3s ease;
}
.student-info-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-light), #f0f5ff);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}
.student-info-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.student-info-details {
    flex: 1;
}
.student-info-details h3 {
    font-size: 16px;
    margin-bottom: 4px;
}
.student-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.timeline-container {
    position: relative;
    padding-left: 28px;
    margin-bottom: 20px;
}
.timeline-line {
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -21px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
    z-index: 1;
}
.timeline-dot.completed {
    background: var(--primary);
}
.timeline-dot.current {
    background: var(--warning);
    border-color: var(--warning);
    box-shadow: 0 0 0 4px rgba(250,173,20,0.2);
}
.timeline-content {
    padding: 8px 12px;
    background: var(--bg-page);
    border-radius: 8px;
    font-size: 13px;
}
.timeline-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
}
.timeline-content .timeline-time {
    font-size: 11px;
    color: var(--text-placeholder);
    margin-top: 2px;
}
.followup-list {
    margin-bottom: 16px;
}
.followup-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.followup-item:last-child {
    border-bottom: none;
}
.followup-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.followup-item-content {
    flex: 1;
}
.followup-item-content strong {
    display: block;
    margin-bottom: 2px;
}
.followup-item-time {
    font-size: 11px;
    color: var(--text-placeholder);
}
.add-followup-inline {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.add-followup-inline input {
    flex: 1;
}
.operation-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px dashed #f0f0f0;
}
.operation-log-item:last-child {
    border-bottom: none;
}
.operation-log-item .log-time {
    color: var(--text-placeholder);
    white-space: nowrap;
}

/* ========== [NEW] 6. Coupon Management ========== */
.coupon-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}
.coupon-card:hover {
    box-shadow: var(--shadow-sm);
}
.coupon-left {
    flex: 1;
}
.coupon-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.coupon-detail {
    font-size: 13px;
    color: var(--text-secondary);
}
.coupon-value {
    min-width: 100px;
    text-align: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 16px;
}
.coupon-value.discount-type {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* ========== [NEW] 7. Delete Confirmation Dialog ========== */
.confirm-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    animation: fadeIn 0.15s ease;
}
.confirm-dialog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.confirm-dialog-icon {
    font-size: 40px;
    color: var(--danger);
    margin-bottom: 12px;
}
.confirm-dialog-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.confirm-dialog-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-dialog-buttons .btn {
    min-width: 100px;
}

/* ========== [NEW] 8. Skeleton Screen ========== */
.skeleton-container {
    padding: 0;
}
.skeleton {
    background: #e8e8e8;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeletonShimmer 1.5s infinite;
}
@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.skeleton-header {
    height: 28px;
    width: 200px;
    margin-bottom: 8px;
}
.skeleton-subtitle {
    height: 16px;
    width: 300px;
    margin-bottom: 24px;
}
.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.skeleton-stat-card {
    height: 90px;
    border-radius: var(--radius-md);
    background: #e8e8e8;
    position: relative;
    overflow: hidden;
}
.skeleton-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeletonShimmer 1.5s infinite;
}
.skeleton-table {
    width: 100%;
}
.skeleton-table-row {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.skeleton-cell {
    height: 16px;
    background: #e8e8e8;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.skeleton-cell::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeletonShimmer 1.5s infinite;
}
.skeleton-chart {
    height: 200px;
    border-radius: var(--radius-md);
    background: #e8e8e8;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.skeleton-chart::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeletonShimmer 1.5s infinite;
}

/* ========== [NEW] 9. Enhanced Toast ========== */
.toast-container {
    z-index: 2000;
}
.toast {
    animation: toastSlideIn 0.3s ease;
}
.toast.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}
@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
