/* ============================================================
   2026暑假排课 v2.10 - Gemini 风格控制台实验版
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #eef1f4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
}

.ds-login-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: #0a0f18;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.34) 0%, rgba(10, 15, 24, 0) 48%),
        linear-gradient(180deg, #101827 0%, #070b12 100%);
    color: #ffffff;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.ds-login-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ds-login-card {
    width: 100%;
    max-width: 420px;
    padding: 46px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(16, 24, 39, 0.58);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
    text-align: center;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    transform: translateY(18px);
    opacity: 0;
    animation: cardFloatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.16s;
}

@keyframes cardFloatUp {
    to { transform: translateY(0); opacity: 1; }
}

.ds-brand-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 24px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.32);
    overflow: hidden;
}

.ds-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-title {
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 700;
}

.ds-subtitle {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.ds-login-status {
    min-height: 38px;
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.35;
}

.ds-login-status.warning {
    border-color: rgba(251, 191, 36, 0.32);
    background: rgba(120, 53, 15, 0.28);
    color: #fde68a;
}

.ds-login-status.success {
    border-color: rgba(16, 185, 129, 0.34);
    background: rgba(6, 78, 59, 0.28);
    color: #a7f3d0;
}

.ds-login-status.loading {
    border-color: rgba(96, 165, 250, 0.36);
    color: #bfdbfe;
}

.ds-form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 26px;
}

.ds-input {
    width: 100%;
    min-height: 48px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ds-input::placeholder {
    color: #64748b;
}

.ds-input:focus {
    border-color: #60a5fa;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.ds-btn-enter {
    width: 100%;
    min-height: 49px;
    border: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 800;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, opacity 0.18s;
}

.ds-btn-enter:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
}

.ds-btn-enter:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.ds-login-note {
    margin: 16px 0 0;
    color: #718096;
    font-size: 0.76rem;
    line-height: 1.5;
}

.container {
    width: 210mm;
    height: 297mm;
    background: white;
    padding: 10mm;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
    position: relative;
}

.month-block { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; }
.month-block + .month-block { padding-top: 5px; border-top: 1px solid #f1f5f9; }
.version-stamp {
    position: absolute;
    right: 10mm;
    bottom: 4mm;
    text-align: right;
    color: #a6adb5;
    font-size: 0.54rem;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
}
h2 { text-align: center; font-size: 1.08rem; margin: 0 0 6px; color: #2f3842; font-weight: 700; }
table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { border: 1px solid #f1f5f9; text-align: center; vertical-align: top; }
th { background: #f6f7f9; padding: 2px; font-weight: 500; font-size: 0.85rem; height: 25px; color: #56606b; }
td { padding: 0; }
tbody tr { height: calc((100% - 25px) / 6); }
.date-num { background: #fbfcfe; color: #2f3842; border-bottom: 1px solid #f1f5f9; font-weight: 750; padding: 2px 6px; font-size: 0.98rem; height: 24px; line-height: 20px; text-align: left; }
.weekend-cell .date-num { background: #f5f8fb; color: #46525e; }
.empty-cell { background: #fafafa; }

.time-grid { height: calc(100% - 24px); min-height: 20px; display: flex; flex-direction: column; position: relative; }
.tcell { flex: 1; position: relative; min-height: 0; cursor: pointer; transition: background-color 0.15s; }
.tcell:hover { background: #eef5fb; }
.tcell.lunch { background: #f0f1f2 !important; cursor: not-allowed; pointer-events: none; }
.tcell.booked { background: var(--student-color, #6c8ebf) !important; }
.tcell.booked.completed { opacity: 0.46; filter: saturate(0.78); }
.unavailable { background: repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 3px, #e0e0e0 3px, #e0e0e0 6px) !important; cursor: not-allowed; }
.anonymized { cursor: not-allowed !important; background: none !important; }
.anonymized-overlay { position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(45deg, #ededed, #ededed 4px, #d8d8d8 4px, #d8d8d8 8px); }

.booking-label {
    position: absolute;
    left: 4px;
    z-index: 2;
    color: #fff;
    font-weight: 600;
    font-size: 0.65rem;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
}
.avatar-img {
    width: 16px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(-1px 0 0 #fff) drop-shadow(1px 0 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(0 1px 0 #fff);
}
.booking-completed { opacity: 0.62; }
.time-label { position: absolute; right: 4px; z-index: 2; color: #9aa7b3; font-size: 0.46rem; font-weight: 400; white-space: nowrap; pointer-events: none; line-height: 1; transform: translateY(-50%); opacity: 0.9; text-shadow: none; }
.time-label-left { left: 4px; right: auto; }
.calendar-compact .booking-label {
    font-size: 0.58rem;
    gap: 0;
}
.calendar-compact .avatar-img { display: none; }
.calendar-compact .date-num { height: 22px; line-height: 18px; font-size: 0.9rem; padding: 2px 5px; }
.calendar-compact .time-grid { height: calc(100% - 22px); }
.calendar-compact .time-label { font-size: 0.42rem; opacity: 0.72; }

@media screen {
    .sidebar {
        position: sticky;
        top: 20px;
        width: 205px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 100;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    #statsSidebar {
        width: 265px;
    }
    .sidebar > section {
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: white;
        padding: 11px;
        border: 1px solid #dde1e6;
        box-shadow: 0 1px 0 rgba(28, 39, 49, 0.03);
    }
    .sidebar .section-title { font-size: 0.75rem; font-weight: 700; color: #3f4a55; margin-bottom: 2px; }
    .sidebar .section-subtitle { font-size: 0.68rem; font-weight: 600; color: #7b858f; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf0f3; }
    .sidebar .section-subtitle-first { margin-top: 0; padding-top: 0; border-top: 0; }
}

.action-btn {
    padding: 6px 10px;
    color: #3f4a55;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.15s, opacity 0.15s, transform 0.15s;
    text-align: center;
    background: #f3f6f8;
}
.action-btn:hover, .icon-btn:hover, .month-pill:hover { opacity: 0.9; }
.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.action-neutral { background: #f3f6f8; color: #3f4a55; border-color: transparent; }
.action-neutral:hover { background: #e9eef3; }
.action-blue { background: #5f7fa8; color: #fff; border-color: #5f7fa8; }
.action-green { background: #5f8f5a; color: #fff; border-color: #5f8f5a; }
.action-red { background: #bd3c32; color: #fff; border-color: #bd3c32; }
.lock-toggle-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; font-weight: 700; }
.lock-toggle-btn.action-green { background: #eef5ed; color: #4f754d; border-color: #cfe0cc; }
.lock-toggle-btn.action-red { background: #fff4f1; color: #a84b40; border-color: #edc9c3; }
.lock-svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.lock-text { line-height: 1; white-space: nowrap; }
.action-slate { background: #66737f; color: #fff; border-color: #66737f; }
.action-orange { background: #d37b34; color: #fff; border-color: #d37b34; }
.action-dark { background: #555; color: #fff; border-color: #555; }
.student-accent-btn { border-left: 4px solid var(--accent); padding-left: 7px; }

.teacher-btn { border: 2px solid transparent; opacity: 0.62; padding: 5px 4px; font-size: 0.72rem; font-weight: 600; color: white; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.teacher-btn.active { border-color: #303942; opacity: 1; }
.teacher-avatar {
    width: 18px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(-1px 0 0 rgba(255,255,255,0.9)) drop-shadow(1px 0 0 rgba(255,255,255,0.9)) drop-shadow(0 -1px 0 rgba(255,255,255,0.9)) drop-shadow(0 1px 0 rgba(255,255,255,0.9));
}
.teacher-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#studentButtons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
#studentButtons .teacher-btn {
    width: 100%;
}
.daily-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    background: #f7f9fb;
    border: 1px solid #edf0f3;
}
.daily-actions .action-btn {
    min-height: 30px;
    padding: 6px 4px;
    background: #fff;
    color: #46525e;
    border: 0;
    box-shadow: 0 1px 2px rgba(28, 39, 49, 0.06);
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}
.daily-actions .action-btn:hover {
    background: #eef4f8;
    transform: translateY(-1px);
}

.pref-row { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.pref-name { flex: 0 0 50px; font-size: 0.7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pref-btn { flex: 1; padding: 3px 0; border: 1px solid #d8dde3; background: #f8fafc; cursor: pointer; font-size: 0.62rem; text-align: center; color: #4d5965; }
.pref-btn.active { background: #5f7fa8; color: #fff; border-color: #5f7fa8; font-weight: 600; }

.btns-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.btns-2x2 .action-btn { font-size: 0.68rem; padding: 5px 4px; }
.export-global, .view-controls, .history-controls { display: flex; gap: 4px; }
.export-global .action-btn, .history-controls .action-btn { flex: 1; font-size: 0.7rem; }
.migration-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}
.migration-actions .action-btn {
    min-height: 28px;
    padding: 6px 8px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
    color: #46525e;
    font-size: 0.7rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}
.migration-actions .action-btn:hover {
    background: #eef4f8;
}
.backup-actions {
    padding: 3px;
    background: #f7f9fb;
    border: 1px solid #edf0f3;
}
.backup-actions .action-btn {
    min-height: 30px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(28, 39, 49, 0.05);
    font-weight: 650;
    white-space: nowrap;
}
.sidebar-details {
    background: #f8fafc;
    border: 1px solid #edf0f3;
    color: #4d5965;
}
.sidebar-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    padding: 6px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    user-select: none;
}
.sidebar-details summary::-webkit-details-marker { display: none; }
.sidebar-details summary::after {
    content: '展开 ▾';
    color: #8a949e;
    font-size: 0.62rem;
    font-weight: 500;
    white-space: nowrap;
}
.sidebar-details[open] summary {
    border-bottom: 1px solid #edf0f3;
}
.sidebar-details[open] summary::after { content: '收起 ▴'; }
.sidebar-details .btns-2x2 {
    padding: 6px;
}
.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}
.danger-actions .action-neutral {
    background: #fff7ed;
    color: #8a5a22;
}
.danger-actions .action-neutral:hover {
    background: #ffefd9;
}
.backup-status {
    padding: 6px 8px;
    border: 1px solid #edf0f3;
    background: #f7f9fb;
    color: #5d6670;
    font-size: 0.68rem;
    line-height: 1.35;
}
.sync-status {
    white-space: pre-line;
}
.data-flow-card {
    padding: 8px 0 10px;
    border-top: 1px solid #edf0f3;
}
.data-flow-card:first-of-type {
    border-top: 0;
    padding-top: 2px;
}
.data-flow-card .section-subtitle {
    margin-top: 0;
}
.data-help,
.data-note {
    margin: 3px 0 6px;
    color: #6d7884;
    font-size: 0.62rem;
    line-height: 1.4;
}
.data-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
}
.data-primary-actions.two {
    grid-template-columns: 1fr 1fr;
}
.data-primary-actions .action-btn,
.data-wide-action {
    min-height: 32px;
    padding: 7px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}
.data-wide-action {
    width: 100%;
    margin-top: 5px;
}
.data-maintenance-details {
    margin-top: 6px;
    background: transparent;
    border-color: #e6ebf0;
}
.data-maintenance-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
}
.compact-danger-actions .action-btn {
    min-height: 28px;
    padding: 6px 7px;
    font-size: 0.66rem;
    line-height: 1.1;
    white-space: nowrap;
}
.nested-details {
    background: #fff;
    border-color: #edf0f3;
}
.nested-details summary {
    padding: 5px 7px;
}
.nested-details > div {
    padding: 6px;
}
.mini-label {
    margin-top: 2px;
    color: #7b8792;
    font-size: 0.62rem;
    font-weight: 700;
}
.danger-copy {
    color: #9a6a2f;
}
.backup-status.warning {
    border-color: #dfc47a;
    background: #fff8df;
    color: #7a6220;
}
.hidden-file { display: none; }

.view-controls input { width: 100%; min-width: 0; border: 1px solid #d8dde3; padding: 5px; text-align: center; color: #3f4a55; }
.icon-btn { width: 30px; min-width: 30px; height: 30px; border: 1px solid #d8dde3; background: #f8fafc; cursor: pointer; font-size: 1rem; color: #3f4a55; }
.icon-btn.danger { color: #bd3c32; }
.month-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.month-pill { border: 1px solid #d8dde3; background: #f8fafc; padding: 4px 0; cursor: pointer; font-size: 0.65rem; color: #4d5965; }
.month-pill.active { background: #5a6875; color: white; border-color: #5a6875; }
.density-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; padding: 3px; background: #f7f9fb; border: 1px solid #edf0f3; }
.density-btn { border: 0; background: transparent; color: #64717d; cursor: pointer; padding: 5px 0; font-size: 0.66rem; font-weight: 650; }
.density-btn.active { background: #fff; color: #2f3842; box-shadow: 0 1px 2px rgba(28, 39, 49, 0.08); }

.slot-preview-batch { background: rgba(255,193,7,0.35) !important; outline: 2px dashed #ff9800 !important; outline-offset: -1px; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 500; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border: 1px solid #ddd; padding: 24px; width: 480px; max-width: 90vw; max-height: 85vh; overflow-y: auto; animation: modalIn 0.2s ease-out; }
.modal-small { width: 360px; }
.modal-wide { width: 980px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.modal h3 { margin: 0 0 16px; font-size: 1.1rem; color: #444; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.8rem; color: #666; margin-bottom: 4px; font-weight: 600; }
.form-group select, .form-group input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; font-size: 0.85rem; }
.day-checkboxes { display: flex; gap: 4px; flex-wrap: wrap; }
.day-checkboxes label { padding: 4px 8px; border: 1px solid #ddd; cursor: pointer; font-size: 0.75rem; }
.day-checkboxes input { display: none; }
.day-checkboxes input:checked + span { background: #6c8ebf; color: white; padding: 4px 8px; }
.preview-box { background: #fff9c4; padding: 8px; font-size: 0.75rem; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions button { flex: 1; padding: 10px; border: none; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: white; }
.btn-primary { background: #6c8ebf; }
.btn-ok { background: #5a9e5a; }
.btn-secondary { background: #999; }

.context-menu {
    display: none;
    position: fixed;
    z-index: 900;
    min-width: 170px;
    background: #fff;
    border: 1px solid #d9dee5;
    box-shadow: 0 10px 30px rgba(27, 38, 49, 0.18), 0 2px 6px rgba(27, 38, 49, 0.12);
    padding: 6px;
    color: #3f4a55;
}
.context-menu.active { display: block; }
.context-title {
    padding: 5px 8px 7px;
    border-bottom: 1px solid #edf1f5;
    color: #6f7a84;
    font-size: 0.7rem;
    font-weight: 650;
}
.context-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #3f4a55;
    text-align: left;
    padding: 8px;
    cursor: pointer;
    font-size: 0.78rem;
}
.context-menu button:hover { background: #f1f5f8; }
.context-menu button.danger { color: #bd3c32; }
.edit-meta {
    margin: -4px 0 14px;
    color: #6f7a84;
    font-size: 0.78rem;
}

.student-editor { display: flex; flex-direction: column; gap: 14px; }
.profile-options-panel {
    border: 1px solid #dce3ea;
    border-radius: 6px;
    background: #f8fafc;
    padding: 12px;
}
.profile-options-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.profile-options-head strong {
    color: #3f4a55;
    font-size: 0.86rem;
}
.profile-options-head span {
    color: #7b858f;
    font-size: 0.68rem;
}
.profile-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.profile-options-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.profile-options-grid label span {
    color: #6f7a84;
    font-size: 0.66rem;
    font-weight: 650;
}
.profile-options-grid small {
    color: #8a949e;
    font-size: 0.62rem;
    line-height: 1.4;
}
.profile-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}
.profile-option-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 4px;
    padding: 3px 6px;
    background: #eef3f7;
    border: 1px solid #dfe7ee;
    color: #4d5965;
    font-size: 0.62rem;
    line-height: 1.2;
}
.profile-option-chip > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-option-chip em {
    color: #94a0aa;
    font-style: normal;
    font-size: 0.56rem;
    white-space: nowrap;
}
.profile-option-chip button {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d9e2ea;
    color: #52606c;
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 14px;
}
.profile-option-chip button:hover {
    background: #bd3c32;
    color: #fff;
}
.inline-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
}
.inline-add input {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #d8dde3;
    background: #fff;
    color: #3f4a55;
    font: inherit;
    font-size: 0.78rem;
}
.inline-add .action-btn {
    padding: 7px 10px;
    font-size: 0.7rem;
    white-space: nowrap;
}
.profile-options-details #profileOptionsPanel {
    padding: 6px;
}
.sidebar .profile-options-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}
.sidebar .profile-options-head {
    display: none;
}
.sidebar .profile-options-grid {
    grid-template-columns: 1fr;
    gap: 8px;
}
.sidebar .profile-options-grid small {
    max-height: 42px;
    overflow: hidden;
}
.sidebar .profile-option-list {
    max-height: 76px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar .profile-option-chip {
    max-width: 100%;
}
.sidebar .inline-add {
    grid-template-columns: minmax(0, 1fr) 42px;
}
.sidebar .inline-add input {
    padding: 6px 7px;
    font-size: 0.7rem;
}
.sidebar .inline-add .action-btn {
    padding: 6px 0;
    font-size: 0.66rem;
}
.student-card {
    border: 1px solid #dce3ea;
    border-left: 6px solid var(--accent);
    border-radius: 6px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(33, 45, 58, 0.08), 0 1px 2px rgba(33, 45, 58, 0.08);
}
.student-card.student-disabled {
    opacity: 0.62;
    background: #f7f8fa;
}
.student-card-head {
    display: grid;
    grid-template-columns: auto 1fr 30px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid #edf1f5;
}
.student-card-head strong {
    color: #3f4a55;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.student-status-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 650;
    color: #4d5965;
    cursor: pointer;
}
.student-status-toggle input {
    width: auto;
    margin: 0;
}
.student-form-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.student-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.student-form-grid label span {
    color: #6f7a84;
    font-size: 0.66rem;
    font-weight: 650;
}
.student-form-grid input,
.student-form-grid select,
.student-form-grid textarea {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #d8dde3;
    background: #fff;
    color: #3f4a55;
    font: inherit;
    font-size: 0.78rem;
}
.student-form-grid textarea {
    resize: vertical;
    min-height: 58px;
}
.student-extra {
    margin-top: 10px;
    border-top: 1px solid #edf1f5;
    padding-top: 8px;
}
.student-extra summary {
    cursor: pointer;
    color: #5f6b76;
    font-size: 0.72rem;
    font-weight: 650;
    list-style: none;
    user-select: none;
}
.student-extra summary::-webkit-details-marker { display: none; }
.student-extra summary::after {
    content: ' 展开 ▾';
    color: #8a949e;
    font-size: 0.62rem;
    font-weight: 500;
}
.student-extra[open] summary::after { content: ' 收起 ▴'; }
.student-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 8px;
}
.student-editor-foot {
    color: #7b858f;
    font-size: 0.72rem;
    text-align: right;
}

.stat-cards { display: flex; flex-direction: column; gap: 5px; }
.scope-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; }
.scope-btn { border: 1px solid #d8dde3; background: #f8fafc; color: #4d5965; cursor: pointer; padding: 5px 0; font-size: 0.68rem; }
.scope-btn.active { background: #5a6875; color: #fff; border-color: #5a6875; font-weight: 600; }
.stat-card { padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.bill-card { background: #fbfcfd; color: #3f4a55; border: 1px solid #dde1e6; border-left: 5px solid var(--accent); }
.stat-value { font-size: 1.25rem; font-weight: bold; min-width: 50px; text-align: right; color: #2f3842; }
.stat-label { font-size: 0.68rem; opacity: 0.95; flex: 1; }
.stat-detail { font-size: 0.6rem; opacity: 0.75; }
.tuition-progress-card { position: relative; overflow: hidden; min-height: 58px; padding: 0; border-left: 0; }
.tuition-empty-card { border-left: 1px solid #dde1e6; }
.tuition-card-fill { position: absolute; inset: 0 auto 0 0; width: var(--progress); background: var(--accent); transition: width 0.2s ease; }
.tuition-empty-card .tuition-card-fill { display: none; }
.tuition-card-layer { position: absolute; inset: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; }
.tuition-card-base { color: #3f4a55; }
.tuition-card-contrast { color: #fff; clip-path: inset(0 calc(100% - var(--progress)) 0 0); pointer-events: none; }
.tuition-empty-card .tuition-card-contrast { display: none; }
.tuition-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; line-height: 1.15; }
.tuition-student { font-size: 0.68rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuition-progress-text { font-size: 0.6rem; opacity: 0.76; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.tuition-amount { min-width: 0; text-align: right; font-size: 1.28rem; font-weight: 800; color: #2f3842; letter-spacing: 0; white-space: nowrap; }
.tuition-card-contrast .tuition-student,
.tuition-card-contrast .tuition-progress-text,
.tuition-card-contrast .tuition-amount { color: #fff; }
.tuition-card-contrast .tuition-progress-text { opacity: 0.9; }

.config-banner { display: none; position: fixed; top: 0; left: 0; right: 0; background: #546e7a; color: white; padding: 8px 20px; z-index: 601; text-align: center; font-size: 0.85rem; }
.config-banner.active { display: block; }
.config-banner button { margin-left: 10px; padding: 3px 12px; border: 1.5px solid white; background: transparent; color: white; cursor: pointer; font-size: 0.75rem; }
.config-banner .btn-save { background: #5a9e5a; border-color: #5a9e5a; font-weight: bold; }
body.config-active { padding-top: 50px; }

#toast { visibility: hidden; min-width: 250px; background: #444; color: #fff; text-align: center; padding: 14px 20px; position: fixed; z-index: 1000; left: 50%; top: 20px; transform: translateX(-50%); font-size: 14px; opacity: 0; transition: opacity 0.25s, visibility 0.25s, top 0.25s; }
#toast.show { visibility: visible; opacity: 1; top: 30px; }

/* ============================================================
   v2.10 console skin
   ============================================================ */
