/* 速学慧ERP - 自定义样式 */
:root {
    --sidebar-width: 240px;
}

body {
    background: #1a1d23;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #212529;
    border-right: 1px solid #2c3034;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: #adb5bd;
    border-radius: 8px;
    margin: 2px 0;
    padding: 10px 12px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background: #2c3034;
    color: #fff;
}

.sidebar .nav-link.active {
    background: #0d6efd;
    color: #fff;
}

/* 主内容区 */
.main-content {
    flex: 1;
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
}

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: 8px 12px !important;
        flex-direction: row !important;
        overflow-x: auto;
    }
    .sidebar hr { display: none; }
    .sidebar .nav {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
    }
    .sidebar .nav-link {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    .sidebar .nav-link span { display: none; }
    .sidebar .dropdown { display: none; }
    .sidebar > a { display: none !important; }
    .main-content {
        max-width: 100vw;
        padding: 12px !important;
    }
    /* 表格在手机上自动变小 */
    .table {
        font-size: 0.75rem;
    }
    .table td, .table th {
        padding: 4px 4px !important;
        white-space: nowrap;
    }
    .btn-sm {
        padding: 2px 6px !important;
        font-size: 0.7rem;
    }
    .card-body {
        padding: 8px !important;
    }
    /* 手机端只显示关键列 */
    /* 伴学师: 显 姓名[2] 电话[4] 科目[6] 状态[10] 操作[11] */
    #tutorTable th:nth-child(1), #tutorTable td:nth-child(1),
    #tutorTable th:nth-child(3), #tutorTable td:nth-child(3),
    #tutorTable th:nth-child(5), #tutorTable td:nth-child(5),
    #tutorTable th:nth-child(7), #tutorTable td:nth-child(7),
    #tutorTable th:nth-child(8), #tutorTable td:nth-child(8),
    #tutorTable th:nth-child(9), #tutorTable td:nth-child(9) { display: none; }
    /* 学员: 显 姓名[2] 年级[4] 家长电话[6] 状态[9] 操作[11] */
    #studentTable th:nth-child(1), #studentTable td:nth-child(1),
    #studentTable th:nth-child(3), #studentTable td:nth-child(3),
    #studentTable th:nth-child(5), #studentTable td:nth-child(5),
    #studentTable th:nth-child(7), #studentTable td:nth-child(7),
    #studentTable th:nth-child(8), #studentTable td:nth-child(8),
    #studentTable th:nth-child(10), #studentTable td:nth-child(10) { display: none; }
    /* 家长: 显 姓名[2] 电话[3] 微信[4] 关系[5] */
    #parentTable th:nth-child(1), #parentTable td:nth-child(1),
    #parentTable th:nth-child(6), #parentTable td:nth-child(6),
    #parentTable th:nth-child(7), #parentTable td:nth-child(7),
    #parentTable th:nth-child(8), #parentTable td:nth-child(8),
    #parentTable th:nth-child(9), #parentTable td:nth-child(9) { display: none; }
    /* 上课记录(7列): 全部保留到手机上也能看，只隐藏 质量[6] */
    #sessionTable th:nth-child(6), #sessionTable td:nth-child(6) { display: none; }
    /* B端: 显 名称[2] 联系人[3] 电话[4] 城市[5] 状态[10] */
    #franchiseeTable th:nth-child(1), #franchiseeTable td:nth-child(1),
    #franchiseeTable th:nth-child(6), #franchiseeTable td:nth-child(6),
    #franchiseeTable th:nth-child(7), #franchiseeTable td:nth-child(7),
    #franchiseeTable th:nth-child(8), #franchiseeTable td:nth-child(8),
    #franchiseeTable th:nth-child(9), #franchiseeTable td:nth-child(9) { display: none; }
    /* 班级: 显 名称[2] 科目[3] 年级[4] 伴学师[5] 时间[6] 状态[10] */
    #classTable th:nth-child(1), #classTable td:nth-child(1),
    #classTable th:nth-child(7), #classTable td:nth-child(7),
    #classTable th:nth-child(8), #classTable td:nth-child(8),
    #classTable th:nth-child(9), #classTable td:nth-child(9) { display: none; }
}

/* 统计卡片 */
.stat-card {
    border-left: 4px solid;
    border-radius: 12px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* 统计卡片图标 */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* 表格 */
.table th {
    border-top: none;
    border-bottom: 2px solid #2c3034;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
}

/* 卡片 */
.card {
    border: 1px solid #2c3034;
    border-radius: 12px;
    background: #212529;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #2c3034;
    padding: 12px 16px;
    font-weight: 600;
}

/* 标签 */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

/* 按钮 */
.btn {
    border-radius: 8px;
    padding: 6px 16px;
}

/* 表单 */
.form-control, .form-select {
    border-radius: 8px;
    background: #2c3034;
    border: 1px solid #373b3e;
    color: #fff;
}

.form-control:focus, .form-select:focus {
    background: #2c3034;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* 模态框 */
.modal-content {
    background: #212529;
    border: 1px solid #2c3034;
}

/* 列表组 */
.list-group-item {
    background: transparent;
    border-color: #2c3034;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 36px;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1d23;
}

::-webkit-scrollbar-thumb {
    background: #373b3e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* ===== 侧边栏折叠分组 ===== */
.sidebar-section {
    margin-top: 4px;
}

.section-toggle {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    padding: 10px 12px !important;
    border-radius: 8px;
    color: #adb5bd;
    transition: all 0.2s;
}

.section-toggle:hover {
    background: #2c3034;
    color: #fff;
}

.section-toggle.active-section {
    color: #fff;
    background: rgba(13, 110, 253, 0.15);
}

.section-toggle .toggle-icon {
    transition: transform 0.2s;
    font-size: 0.75rem;
    margin-top: 4px;
}

.section-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-submenu {
    padding-left: 8px;
}

.sidebar-submenu .sub-link {
    padding: 7px 12px 7px 28px !important;
    margin: 1px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #9aa0a6;
    transition: all 0.15s;
}

.sidebar-submenu .sub-link:hover {
    background: #2c3034;
    color: #fff;
}

.sidebar-submenu .sub-link.active {
    background: #0d6efd;
    color: #fff;
}

.sidebar-submenu .sub-link i {
    font-size: 0.85rem;
    width: 16px;
}

/* ===== 折叠动画平滑 ===== */
.collapsing {
    transition: height 0.15s ease;
}

/* 学员详情页面的选项卡 */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section .card-header {
    cursor: pointer;
    user-select: none;
}

.detail-section .card-header:hover {
    background: rgba(255,255,255,0.02);
}

/* 右上角浮动备忘录面板 */
.memo-float {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    width: 320px;
}
.memo-float-card {
    background: #212529;
    border: 1px solid #2c3034;
    border-radius: 12px;
}
.memo-float-header {
    background: #2c3034;
    color: #fff;
    border-radius: 12px 12px 0 0;
    padding: 10px 14px;
    user-select: none;
}
.memo-float-body {
    padding: 10px 14px;
    color: #adb5bd;
}
.memo-float-body .form-control {
    background: #1a1d23;
    color: #e9ecef;
    border-color: #2c3034;
}
.memo-float-body .list-group-item {
    background: transparent;
    border-color: #2c3034;
    color: #adb5bd;
}
.memo-float-body .form-control::placeholder {
    color: #6c757d;
}
@media (max-width: 768px) {
    .memo-float {
        width: 280px;
        right: 10px;
        top: 10px;
    }
}
