/* ==========================================================================
   CEBC Tutor LMS Gradebook - Full Suite Style + Evaluation Groups
   ========================================================================== */

.cebc-tutor-gradebook-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
    margin-top: 10px;
}

/* 1. Top Filter & Action Bar */
.cebc-gb-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.cebc-gb-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cebc-custom-select-wrap {
    position: relative;
}

.cebc-select-pill {
    background-color: #edf2fe !important;
    color: #3858f6 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 34px 8px 12px !important;
    border: 1px solid #dbeafe !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    outline: none !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%233858f6' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
}

.cebc-select-pill:hover {
    background-color: #e0e7ff !important;
}

.cebc-select-group {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230f172a' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
}

.cebc-gb-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cebc-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.cebc-input-search {
    padding: 8px 14px 8px 32px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    width: 200px;
    height: auto !important;
    box-shadow: none !important;
}

.cebc-input-search:focus {
    border-color: #3858f6 !important;
    outline: none !important;
}

.cebc-gb-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cebc-btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 8px !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
}

.cebc-btn-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.cebc-btn-primary {
    background: #3858f6 !important;
    color: #ffffff !important;
    border-color: #3858f6 !important;
}

.cebc-btn-primary:hover {
    background: #2563eb !important;
}

.cebc-btn-danger:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

/* 2. Stat Cards Grid */
.cebc-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
}

@media (max-width: 900px) {
    .cebc-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 550px) {
    .cebc-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

.cebc-stat-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

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

.cebc-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.cebc-stat-icon-blue { color: #3858f6; font-size: 18px; }
.cebc-stat-icon-green { color: #10b981; font-size: 18px; }
.cebc-stat-icon-orange { color: #f59e0b; font-size: 18px; }

.cebc-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.cebc-color-blue { color: #3858f6 !important; }
.cebc-color-green { color: #10b981 !important; }
.cebc-color-orange { color: #f59e0b !important; }

.cebc-stat-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* 3. Common Card Box */
.cebc-card-box {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

/* 4. Activities Filter Section */
.cebc-activities-section {
    padding: 16px 20px;
}

.cebc-activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.cebc-sec-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-right: 6px;
}

.cebc-pill-count {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.cebc-act-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cebc-type-filter-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
    gap: 2px;
    margin-right: 6px;
}

.cebc-type-btn {
    background: transparent !important;
    border: none !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    color: #475569 !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cebc-type-btn:hover {
    color: #0f172a !important;
}

.cebc-type-active {
    background: #ffffff !important;
    color: #3858f6 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.cebc-chip-btn {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cebc-chip-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cebc-chip-active {
    background: #edf2fe !important;
    color: #3858f6 !important;
    border-color: #dbeafe !important;
}

.cebc-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px 0;
}

.cebc-activity-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px !important;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.cebc-activity-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.cebc-activity-chip.is-checked {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.cebc-chip-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #3858f6;
    margin: 0 !important;
}

.cebc-chip-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
}

.cebc-chip-title {
    font-weight: 500;
    color: #1e293b;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cebc-chip-date {
    font-size: 10px;
    color: #94a3b8;
}

/* 5. Gradebook Table */
.cebc-table-card {
    overflow: hidden;
    padding: 0;
}

.cebc-table-scroll {
    overflow-x: auto;
}

.cebc-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
}

.cebc-table th {
    background: #fafbfc;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.cebc-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    background: #ffffff;
}

.cebc-table tr:hover td {
    background-color: #f8fafc;
}

.cebc-col-student-sticky {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 2;
    box-shadow: 2px 0 6px rgba(0,0,0,0.03);
}

.cebc-table th.cebc-col-student-sticky {
    background: #fafbfc;
    z-index: 3;
}

.cebc-student-row:hover .cebc-col-student-sticky {
    background-color: #f8fafc;
}

.cebc-col-student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.cebc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.cebc-student-info {
    flex: 1;
}

.cebc-student-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.cebc-student-email {
    font-size: 11px;
    color: #94a3b8;
}

.cebc-btn-boletin {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #3858f6;
    background: #edf2fe;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 6px;
}

.cebc-btn-boletin:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.cebc-score-num {
    font-weight: 600;
    font-size: 13px;
}

.cebc-score-pass { color: #10b981; }
.cebc-score-warn { color: #f59e0b; }
.cebc-score-fail { color: #ef4444; }
.cebc-score-empty { color: #cbd5e1; font-size: 14px; font-weight: 600; }

.cebc-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px !important;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.cebc-pill-success {
    background: #ecfdf5;
    color: #059669;
}

.cebc-pill-warning {
    background: #fffbeb;
    color: #d97706;
}

.cebc-pill-danger {
    background: #fef2f2;
    color: #dc2626;
}

.cebc-loading-box {
    text-align: center;
    padding: 50px 20px;
    color: #64748b;
    font-size: 14px;
}

.cebc-pulse-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3858f6;
    border-radius: 50%;
    margin: 0 auto 10px auto;
    animation: cebc-rotate 0.8s linear infinite;
}

@keyframes cebc-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cebc-empty-box {
    text-align: center;
    padding: 50px 20px;
}

.cebc-empty-icon {
    font-size: 38px;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: inline-block;
}

.cebc-empty-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.cebc-empty-desc {
    font-size: 13px;
    color: #64748b;
}

/* ==========================================================================
   6. MODAL STYLES (SAVE PERIOD & REPORT CARD)
   ========================================================================== */

.cebc-boletin-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 15px;
    overflow-y: auto;
}

.cebc-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: auto;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

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

.cebc-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.cebc-modal-close {
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.cebc-modal-close:hover {
    color: #0f172a;
}

.cebc-modal-body {
    padding: 20px;
}

.cebc-input-text-full {
    width: 100% !important;
    padding: 9px 12px !important;
    font-size: 13px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.cebc-input-text-full:focus {
    border-color: #3858f6 !important;
}

.cebc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.cebc-boletin-modal-container {
    background: #f1f5f9;
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: auto;
    overflow: hidden;
}

.cebc-boletin-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.cebc-btn-print-boletin {
    background: #3858f6 !important;
    color: #ffffff !important;
    border-color: #3858f6 !important;
}

.cebc-btn-print-boletin:hover {
    background: #2563eb !important;
}

.cebc-boletin-sheet {
    background: #ffffff;
    padding: 36px 40px;
    margin: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    color: #0f172a;
    font-size: 13px;
    line-height: 1.5;
}