:root {
    --text-main: #1e293b;
    --text-muted: #64748b;
    --line-soft: #e2e8f0;
    --line-strong: #cbd5e1;
    --panel-bg: #ffffff;
    --surface-bg: #f8fafc;
    --hover-bg: #f1f5f9;
    --page-bg: #eef1f4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --green: #10b981;
    --green-deep: #059669;
    --slate: #334155;
}

body {
    color: var(--text-main);
    background: var(--page-bg);
    gap: 18px;
    padding: 18px;
}

button,
input,
select {
    font-family: inherit;
}

@media screen {
    .sidebar {
        top: 18px;
        gap: 0;
        border: 1px solid var(--line-soft);
        border-radius: 12px;
        background: var(--panel-bg);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
        overflow-y: auto;
        scrollbar-width: thin;
    }

    .sidebar-left {
        width: 280px;
        flex: 0 0 280px;
        padding: 18px;
    }

    #statsSidebar.sidebar-right {
        width: 300px;
        flex: 0 0 300px;
        height: calc(100vh - 36px);
        padding: 20px;
        border-radius: 0 12px 12px 12px;
    }

    .sidebar > section {
        gap: 8px;
        padding: 0 0 22px;
        margin: 0 0 22px;
        border: 0;
        border-bottom: 1px solid var(--line-soft);
        background: transparent;
        box-shadow: none;
    }

    .sidebar > section:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .sidebar .section-title {
        display: block;
        margin: 0 0 10px;
        color: var(--text-muted);
        font-size: 0.74rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .sidebar .section-subtitle,
    .mini-label {
        margin-top: 10px;
        padding-top: 0;
        border-top: 0;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 750;
        letter-spacing: 0;
    }

    .sidebar .section-subtitle-first {
        margin-top: 0;
    }
}

