:root {
    --primary: #4a90e2;
    --secondary: #f5a623;
    --success: #7ed321;
    --danger: #d0021b;
    --background: #f0f4f8;
    --text: #333;
    --card-bg: #ffffff;
    --border: #e1e8ed;
}

* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body {
    background-color: var(--background);
    color: var(--text);
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.view-section { display: none; }
.view-section.active { display: block; }

/* Auth & Login */
.auth-card { text-align: center; padding: 20px 10px; }
.auth-card h1 { color: var(--primary); font-size: 2.5rem; margin-bottom: 5px; }

/* Role Selection Grid */
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.role-card {
    background: #f8fbfe;
    padding: 30px 20px;
    border-radius: 15px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}
.role-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(74,144,226,0.15); }
.role-card .role-icon { font-size: 2.5rem; margin-bottom: 10px; }
.role-card h3 { margin: 0 0 8px; color: var(--primary); }
.role-card p { margin: 0; color: #888; font-size: 0.9rem; }

/* Form Card */
.form-card {
    max-width: 400px;
    margin: 25px auto 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.form-section-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border);
}

/* Teacher Code Display */
.code-display {
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 8px;
    color: var(--primary);
    background: #f0f7ff;
    border: 3px dashed var(--primary);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 350px;
    user-select: all;
}
.code-hint { color: #888; font-size: 0.9rem; }

/* Teacher Panel Code Badge */
.code-badge {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.login-box {
    background: #f8fbfe;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-box h3 { margin-top: 0; color: #555; border-bottom: 2px solid #eee; padding-bottom: 10px; }

select, input {
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    width: 100%;
}
input:focus, select:focus { border-color: var(--primary); }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}
.checkbox-group input { width: auto; cursor: pointer; }

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn:hover { opacity: 0.9; }

/* Stats Bar */
.stats-bar {
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
    padding: 12px 20px; border-radius: 15px; margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid var(--border);
}

.progress-container { flex-grow: 1; margin: 0 20px; height: 10px; background: #eee; border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--success); width: 0%; transition: 0.4s; }

/* Questions List */
.questions-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; }
.question-card { background: #fff; border: 1px solid var(--border); padding: 20px; border-radius: 15px; }

.dual-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #f8fbfe;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    min-height: 120px;
}

.vertical-math { text-align: right; font-family: monospace; font-size: 1.6rem; line-height: 1.1; position: relative; }
.vertical-math .line { border-bottom: 3px solid #333; margin: 4px 0; }

.division-box { display: flex; align-items: flex-start; font-family: monospace; font-size: 1.6rem; }
.div-dividend { padding: 5px 10px; text-align: right; }
.div-divider-result { border-left: 3px solid #333; }
.div-divider { padding: 0 10px; border-bottom: 3px solid #333; min-width: 60px; text-align: center; }
.div-result { padding: 5px 10px; text-align: center; color: #ccc; }

/* Equation Styles */
.equation-display { font-size: 1.5rem; font-weight: bold; display: flex; align-items: center; gap: 10px; }
.box-placeholder { width: 50px; height: 50px; border: 3px dashed var(--primary); display: flex; align-items: center; justify-content: center; color: var(--primary); border-radius: 8px; font-size: 1.8rem; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-btn { padding: 12px; border: 2px solid #edf2f7; border-radius: 10px; background: white; cursor: pointer; font-size: 1.1rem; }
.option-btn.correct { background: var(--success) !important; color: white; border-color: var(--success); }
.option-btn.wrong { background: var(--danger) !important; color: white; border-color: var(--danger); }

/* Parent Panel */
.history-item { background: #fff; padding: 15px; border-radius: 12px; margin-bottom: 10px; border-left: 6px solid var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.history-item:hover { background: #f7fafc; }

.settings-card { background: #fff; padding: 20px; border-radius: 15px; border: 1px solid var(--border); margin-bottom: 25px; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 20px; }
.modal-content { background: white; padding: 30px; border-radius: 20px; max-width: 650px; width: 100%; max-height: 85vh; overflow-y: auto; }

.badge { padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: bold; color: white; margin-left: 5px; }
.badge-plus { background: #3498db; }
.badge-minus { background: #e67e22; }
.badge-times { background: #9b59b6; }
.badge-divide { background: #1abc9c; }
.badge-integer { background: #34495e; }
.badge-grade { background: #8e44ad; }

.grade-info-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1.05rem;
    margin: 12px 0;
    text-align: center;
}
.badge-mixed { background: #f39c12; }

/* Grade Checkbox Grid (Öğretmen Kayıt) */
.grade-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.grade-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    user-select: none;
}
.grade-check-item:hover { border-color: var(--primary); background: #f0f7ff; }
.grade-check-item:has(input:checked) { border-color: var(--primary); background: #e8f0fe; font-weight: 600; }
.grade-check-item input { width: auto; accent-color: var(--primary); }

/* Grade Picker (Öğrenci Sınıf Seçimi) */
.grade-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 12px 0;
}
.grade-picker-btn {
    padding: 16px 10px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #f8fbfe;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: 0.2s;
}
.grade-picker-btn:hover { border-color: var(--primary); background: #e8f0fe; transform: translateY(-2px); }
.grade-picker-btn.selected { border-color: var(--primary); background: var(--primary); color: white; }

/* Grade Management (Öğretmen Panel) */
.grade-manage-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.grade-toggle {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid transparent;
}
.grade-toggle.active { background: #8e44ad; color: white; border-color: #8e44ad; }
.grade-toggle.inactive { background: #f0f0f0; color: #999; border-color: #e0e0e0; }
.grade-toggle.inactive:hover { border-color: #8e44ad; color: #8e44ad; }
.grade-toggle.active:hover { opacity: 0.85; }

/* Display Grades (Kod Görüntüleme) */
.display-grades-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}
.display-grades-list .badge { font-size: 0.9rem; padding: 6px 12px; margin-left: 0; }

/* History Grade Filter */
.history-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 6px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.2s;
}
.filter-btn.active { border-color: #8e44ad; background: #8e44ad; color: white; }

/* KVKK Modal */
.kvkk-content { max-width: 700px; }
.kvkk-text {
    max-height: 45vh;
    overflow-y: auto;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid var(--border);
}
.kvkk-text h3 { color: var(--primary); font-size: 1rem; margin: 16px 0 6px; }
.kvkk-text ul { padding-left: 20px; }
.kvkk-text li { margin-bottom: 4px; }

/* Anomaly Badges */
.badge-warning { background: #e74c3c; }
.badge-anomaly { background: #e67e22; animation: pulse-badge 2s infinite; }
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* PIN Section */
.student-pin-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.student-pin-row {
    display:flex; justify-content:space-between; align-items:center;
    padding:10px 14px; background:#f8fbfe; border-radius:10px;
    border:1px solid var(--border);
}
.student-pin-info { display:flex; flex-direction:column; gap:2px; }
.student-pin-info small { color:#888; font-size:0.8rem; }
.btn-sm { padding:6px 14px; font-size:0.8rem; border-radius:8px; }

#student-pin-section
    padding: 12px;
    background: #fef9e7;
    border-radius: 10px;
    border: 2px solid #f0c040;
}

@media (max-width: 768px) {
    .role-grid { grid-template-columns: 1fr; }
    .login-grid { grid-template-columns: 1fr; }
    .questions-list { grid-template-columns: 1fr; }
    .code-display { font-size: 2rem; letter-spacing: 5px; }
    .grade-checkbox-grid { grid-template-columns: repeat(2, 1fr); }
    .grade-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   SONUÇ EKRANI
   ================================================================ */
.result-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.result-stat {
    text-align: center;
    padding: 16px 8px;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.result-stat .stat-value {
    font-size: 2rem;
    font-weight: 800;
    display: block;
}
.result-stat .stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}
.result-stat.stat-correct .stat-value { color: #27ae60; }
.result-stat.stat-wrong .stat-value { color: #e74c3c; }
.result-stat.stat-empty .stat-value { color: #95a5a6; }
.result-stat.stat-time .stat-value { color: var(--primary); font-size: 1.4rem; }

.result-score-bar {
    margin: 16px 0;
    height: 12px;
    border-radius: 6px;
    background: #ecf0f1;
    overflow: hidden;
}
.result-score-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
}

.result-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0 16px;
    flex-wrap: wrap;
}
.result-tab {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    min-width: 80px;
}
.result-tab.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border-left: 5px solid #e0e0e0;
}
.result-item.ri-correct { border-left-color: #27ae60; }
.result-item.ri-wrong { border-left-color: #e74c3c; }
.result-item.ri-empty { border-left-color: #95a5a6; }
.result-item .ri-num {
    font-weight: 800;
    color: #aaa;
    min-width: 28px;
    font-size: 0.85rem;
}
.result-item .ri-question { flex: 1; font-weight: 600; }
.result-item .ri-answer {
    font-size: 0.85rem;
    text-align: right;
    min-width: 120px;
}
.ri-answer .ri-correct-val { color: #27ae60; font-weight: 700; }
.ri-answer .ri-wrong-val { color: #e74c3c; text-decoration: line-through; margin-right: 6px; }

@media (max-width: 500px) {
    .result-summary { grid-template-columns: repeat(2, 1fr); }
    .result-tabs { gap: 4px; }
    .result-tab { font-size: 0.75rem; padding: 8px 4px; }
}

/* İstatistik Paneli */
.stats-overview {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 15px;
}
.stat-card {
    text-align: center; padding: 14px 8px; border-radius: 12px;
    background: #f8fbfe; border: 1px solid var(--border);
}
.stat-card .stat-number { font-size: 1.4rem; font-weight: 800; }
.stat-card .stat-desc { font-size: 0.75rem; color: #888; margin-top: 2px; }
.sc-blue .stat-number { color: var(--primary); }
.sc-green .stat-number { color: #27ae60; }
.sc-yellow .stat-number { color: #f39c12; }
.sc-red .stat-number { color: #e74c3c; }

.stats-op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 15px; }
.stats-op-card { padding: 12px; background: #f8fbfe; border-radius: 10px; border: 1px solid var(--border); }
.stats-bar-bg { height: 6px; background: #eee; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.stats-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

.grade-stats-list { display: flex; flex-direction: column; gap: 10px; }
.grade-stat-card { padding: 12px 16px; background: #f8fbfe; border-radius: 12px; border: 1px solid var(--border); }
.grade-stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.grade-stat-details { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: #666; margin-top: 8px; }

/* Deneme sayısı badge */
.badge-attempt { background: #3498db22; color: #2980b9; border: 1px solid #3498db55; font-size: 0.7rem; }

/* Süre uyarı stilleri */
.timer-warning { color: #f39c12 !important; animation: pulse-timer 1s ease-in-out infinite; }
.timer-danger { color: #e74c3c !important; animation: pulse-timer 0.5s ease-in-out infinite; font-size: 1.2rem; }
@keyframes pulse-timer { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

@media (max-width: 500px) {
    .stats-overview { grid-template-columns: repeat(2, 1fr); }
    .stats-op-grid { grid-template-columns: 1fr; }
    .badges-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Yoklama Listesi (Roster) ========== */
.roster-input-row { display: flex; gap: 10px; margin-bottom: 15px; }
.roster-input-row input { flex: 1; }
.roster-input-row button { width: auto; white-space: nowrap; }

.roster-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }

.roster-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-radius: 10px; border: 1px solid #e0e0e0;
    transition: background 0.2s;
}
.roster-solved { background: #e8f5e9; border-color: #a5d6a7; }
.roster-missing-row { background: #fef2f2; border-color: #f5c6cb; }

.roster-row strong { margin-left: 6px; }
.roster-row small { margin-left: 4px; font-size: 0.8rem; }

.roster-alert {
    margin-top: 12px; padding: 14px; border-radius: 10px;
    background: #fff3cd; border: 1px solid #ffc107; color: #856404;
}
.roster-alert p { margin: 6px 0 0; font-size: 0.9rem; }

.btn-icon {
    background: none; border: none; cursor: pointer; font-size: 1.1rem;
    padding: 4px 8px; border-radius: 6px; transition: background 0.2s;
}
.btn-icon:hover { background: #f8d7da; }

/* ========== Rozet / Badge Sistemi ========== */
.badges-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px;
}
.badge-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 14px 8px; border-radius: 12px; background: linear-gradient(135deg, #fff9e6, #fff3cc);
    border: 1px solid #f0d060; text-align: center; transition: transform 0.2s, box-shadow 0.2s;
    animation: badge-pop 0.4s ease-out;
}
.badge-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(240,208,96,0.4); }
.badge-icon { font-size: 2rem; margin-bottom: 6px; }
.badge-title { font-size: 0.75rem; font-weight: 700; color: #8b6914; }

@keyframes badge-pop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Öğretmen panelinde küçük badge */
.badge-earned {
    display: inline-block; padding: 3px 8px; margin: 2px;
    border-radius: 20px; font-size: 0.7rem; font-weight: 600;
    background: linear-gradient(135deg, #fff9e6, #fff3cc); border: 1px solid #f0d060;
    color: #8b6914;
}

#result-badges { margin-top: 20px; }

/* ========== Offline Banner ========== */
.offline-banner {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    padding: 12px 20px; background: #fff3cd; border-bottom: 2px solid #ffc107;
    color: #856404; font-size: 0.9rem; font-weight: 500; text-align: center;
}

/* ========== Kod Yenileme ========== */
.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22); color: #fff;
    border: none; padding: 10px 20px; border-radius: 10px; font-weight: 600;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.btn-warning:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(243,156,18,0.4); }

/* ========== Öğrenci Sonuçları — Toolbar & Pagination ========== */
.history-toolbar {
    background: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}
.history-toolbar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.history-toolbar-row input,
.history-toolbar-row select {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: #f8fbfe;
    transition: border-color 0.2s;
}
.history-toolbar-row input { flex: 1; min-width: 160px; }
.history-toolbar-row select { min-width: 130px; }
.history-toolbar-row input:focus,
.history-toolbar-row select:focus { border-color: var(--primary); outline: none; }

.history-group-header {
    padding: 10px 16px;
    margin: 14px 0 8px;
    background: linear-gradient(135deg, #667eea22, #764ba222);
    border-left: 4px solid #8e44ad;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #4a4a6a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-group-header .group-count {
    font-size: 0.75rem;
    background: #8e44ad;
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.history-pagination button {
    min-width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.2s;
}
.history-pagination button:hover { border-color: var(--primary); background: #f0f7ff; }
.history-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.history-pagination button:disabled { opacity: 0.4; cursor: default; }

/* ========== Zorluk Seçici ========== */
.form-section-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #4a4a6a;
    margin: 12px 0 6px;
}
.difficulty-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.diff-btn {
    flex: 1;
    padding: 10px 6px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.diff-btn:hover { border-color: var(--primary); background: #f0f7ff; }
.diff-btn.active { border-color: var(--primary); background: linear-gradient(135deg, #667eea22, #764ba222); box-shadow: 0 2px 8px rgba(102,126,234,0.15); }

/* ========== Panel Sekmeleri ========== */
.panel-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.panel-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: #888;
    transition: all 0.2s;
    border-radius: 10px 10px 0 0;
}
.panel-tab:hover { color: var(--primary); background: #f0f7ff; }
.panel-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: linear-gradient(180deg, #f0f7ff 0%, transparent 100%);
}
.panel-tab-content { display: none; }
.panel-tab-content.active { display: block; animation: tabFadeIn 0.3s ease; }
@keyframes tabFadeIn
.history-pagination .page-info {
    font-size: 0.8rem;
    color: #888;
    padding: 0 8px;
}

@media (max-width: 500px) {
    .history-toolbar-row { flex-direction: column; }
    .history-toolbar-row input,
    .history-toolbar-row select { width: 100%; min-width: unset; }
}