/* ==========================================================
   Tutor LMS Grade Report — tgr.css
   Covers: student dashboard, instructor dashboard, WP admin
   ========================================================== */

/* ── Shared wrapper ─────────────────────────────────────── */
.tgr-wrap {
    max-width: 860px;
}

/* ── Page header (title + overall pill side by side) ────── */
.tgr-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.tgr-page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

/* ── Overall average pill ───────────────────────────────── */
.tgr-overall-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f4ff;
    border: 1px solid #cdd9f5;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: #333;
}
.tgr-overall-label {
    color: #555;
    font-weight: 500;
}

/* ── Grade table ────────────────────────────────────────── */
.tgr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 6px;
}
.tgr-table th,
.tgr-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e8e8eb;
    vertical-align: middle;
}
.tgr-table thead th {
    background: #f6f7f9;
    font-weight: 600;
    color: #444;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tgr-table tbody tr:last-child td {
    border-bottom: none;
}
.tgr-table tbody tr:hover {
    background: #fafbfc;
}
.tgr-tfoot-avg td {
    background: #f0f4ff;
    border-top: 2px solid #c8d5f0;
    font-size: 13px;
}
.tgr-tfoot-avg strong {
    color: #333;
}

/* ── Course link ────────────────────────────────────────── */
.tgr-course-link {
    color: inherit;
    text-decoration: none;
}
.tgr-course-link:hover {
    color: #13a4f2;
    text-decoration: underline;
}

/* ── Grade badges ───────────────────────────────────────── */
.tgr-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.tgr-pass { background: #d4edda; color: #155724; }
.tgr-avg  { background: #fff3cd; color: #856404; }
.tgr-fail { background: #f8d7da; color: #721c24; }
.tgr-na   { background: #e9ecef; color: #6c757d; }

/* ── N/A hint ───────────────────────────────────────────── */
.tgr-no-attempt-hint {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* ── Instructor: course block ───────────────────────────── */
.tgr-course-block {
    margin-bottom: 36px;
}
.tgr-course-block-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #13a4f2;
}
.tgr-course-block-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #222;
}
.tgr-class-avg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}
.tgr-enrolled-count {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* ── Footnote ───────────────────────────────────────────── */
.tgr-footnote {
    font-size: 12px;
    color: #aaa;
    margin-top: 12px;
}
.tgr-empty {
    color: #888;
    font-style: italic;
}

/* ── WP Admin overrides ─────────────────────────────────── */
.tgr-admin .tgr-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 24px;
}
.tgr-admin .tgr-filter-form select {
    min-width: 280px;
}
.tgr-admin-course-block {
    margin-bottom: 36px;
}
.tgr-admin-course-block h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #13a4f2;
    margin: 0 0 10px;
}
.tgr-course-avg-inline {
    font-size: 13px;
    font-weight: 400;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tgr-admin .tgr-table {
    margin-bottom: 0;
}
.tgr-admin .tgr-table th,
.tgr-admin .tgr-table td {
    padding: 8px 12px;
}

/* ==========================================================
   v2.0 — Toolbar: search, filter, export
   ========================================================== */

/* ── Toolbar row ────────────────────────────────────────── */
.tgr-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.tgr-filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

/* ── Inputs ─────────────────────────────────────────────── */
.tgr-search-input,
.tgr-select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.tgr-search-input {
    min-width: 220px;
}
.tgr-search-input:focus,
.tgr-select:focus {
    border-color: #13a4f2;
    box-shadow: 0 0 0 2px rgba(19,164,242,.15);
}

/* ── Buttons (frontend) ──────────────────────────────────── */
.tgr-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    color: #333;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.tgr-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #111;
}
.tgr-btn-secondary {
    color: #888;
}
.tgr-btn-export {
    border-color: #13a4f2;
    color: #13a4f2;
    font-weight: 600;
    margin-left: auto;
}
.tgr-btn-export:hover {
    background: #e8f5fe;
    border-color: #0e8fd4;
    color: #0e8fd4;
}

/* ── Admin toolbar ───────────────────────────────────────── */
.tgr-admin .tgr-toolbar {
    margin: 14px 0 24px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
}
.tgr-admin .tgr-filter-form select {
    height: 30px;
    min-width: 220px;
}
.tgr-admin .tgr-filter-form .tgr-search-input {
    height: 30px;
    min-width: 200px;
}
.tgr-admin .tgr-export-btn {
    margin-left: auto;
}

/* ── Course block header ─────────────────────────────────── */
.tgr-course-block-header {
    gap: 10px;
}
.tgr-enrolled-count {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

/* ── Export button group ─────────────────────────────────── */
.tgr-export-group {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.tgr-btn-csv {
    border-color: #28a745;
    color: #28a745;
    font-weight: 600;
}
.tgr-btn-csv:hover { background: #f0fff4; color: #1e7e34; }
.tgr-btn-pdf {
    border-color: #dc3545;
    color: #dc3545;
    font-weight: 600;
}
.tgr-btn-pdf:hover { background: #fff5f5; color: #bd2130; }

/* ── Rank badge ──────────────────────────────────────────── */
.tgr-rank {
    font-size: 16px;
    font-weight: 700;
    color: #555;
}

/* ── Completion progress bar ─────────────────────────────── */
.tgr-prog-wrap {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
    min-width: 70px;
}
.tgr-prog-bar {
    height: 100%;
    border-radius: 3px;
    transition: width .3s;
}
.tgr-prog-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* ── Course navigation ───────────────────────────────────── */
.tgr-course-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.tgr-nav-arrow {
    font-size: 13px;
    font-weight: 600;
    color: #13a4f2;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid #13a4f2;
    border-radius: 6px;
    transition: background .15s;
}
.tgr-nav-arrow:hover { background: #e8f5fe; color: #0e8fd4; }
.tgr-nav-disabled {
    color: #bbb;
    border-color: #ddd;
    cursor: default;
}
.tgr-course-counter {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* ── Student pagination ──────────────────────────────────── */
.tgr-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.tgr-pag-info {
    font-size: 12px;
    color: #888;
}
.tgr-pag-pages {
    display: flex;
    gap: 4px;
}
.tgr-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    background: #fff;
    transition: background .15s, border-color .15s;
}
.tgr-pag-btn:hover { background: #f5f5f5; border-color: #bbb; color: #111; }
.tgr-pag-active {
    background: #13a4f2;
    border-color: #13a4f2;
    color: #fff;
    cursor: default;
}
.tgr-pag-active:hover { background: #13a4f2; color: #fff; }

/* ── Admin tabs ──────────────────────────────────────────── */
.tgr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}
.tgr-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    margin-bottom: -2px;
    background: #f5f5f5;
    transition: background .15s, color .15s;
}
.tgr-tab:hover { background: #eee; color: #222; }
.tgr-tab-active {
    background: #fff;
    color: #13a4f2;
    border-color: #e0e0e0;
    border-bottom-color: #fff;
}