.container {
    border-color: #f1f5f9;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    flex: 0 0 210mm;
}

h2 {
    color: var(--text-main);
}

.action-btn,
.icon-btn,
.month-pill,
.scope-btn,
.density-btn {
    border-radius: 6px;
}

.action-btn {
    min-height: 30px;
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 650;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}

.action-btn:hover,
.icon-btn:hover,
.month-pill:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.action-neutral {
    background: var(--surface-bg);
    color: var(--text-main);
    border-color: var(--line-soft);
}

.action-neutral:hover {
    background: var(--hover-bg);
    border-color: var(--line-strong);
}

.action-green {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.action-green:hover {
    background: var(--green-deep);
    border-color: var(--green-deep);
}

.action-red {
    background: var(--danger);
    border-color: var(--danger);
}

#studentButtons {
    gap: 6px;
    margin-bottom: 8px;
}

.teacher-btn {
    min-height: 38px;
    border-radius: 3px;
    padding: 7px 6px;
    font-size: 0.86rem;
    font-weight: 800;
    opacity: 0.84;
}

.teacher-btn.active {
    border-color: #1f2937;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.58), 0 3px 10px rgba(15, 23, 42, 0.13);
}

.teacher-avatar {
    width: 20px;
    height: 22px;
}

.daily-actions {
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

.daily-actions .action-btn,
.history-controls .action-btn {
    min-height: 32px;
    border: 1px dashed var(--line-strong);
    background: #fff;
    box-shadow: none;
}

.pref-row {
    gap: 8px;
    margin-bottom: 8px;
}

.pref-name {
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    color: var(--text-main) !important;
    font-size: 0.74rem;
}

.pref-name::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.pref-row {
    align-items: center;
}

.pref-row .pref-btn,
.scope-toggle,
.density-toggle {
    background: var(--hover-bg);
}

.pref-row .pref-btn {
    border: 0;
    color: var(--text-muted);
    padding: 5px 0;
}

.pref-row .pref-btn.active,
.scope-btn.active,
.density-btn.active {
    background: #fff;
    color: var(--text-main);
    border-color: transparent;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.view-controls {
    margin-bottom: 10px;
}

.view-controls input,
.form-group select,
.form-group input,
.student-form-grid input,
.student-form-grid select,
.inline-add input {
    border-radius: 6px;
    border-color: var(--line-strong);
}

.icon-btn {
    border-color: var(--line-soft);
    background: #fff;
}

.month-pills {
    gap: 6px;
}

.month-pill {
    padding: 6px 0;
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
}

.month-pill.active {
    background: var(--slate);
    border-color: var(--slate);
    color: #fff;
    font-weight: 700;
}

.density-toggle,
.scope-toggle {
    display: grid;
    gap: 0;
    padding: 4px;
    border: 0;
    border-radius: 8px;
}

.density-btn,
.scope-btn {
    border: 0;
    padding: 7px 0;
    background: transparent;
    font-size: 0.74rem;
    font-weight: 700;
}

.lock-toggle-btn.action-green,
.lock-toggle-btn.action-red {
    background: #fff;
    color: var(--text-main);
    border-color: var(--line-soft);
}

.lock-toggle-btn.action-red {
    color: #a84b40;
}

.data-flow-card {
    padding: 14px 0;
    border-top-color: var(--line-soft);
}

.data-help,
.data-note {
    color: var(--text-muted);
    font-size: 0.66rem;
}

.backup-status {
    border-radius: 8px;
    border-color: var(--line-soft);
    background: var(--surface-bg);
    color: #475569;
}

.data-primary-actions.two {
    gap: 8px;
}

.sidebar-details {
    border-radius: 8px;
    border-color: var(--line-soft);
    background: var(--surface-bg);
}

.sidebar-details summary {
    padding: 8px 10px;
    font-size: 0.72rem;
}

.sidebar-details summary::after {
    content: "展开 ▾";
}

.sidebar-details[open] summary::after {
    content: "收起 ▴";
}

.stats-shell {
    position: sticky;
    top: 18px;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    height: calc(100vh - 36px);
    z-index: 90;
}

.stats-toggle-handle {
    width: 24px;
    height: 64px;
    margin-top: 20px;
    border: 1px solid var(--line-soft);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-toggle-handle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s;
}

.stats-shell.collapsed .stats-toggle-handle svg {
    transform: rotate(180deg);
}

.stats-shell.collapsed .sidebar-right {
    width: 0 !important;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    border: 0;
    overflow: hidden;
}

.sidebar-right {
    transition: width 0.24s ease, opacity 0.18s ease, padding 0.24s ease, border 0.24s ease;
}

.stat-cards {
    gap: 8px;
}

.bill-card {
    border-radius: 6px;
    border-color: var(--line-soft);
    background: #fff;
}

.stat-card {
    min-height: 52px;
    padding: 10px 14px;
}

.stat-value {
    width: 64px;
    min-width: 64px;
    text-align: left;
    font-size: 1.24rem;
    font-weight: 850;
}

.stat-label {
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 750;
}

.stat-detail {
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 500;
}

.tuition-progress-card {
    min-height: 64px;
    border-radius: 6px;
}

.tuition-empty-card {
    border-left: 1px solid var(--line-soft);
}

.tuition-card-layer {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 8px 14px;
}

.tuition-amount {
    text-align: left;
    color: var(--text-main);
    font-size: 1.34rem;
}

.tuition-student {
    color: inherit;
    font-size: 0.82rem;
}

.tuition-progress-text {
    color: inherit;
    font-size: 0.64rem;
}

.modal-overlay {
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
}

.modal {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 6px 18px rgba(15, 23, 42, 0.12);
}

.modal h3 {
    color: var(--text-main);
}

.student-settings-modal {
    width: 900px;
    height: 620px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.student-settings-modal > h3 {
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1.08rem;
}

.student-settings-modal .student-editor {
    min-height: 0;
    flex: 1;
    gap: 0;
}

.student-settings-modal .modal-actions {
    margin: 0;
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
    background: var(--surface-bg);
}

.student-settings-modal .modal-actions [data-action="add-student"] {
    display: none;
}

.cloud-account-panel {
    border-left: 0;
}

.cloud-auth-status {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dbe7f7;
    border-radius: 8px;
    background: #f7fbff;
    color: #1f3557;
    font-weight: 700;
}

.cloud-not-ready .cloud-auth-status {
    border-color: #f4d9a8;
    background: #fff8e8;
    color: #7c4d05;
}

.cloud-signed-in .cloud-auth-status {
    border-color: #b9e6d4;
    background: #f2fff9;
    color: #0f6a46;
}

.cloud-auth-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.cloud-auth-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d6e0ee;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 14px;
}

.cloud-auth-input:disabled {
    background: #f4f7fb;
    color: #8190a5;
}

.cloud-auth-actions,
.cloud-data-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.cloud-data-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cloud-data-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f6f8fb;
    color: #476178;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

.cloud-auto-sync-status {
    margin-top: 8px;
    color: #0f766e;
    background: #eefdf9;
}

.cloud-sync-log {
    margin-top: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.cloud-sync-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-bg);
    color: var(--text-main);
    font-size: 0.74rem;
    font-weight: 800;
}

.cloud-sync-log-head small {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 650;
    white-space: nowrap;
}

.cloud-sync-log-list {
    max-height: 230px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cloud-sync-log-list.is-empty {
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.cloud-sync-log-item {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid #edf1f5;
}

.cloud-sync-log-item:first-child {
    border-top: 0;
}

.cloud-sync-log-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cloud-sync-log-time {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.cloud-sync-log-badge {
    width: fit-content;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eafaf4;
    color: #047857;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: nowrap;
}

.cloud-sync-log-item.is-error .cloud-sync-log-badge {
    background: #fef2f2;
    color: #b91c1c;
}

.cloud-sync-log-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cloud-sync-log-body strong {
    color: var(--text-main);
    font-size: 0.72rem;
    line-height: 1.35;
}

.cloud-sync-log-body small {
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .cloud-auth-form,
    .cloud-auth-actions,
    .cloud-data-actions {
        grid-template-columns: 1fr;
    }
}

.student-master-detail {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 0;
    height: 100%;
}

.student-editor-nav {
    min-height: 0;
    padding: 16px 12px;
    border-right: 1px solid var(--line-soft);
    background: var(--surface-bg);
    display: flex;
    flex-direction: column;
}

.btn-add-student {
    width: 100%;
    min-height: 36px;
    margin-bottom: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
}

.btn-add-student:hover {
    background: #fff;
    border-style: solid;
}

.student-nav-list {
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid transparent;
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    cursor: pointer;
}

.student-nav-item.active {
    border-left-color: var(--accent);
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.03), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.student-nav-disabled {
    opacity: 0.58;
}

.student-nav-info {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.student-nav-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 800;
}

.student-nav-status {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 750;
}

.student-nav-status.enabled {
    background: #d1fae5;
    color: var(--green-deep);
}

.student-detail-card {
    min-height: 0;
    overflow-y: auto;
    border: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 22px 28px;
}

.student-card-head {
    grid-template-columns: minmax(0, 1fr) auto 30px;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
}

.student-form-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-form-title .teacher-avatar {
    width: 30px;
    height: 34px;
}

.student-form-title strong {
    font-size: 1.2rem;
    font-weight: 850;
}

.student-form-section {
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--surface-bg);
}

.form-section-title {
    margin-bottom: 14px;
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 800;
}

.student-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.student-form-grid label span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.student-avatar-upload {
    display: grid;
    gap: 6px;
}

.student-avatar-upload > span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.student-avatar-upload > div {
    min-height: 38px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #ffffff;
}

.student-avatar-upload input[type="file"] {
    min-width: 0;
    width: 100%;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.student-avatar-upload small {
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
}

.student-form-grid input,
.student-form-grid select {
    min-height: 34px;
    font-size: 0.84rem;
}

.student-extra {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
}

.student-extra summary {
    color: #2563eb;
    font-size: 0.8rem;
}

.student-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--line-soft);
    border-radius: 8px;
}

.student-editor-foot {
    margin-top: auto;
    padding-top: 12px;
    color: var(--text-muted);
    text-align: left;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

/* ============================================================
   v2.10.1 global settings center and sidebar polish
   ============================================================ */
@media screen {
    .sidebar-left {
        padding: 0;
        overflow: hidden;
    }

    .sidebar-scrollable {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 18px 18px 0;
    }

    .sidebar-left .panel-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 0 0 22px;
        padding: 0 0 22px;
        border-bottom: 1px solid var(--line-soft);
    }

    .sidebar-left .panel-group:last-child {
        margin-bottom: 0;
        padding-bottom: 18px;
        border-bottom: 0;
    }

    .zone-bottom {
        flex: 0 0 auto;
        padding: 14px 18px 16px;
        border-top: 1px solid var(--line-soft);
        background: var(--surface-bg);
    }
}

.settings-btn {
    width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 750;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.settings-btn:hover {
    transform: translateY(-1px);
    border-style: solid;
    background: #fff;
    color: var(--text-main);
}

.settings-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.time-pref-matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pref-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.pref-name {
    flex: 0 0 74px;
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--text-main) !important;
    font-size: 0.76rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pref-name::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.student-pref-control {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 3px;
    border-radius: 8px;
    background: var(--hover-bg);
    box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.55);
}

.student-pref-control .pref-btn {
    min-height: 26px;
    padding: 5px 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;
    text-align: center;
}

.student-pref-control .pref-btn.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.global-settings-modal {
    width: 840px;
    max-width: calc(100vw - 48px);
    height: 620px;
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

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

.global-modal-header h3 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 850;
}

.global-modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.modal-close-icon {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.modal-close-icon:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.global-modal-body {
    height: calc(100% - 73px);
    display: grid;
    grid-template-columns: 184px minmax(0, 1fr);
    min-height: 0;
}

.global-modal-nav {
    min-height: 0;
    padding: 16px 12px;
    border-right: 1px solid var(--line-soft);
    background: var(--surface-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.global-nav-item {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 750;
}

.global-nav-item:hover {
    background: #eef3f7;
    color: var(--text-main);
}

.global-nav-item.active {
    background: #fff;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.global-modal-content {
    min-height: 0;
    overflow-y: auto;
    padding: 22px 28px 28px;
}

.global-tab-pane {
    display: none;
}

.global-tab-pane.active {
    display: block;
}

.setting-group {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line-soft);
}

.setting-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.setting-group h4 {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 850;
}

.setting-desc {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.55;
}

.settings-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.settings-wide-action {
    width: 100%;
    margin-top: 12px;
}

.danger-setting-group {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: var(--danger-soft);
}

.danger-setting-group h4,
.danger-setting-group .setting-desc {
    color: #991b1b;
}

.global-settings-modal .backup-status {
    padding: 10px 12px;
    font-size: 0.76rem;
}

.global-settings-modal .profile-options-panel {
    background: var(--surface-bg);
}

.global-settings-modal .btns-2x2 {
    gap: 8px;
}

/* ============================================================
   v2.10.2 global settings visual refinement
   ============================================================ */
.global-settings-modal {
    width: 900px;
    height: 650px;
}

.global-modal-header {
    padding: 22px 30px;
}

.global-modal-header h3 {
    font-size: 1.24rem;
}

.global-modal-body {
    height: calc(100% - 85px);
    grid-template-columns: 210px minmax(0, 1fr);
}

.global-modal-nav {
    padding: 28px 14px;
    gap: 8px;
    background: #f7f9fc;
}

.global-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 850;
}

.global-nav-item.active {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.nav-icon {
    width: 18px;
    color: #64748b;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
}

svg.nav-icon {
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-nav-item.active .nav-icon {
    color: var(--text-main);
}

.global-modal-content {
    padding: 28px 34px 34px;
}

.setting-group {
    margin-bottom: 34px;
    padding-bottom: 28px;
    border-bottom: 1px solid #dce4ee;
}

.setting-group h4 {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dce4ee;
    color: #0f2137;
    font-size: 1.02rem;
    font-weight: 900;
}

.setting-desc {
    margin-bottom: 16px;
    color: #53657b;
    font-size: 0.8rem;
}

.settings-action-grid {
    gap: 14px;
}

.global-settings-modal .action-btn {
    min-height: 48px;
    border-radius: 7px;
    font-size: 0.86rem;
    font-weight: 850;
}

.settings-outline-action,
.global-settings-modal .settings-action-grid .action-neutral {
    background: #fff;
    border-color: #bdcad8;
    color: #142338;
}

.settings-outline-action:hover,
.global-settings-modal .settings-action-grid .action-neutral:hover {
    background: #f8fafc;
    border-color: #8ba2b8;
}

.settings-wide-action {
    min-height: 48px;
    border-radius: 7px;
}

.global-settings-modal .lock-toggle-btn.action-green {
    background: #f0fff8;
    border-color: #10b981;
    color: #0ba36f;
}

.global-settings-modal .lock-toggle-btn.action-red {
    background: #fff5f3;
    border-color: #f0b5ad;
}

#anonymizeButtons .student-accent-btn,
#exportButtons .student-accent-btn {
    min-height: 48px;
    border: 1px solid #bdcad8;
    border-left: 3px solid var(--accent);
    background: #fff;
    color: #142338;
}

#anonymizeButtons .student-accent-btn:hover,
#exportButtons .student-accent-btn:hover {
    background: #f8fafc;
    border-color: #8ba2b8;
    border-left-color: var(--accent);
}

.danger-setting-group {
    margin-top: 4px;
    padding: 20px;
    border: 1px solid #ff8f8f;
    border-radius: 8px;
    background: #fff1f1;
}

.danger-setting-group h4 {
    border-bottom-color: #ffb4b4;
    color: #ff3b42;
}

.danger-setting-group .setting-desc {
    color: #ff3b42;
}

.danger-setting-group .settings-action-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.danger-outline-action {
    background: #fff;
    border: 1px solid #ff3b42;
    color: #ff3b42;
}

.danger-outline-action:hover {
    background: #fff7f7;
    border-color: #ef2f36;
}

.danger-solid-action {
    background: #f43f46;
    border-color: #f43f46;
    color: #fff;
}

.danger-solid-action:hover {
    background: #dc262d;
    border-color: #dc262d;
}

@media print {
    @page { size: A4 portrait; margin: 0; }
    body { background: white; padding: 0; margin: 0; display: block; }
    .container { border: none; width: 210mm; height: 297mm; padding: 10mm; margin: 0; }
    .version-stamp { display: block !important; color: #aaa; }
    .sidebar, .stats-shell, #toast, .config-banner, .modal-overlay { display: none !important; }
    .unavailable, .anonymized, .tcell.lunch { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.stats-filter-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 8px;
    overflow: hidden;
}
.stats-range-summary {
    width: 100%;
    border: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    color: #172033;
    cursor: pointer;
    text-align: left;
}
.stats-range-summary span {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
}
.stats-range-summary strong {
    min-width: 0;
    color: #172033;
    font-size: 0.68rem;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stats-range-body { display: grid; gap: 7px; padding: 8px; }
.stats-range-body label {
    display: grid;
    gap: 4px;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
}
.stats-range-body select,
.stats-range-body input,
.bill-calculator select {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 7px;
    background: #fff;
    color: #172033;
    padding: 7px 8px;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 750;
}
.stats-custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stats-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 7px;
}
.stats-overview-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    min-width: 0;
}
.stats-overview-card strong {
    display: block;
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
}
.stats-overview-card span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 800;
}
.bill-calculator { display: grid; gap: 7px; }
.bill-calculator-summary {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}
.bill-calculator-summary strong { color: #172033; font-size: 1.08rem; font-weight: 900; }
.bill-calculator-summary span { color: #64748b; font-size: 0.66rem; font-weight: 800; text-align: right; }
.bill-detail-list { display: grid; gap: 4px; }
.bill-detail-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #edf2f7;
    padding: 5px 0;
    color: #475569;
    font-size: 0.62rem;
    font-weight: 760;
}
.bill-detail-row strong { color: #172033; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-detail-row em { color: #172033; font-style: normal; text-align: right; }
.bill-detail-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
}
.bill-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bill-receipt-offscreen {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 480px;
    pointer-events: none;
}
.bill-receipt-card {
    width: 480px;
    background: #ffffff;
    color: #172033;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.br-header-bar { height: 8px; background: var(--student-color); }
.br-card-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    padding: 22px 20px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.br-student-block,
.br-title-block { display: flex; flex-direction: column; gap: 6px; }
.br-title-block { align-items: flex-end; text-align: right; }
.br-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid var(--student-color);
    object-fit: contain;
    object-position: center center;
    background: #ffffff;
}
.br-student-block strong,
.br-title-block strong { font-size: 1.15rem; font-weight: 900; }
.br-title-block span { color: #64748b; font-size: 0.86rem; font-weight: 800; }
.br-section-divider {
    padding: 12px 20px 6px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
}
.br-items-list { padding: 0 20px; }
.bill-receipt-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.bill-receipt-date { display: flex; flex-direction: column; gap: 2px; }
.bill-receipt-date strong { font-size: 0.86rem; font-weight: 900; }
.bill-receipt-date span,
.bill-receipt-time { color: #64748b; font-size: 0.76rem; font-weight: 800; }
.bill-receipt-time { color: #172033; }
.bill-receipt-status { display: flex; justify-content: flex-end; }
.br-status-badge {
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 900;
}
.br-status-badge.done { background: #ecfdf5; color: #047857; }
.bill-receipt-empty {
    padding: 22px 0;
    color: #64748b;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 800;
}
.br-summary-box {
    margin: 16px 20px 14px;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px 14px;
}
.br-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 850;
}
.br-summary-row.highlight {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    color: #172033;
    font-size: 1rem;
}
.br-summary-row.highlight strong { color: var(--student-color); font-size: 1.22rem; }
.br-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0 20px 18px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}
.bill-receipt-modal.mobile-share-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.45);
}
.bill-receipt-modal.mobile-share-modal.active { display: flex; }
.bill-receipt-modal .mobile-share-modal-panel {
    width: min(480px, 100%);
    max-height: 92vh;
    overflow: auto;
    border-radius: 14px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}
.bill-receipt-modal .mobile-share-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.bill-receipt-modal .mobile-share-modal-head button {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #fff;
    color: #172033;
    font-size: 1.2rem;
    cursor: pointer;
}
#billReceiptRenderedImg {
    width: 100%;
    border-radius: 10px;
    background: #f8fafc;
}
#billReceiptRenderedImg[hidden],
#billReceiptLoader[hidden] { display: none; }

