/* ===== متغیرهای CSS ===== */
:root {
    --wgc-primary: #1a2980;
    --wgc-primary-light: #4b6cb7;
    --wgc-secondary: #26d0ce;
    --wgc-bg-body: #0f0c29;
    --wgc-bg-card: #ffffff;
    --wgc-text-dark: #182848;
    --wgc-text-muted: #6c757d;
    --wgc-border-radius: 12px;
    --wgc-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --wgc-transition: 0.3s ease;
    --wgc-font-base: clamp(0.75rem, 1.2vw, 1rem);
    --wgc-font-sm: clamp(0.6rem, 0.9vw, 0.8rem);
    --wgc-font-xs: clamp(0.5rem, 0.7vw, 0.7rem);
}

/* ===== کانتینر اصلی ===== */
.wgc-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(12px, 2vw, 25px);
    background: var(--wgc-bg-card);
    border-radius: var(--wgc-border-radius);
    box-shadow: var(--wgc-shadow);
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== منو ===== */
.wgc-menu {
    display: flex;
    gap: clamp(8px, 1vw, 15px);
    margin-bottom: clamp(15px, 2vw, 25px);
    flex-wrap: wrap;
    justify-content: center;
}

.wgc-menu-btn {
    padding: clamp(10px, 1.2vw, 18px) clamp(15px, 2vw, 30px);
    font-size: clamp(0.8rem, 1.1vw, 1.1rem);
    font-weight: 700;
    border: none;
    border-radius: var(--wgc-border-radius);
    cursor: pointer;
    transition: all var(--wgc-transition);
    background: #e9ecef;
    color: #495057;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 12px);
    flex: 1 1 auto;
    min-width: clamp(130px, 20vw, 200px);
    justify-content: center;
}

.wgc-menu-btn i {
    font-size: clamp(0.9rem, 1.2vw, 1.3rem);
}

.wgc-menu-btn.active {
    background: linear-gradient(135deg, var(--wgc-primary-light), var(--wgc-secondary));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(75, 108, 183, 0.4);
}

.wgc-menu-btn .badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: clamp(0.5rem, 0.6vw, 0.65rem);
}

.wgc-menu-btn.active .badge {
    background: rgba(255,255,255,0.25);
}

@media (max-width: 600px) {
    .wgc-menu-btn {
        min-width: 100%;
        padding: 12px 18px;
    }
}

/* ===== صفحات ===== */
.wgc-page {
    display: none;
    animation: wgcFadeIn 0.4s ease;
}

.wgc-page.active {
    display: block;
}

@keyframes wgcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== محاسبه سریع ===== */
.wgc-quick-calculator {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: var(--wgc-border-radius);
    padding: clamp(12px, 2vw, 25px);
    margin-bottom: 20px;
    box-shadow: var(--wgc-shadow);
    border-right: 4px solid var(--wgc-primary-light);
}

.wgc-quick-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(10px, 1.5vw, 15px);
    color: var(--wgc-text-dark);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    font-weight: 700;
    flex-wrap: wrap;
}

.wgc-quick-title .badge {
    background: linear-gradient(90deg, var(--wgc-primary-light), var(--wgc-secondary));
    color: white;
    font-size: clamp(0.5rem, 0.6vw, 0.65rem);
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: auto;
}

.wgc-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 15vw, 180px), 1fr));
    gap: clamp(8px, 1vw, 15px);
    margin-bottom: 10px;
}

.wgc-input-group {
    display: flex;
    flex-direction: column;
}

.wgc-input-group label {
    font-weight: 700;
    margin-bottom: 4px;
    color: #444;
    font-size: clamp(0.65rem, 0.8vw, 0.85rem);
}

.wgc-input-group input,
.wgc-input-group select {
    padding: clamp(6px, 0.8vw, 10px);
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    text-align: center;
    transition: all var(--wgc-transition);
    font-weight: 600;
    background: white;
    width: 100%;
    min-width: 0;
}

.wgc-input-group input:focus,
.wgc-input-group select:focus {
    border-color: var(--wgc-primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

.wgc-input-group input:disabled {
    background: #f0f0f0;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.wgc-input-group input.invalid {
    border-color: #dc3545;
    background-color: #fff0f0;
}

.wgc-error-message {
    color: #dc3545;
    font-size: clamp(0.5rem, 0.6vw, 0.65rem);
    font-weight: 600;
    margin-top: 3px;
    text-align: center;
    display: none;
}

.wgc-error-message.show {
    display: block;
}

.wgc-hint {
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    color: var(--wgc-text-muted);
    text-align: center;
    line-height: 1.6;
    background: white;
    padding: clamp(4px, 0.5vw, 8px) clamp(8px, 1vw, 12px);
    border-radius: 8px;
    font-weight: 500;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.wgc-hint .highlight-absent {
    background: #ffe8d1;
    padding: 1px 6px;
    border-radius: 4px;
    color: #cc5500;
    font-weight: 700;
}

.wgc-hint .highlight-justified {
    background: #d1ecf1;
    padding: 1px 6px;
    border-radius: 4px;
    color: #0c5460;
    font-weight: 700;
}

.wgc-hint .highlight-error {
    background: #f8d7da;
    padding: 1px 6px;
    border-radius: 4px;
    color: #721c24;
    font-weight: 700;
}

/* ===== جدول نتایج سریع ===== */
.wgc-results-wrapper {
    overflow-x: auto;
    margin-top: clamp(10px, 1.5vw, 15px);
    -webkit-overflow-scrolling: touch;
}

.wgc-results-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    font-size: clamp(0.6rem, 0.8vw, 0.78rem);
}

.wgc-results-table thead {
    background: linear-gradient(90deg, var(--wgc-primary), var(--wgc-primary-light));
}

.wgc-results-table th {
    color: white;
    padding: clamp(4px, 0.6vw, 8px) clamp(3px, 0.4vw, 6px);
    text-align: center;
    font-size: clamp(0.5rem, 0.6vw, 0.65rem);
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

.wgc-results-table td {
    padding: clamp(4px, 0.6vw, 8px) clamp(3px, 0.4vw, 6px);
    text-align: center;
    font-size: clamp(0.6rem, 0.8vw, 0.85rem);
    border-bottom: 1px solid #eee;
    font-weight: 600;
    background: white;
}

.wgc-results-table tbody tr:last-child td {
    border-bottom: none;
}

.wgc-results-table tbody tr:hover td {
    background: #f0f4ff;
}

.wgc-results-table .wgc-readonly {
    background: #f8f9fa;
    color: var(--wgc-text-dark);
}

/* ===== وضعیت‌ها ===== */
.wgc-status-pass {
    background: linear-gradient(135deg, #d4edda, #b7e4c7) !important;
    color: #155724 !important;
    font-weight: 800 !important;
    border-radius: 4px;
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    display: inline-block;
    font-size: clamp(0.5rem, 0.6vw, 0.7rem);
}

.wgc-status-pass::before { content: '✅ '; }

.wgc-status-fail {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
    color: #721c24 !important;
    font-weight: 800 !important;
    border-radius: 4px;
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    display: inline-block;
    font-size: clamp(0.5rem, 0.6vw, 0.7rem);
}

.wgc-status-fail::before { content: '❌ '; }

.wgc-takmude-available {
    background: linear-gradient(135deg, #fff3cd, #ffeaa5) !important;
    color: #856404 !important;
    font-weight: 800 !important;
    border-radius: 4px;
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    display: inline-block;
    font-size: clamp(0.5rem, 0.6vw, 0.7rem);
    animation: wgcPulseGold 1.5s ease-in-out infinite;
}

.wgc-takmude-available::before { content: '⚠️ '; }

@keyframes wgcPulseGold {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.wgc-takmude-summer {
    background: linear-gradient(135deg, #d1ecf1, #a8e0e8) !important;
    color: #0c5460 !important;
    font-weight: 800 !important;
    border-radius: 4px;
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    display: inline-block;
    font-size: clamp(0.5rem, 0.6vw, 0.7rem);
    animation: wgcPulseBlue 1.5s ease-in-out infinite;
}

.wgc-takmude-summer::before { content: '🌙 '; }

@keyframes wgcPulseBlue {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.wgc-takmude-any-score {
    background: linear-gradient(135deg, #e8d5f5, #d5b8f0) !important;
    color: #6f42c1 !important;
    font-weight: 800 !important;
    border-radius: 4px;
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    display: inline-block;
    font-size: clamp(0.5rem, 0.6vw, 0.7rem);
    animation: wgcPulsePurple 1.5s ease-in-out infinite;
}

.wgc-takmude-any-score::before { content: '✨ '; }

@keyframes wgcPulsePurple {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ===== بخش شهریور ===== */
.wgc-shahrivar-section {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: var(--wgc-border-radius);
    padding: clamp(10px, 1.5vw, 18px) clamp(15px, 2vw, 25px);
    margin-bottom: 20px;
    box-shadow: var(--wgc-shadow);
    transition: all 0.5s ease;
    border-right: 4px solid #17a2b8;
}

.wgc-shahrivar-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.wgc-shahrivar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #0c5460;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    font-weight: 700;
    flex-wrap: wrap;
}

.wgc-shahrivar-input-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.wgc-shahrivar-input-wrap .wgc-input-group {
    max-width: clamp(150px, 25vw, 220px);
    flex: 1 1 auto;
    min-width: clamp(100px, 15vw, 150px);
}

.wgc-shahrivar-status {
    text-align: center;
    margin-top: 6px;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-weight: 600;
    color: var(--wgc-text-muted);
}

.wgc-shahrivar-status.active {
    color: #17a2b8;
}

.wgc-shahrivar-status.success {
    color: #28a745;
}

/* ===== جدول اصلی ===== */
.wgc-table-wrapper {
    overflow-x: auto;
    margin-bottom: clamp(15px, 2vw, 25px);
    border-radius: 10px;
    box-shadow: var(--wgc-shadow);
    -webkit-overflow-scrolling: touch;
}

.wgc-main-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: clamp(0.55rem, 0.7vw, 0.78rem);
    table-layout: fixed;
}

.wgc-main-table th {
    background: linear-gradient(90deg, var(--wgc-primary), var(--wgc-primary-light));
    color: white;
    padding: clamp(4px, 0.5vw, 8px) clamp(2px, 0.3vw, 5px);
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.45rem, 0.55vw, 0.7rem);
    position: sticky;
    top: 0;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

.wgc-main-table td {
    padding: clamp(3px, 0.4vw, 6px) clamp(2px, 0.3vw, 4px);
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    word-wrap: break-word;
}

.wgc-main-table tr:nth-child(even) {
    background: #f8f9fa;
}

.wgc-main-table tr:hover {
    background: #e8f0fe;
}

.wgc-main-table input {
    width: 100%;
    padding: clamp(2px, 0.3vw, 5px) clamp(2px, 0.2vw, 4px);
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
    text-align: center;
    transition: all var(--wgc-transition);
    min-width: clamp(20px, 3vw, 35px);
    max-width: clamp(35px, 5vw, 55px);
}

.wgc-main-table input:focus {
    border-color: var(--wgc-primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

.wgc-main-table input:disabled {
    background: #f0f0f0;
    color: #6c757d;
    cursor: not-allowed;
}

.wgc-main-table .wgc-readonly-cell {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--wgc-text-dark);
    padding: clamp(2px, 0.3vw, 5px) clamp(2px, 0.2vw, 4px);
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
}

.wgc-main-table .wgc-subject-name {
    font-weight: 700;
    text-align: right;
    padding-right: clamp(3px, 0.4vw, 6px);
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
}

/* ===== خلاصه ===== */
.wgc-summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(180px, 25vw, 280px), 1fr));
    gap: clamp(10px, 1.5vw, 20px);
    margin: clamp(12px, 2vw, 25px) 0;
}

.wgc-summary-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: clamp(10px, 1.5vw, 18px);
    box-shadow: var(--wgc-shadow);
    border-right: 4px solid var(--wgc-primary-light);
}

.wgc-summary-card h4 {
    color: var(--wgc-text-dark);
    margin-bottom: clamp(8px, 1vw, 12px);
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: clamp(6px, 0.7vw, 10px);
}

.wgc-summary-item {
    display: flex;
    justify-content: space-between;
    padding: clamp(3px, 0.4vw, 6px) 0;
    border-bottom: 1px solid #e9ecef;
    font-size: clamp(0.7rem, 0.85vw, 0.95rem);
}

.wgc-summary-item:last-child {
    border-bottom: none;
}

.wgc-summary-label {
    font-weight: 600;
    color: #555;
}

.wgc-summary-value {
    font-weight: 700;
    color: var(--wgc-text-dark);
}

/* ===== وضعیت نهایی ===== */
.wgc-final-status {
    padding: clamp(10px, 1.5vw, 16px) clamp(15px, 2vw, 25px);
    border-radius: 10px;
    text-align: center;
    font-size: clamp(0.9rem, 1.2vw, 1.3rem);
    font-weight: 700;
    margin: clamp(10px, 1.5vw, 18px) 0;
}

.wgc-final-status.passed-khordad {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.wgc-final-status.passed-shahrivar {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.wgc-final-status.failed {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.wgc-final-status.incomplete {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.wgc-final-status.transfer {
    background: #e8d5f5;
    color: #6f42c1;
    border: 2px solid #8b5cf6;
}

/* ===== صفحه آیین نامه ===== */
.wgc-regulation .wgc-alert-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: clamp(10px, 1.5vw, 18px) clamp(12px, 2vw, 22px);
    margin-bottom: 18px;
    font-weight: 700;
    color: #856404;
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    line-height: 1.8;
}

.wgc-regulation .wgc-alert-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.wgc-regulation .wgc-alert-title i {
    font-size: clamp(1.2rem, 1.5vw, 1.8rem);
    color: #ffc107;
}

.wgc-regulation .wgc-alert-item {
    padding-right: clamp(20px, 3vw, 40px);
    margin-top: 3px;
}

.wgc-regulation .wgc-alert-item-sampad {
    padding-right: clamp(30px, 4vw, 50px);
    margin-top: 3px;
}

.wgc-regulation .wgc-sampad-separator {
    border-top: 2px solid #ffc107;
    padding-top: 10px;
    margin-top: 10px;
}

.wgc-regulation .wgc-explanation {
    margin-top: 0;
    background: #f8f9fa;
    border-radius: 10px;
    padding: clamp(12px, 2vw, 25px);
}

.wgc-regulation .wgc-explanation h3 {
    color: var(--wgc-text-dark);
    margin-bottom: clamp(10px, 1.5vw, 18px);
    font-size: clamp(1rem, 1.4vw, 1.4rem);
    text-align: center;
}

.wgc-regulation .wgc-explanation ul {
    list-style-type: none;
    padding: 0 5px;
}

.wgc-regulation .wgc-explanation li {
    margin-bottom: clamp(8px, 1vw, 14px);
    padding: clamp(8px, 1vw, 14px) clamp(10px, 1.5vw, 18px);
    background: white;
    border-radius: 8px;
    line-height: 1.6;
    border-right: 4px solid var(--wgc-primary-light);
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
}

.wgc-regulation .wgc-explanation li i {
    margin-left: 8px;
    color: var(--wgc-primary-light);
}

.wgc-highlight {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* ===== کنترل بار ===== */
.wgc-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(8px, 1vw, 15px);
    margin-bottom: clamp(12px, 1.5vw, 20px);
    padding: clamp(10px, 1.2vw, 15px);
    background: #f8f9fa;
    border-radius: 10px;
}

.wgc-control-group {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 12px);
    flex-wrap: wrap;
}

.wgc-control-group label {
    font-weight: 700;
    color: #444;
    font-size: clamp(0.75rem, 0.9vw, 1rem);
}

.wgc-btn {
    padding: clamp(6px, 0.7vw, 10px) clamp(12px, 1.5vw, 20px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.75rem, 0.85vw, 0.95rem);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--wgc-transition);
}

.wgc-btn-primary {
    background: linear-gradient(90deg, var(--wgc-primary), var(--wgc-primary-light));
    color: white;
}

.wgc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 41, 128, 0.3);
}

.wgc-btn-success {
    background: linear-gradient(90deg, #28a745, #20c997);
    color: white;
}

.wgc-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

@media (max-width: 600px) {
    .wgc-control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .wgc-control-group {
        justify-content: center;
    }
}

/* ===== اسکرول ===== */
.wgc-table-wrapper::-webkit-scrollbar,
.wgc-results-wrapper::-webkit-scrollbar {
    height: 6px;
}

.wgc-table-wrapper::-webkit-scrollbar-track,
.wgc-results-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wgc-table-wrapper::-webkit-scrollbar-thumb,
.wgc-results-wrapper::-webkit-scrollbar-thumb {
    background: var(--wgc-primary-light);
    border-radius: 3px;
}

.wgc-table-wrapper::-webkit-scrollbar-thumb:hover,
.wgc-results-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--wgc-primary);
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .wgc-menu-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .wgc-results-table {
        font-size: 0.55rem;
        min-width: 500px;
    }
    
    .wgc-results-table th {
        font-size: 0.5rem;
        padding: 4px 2px;
    }
    
    .wgc-results-table td {
        font-size: 0.6rem;
        padding: 4px 2px;
    }
    
    .wgc-main-table {
        font-size: 0.55rem;
        min-width: 600px;
    }
    
    .wgc-main-table th {
        font-size: 0.5rem;
        padding: 3px 1px;
    }
    
    .wgc-main-table td {
        font-size: 0.5rem;
        padding: 3px 1px;
    }
    
    .wgc-main-table input {
        font-size: 0.5rem;
        padding: 2px 1px;
        min-width: 20px;
        max-width: 32px;
    }
}

@media (max-width: 480px) {
    .wgc-input-grid {
        grid-template-columns: 1fr;
    }
    
    .wgc-results-table {
        font-size: 0.5rem;
        min-width: 400px;
    }
    
    .wgc-results-table th {
        font-size: 0.45rem;
        padding: 3px 1px;
    }
    
    .wgc-results-table td {
        font-size: 0.5rem;
        padding: 3px 1px;
    }
}

/* ===== پرینت ===== */
@media print {
    .wgc-menu,
    .wgc-control-bar {
        display: none !important;
    }
    
    .wgc-page {
        display: block !important;
    }
    
    .wgc-page:not(.active) {
        display: none !important;
    }
}

/* ===== جدول اصلی ===== */
.wgc-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    -webkit-overflow-scrolling: touch;
}

.wgc-main-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: clamp(0.55rem, 0.7vw, 0.78rem);
    table-layout: fixed;
}

.wgc-main-table th {
    background: linear-gradient(90deg, #1a2980, #4b6cb7);
    color: white;
    padding: clamp(4px, 0.5vw, 8px) clamp(2px, 0.3vw, 5px);
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.45rem, 0.55vw, 0.7rem);
    position: sticky;
    top: 0;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.1);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

.wgc-main-table td {
    padding: clamp(3px, 0.4vw, 6px) clamp(2px, 0.3vw, 4px);
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    word-wrap: break-word;
}

.wgc-main-table tr:nth-child(even) {
    background: #f8f9fa;
}

.wgc-main-table tr:hover {
    background: #e8f0fe;
}

.wgc-main-table input {
    width: 100%;
    padding: clamp(2px, 0.3vw, 5px) clamp(2px, 0.2vw, 4px);
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
    text-align: center;
    transition: all 0.3s;
    min-width: clamp(20px, 3vw, 35px);
    max-width: clamp(35px, 5vw, 55px);
}

.wgc-main-table input:focus {
    border-color: #4b6cb7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

.wgc-main-table input:disabled {
    background: #f0f0f0;
    color: #6c757d;
    cursor: not-allowed;
}

.wgc-main-table .wgc-readonly-cell {
    background: #f8f9fa;
    font-weight: 600;
    color: #182848;
    padding: clamp(2px, 0.3vw, 5px) clamp(2px, 0.2vw, 4px);
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
}

.wgc-main-table .wgc-subject-name {
    font-weight: 700;
    text-align: right;
    padding-right: clamp(3px, 0.4vw, 6px);
    font-size: clamp(0.5rem, 0.6vw, 0.75rem);
}

.wgc-main-table .wgc-col-subject { width: clamp(6%, 8%, 10%); }
.wgc-main-table .wgc-col-score { width: clamp(4%, 5%, 6%); }
.wgc-main-table .wgc-col-status { width: clamp(5%, 6%, 8%); }

/* ===== خلاصه ===== */
.wgc-summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(180px, 25vw, 280px), 1fr));
    gap: clamp(10px, 1.5vw, 20px);
    margin: clamp(12px, 2vw, 25px) 0;
}

.wgc-summary-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: clamp(10px, 1.5vw, 18px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-right: 4px solid #4b6cb7;
}

.wgc-summary-card h4 {
    color: #182848;
    margin-bottom: clamp(8px, 1vw, 12px);
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: clamp(6px, 0.7vw, 10px);
}

.wgc-summary-item {
    display: flex;
    justify-content: space-between;
    padding: clamp(3px, 0.4vw, 6px) 0;
    border-bottom: 1px solid #e9ecef;
    font-size: clamp(0.7rem, 0.85vw, 0.95rem);
}

.wgc-summary-item:last-child {
    border-bottom: none;
}

.wgc-summary-label {
    font-weight: 600;
    color: #555;
}

.wgc-summary-value {
    font-weight: 700;
    color: #182848;
}

/* ===== وضعیت نهایی ===== */
.wgc-final-status {
    padding: clamp(10px, 1.5vw, 16px) clamp(15px, 2vw, 25px);
    border-radius: 10px;
    text-align: center;
    font-size: clamp(0.9rem, 1.2vw, 1.3rem);
    font-weight: 700;
    margin: clamp(10px, 1.5vw, 18px) 0;
}

.wgc-final-status.passed-khordad {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.wgc-final-status.passed-shahrivar {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.wgc-final-status.failed {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.wgc-final-status.incomplete {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.wgc-final-status.transfer {
    background: #e8d5f5;
    color: #6f42c1;
    border: 2px solid #8b5cf6;
}

/* ===== کنترل بار ===== */
.wgc-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(8px, 1vw, 15px);
    margin-bottom: clamp(12px, 1.5vw, 20px);
    padding: clamp(10px, 1.2vw, 15px);
    background: #f8f9fa;
    border-radius: 10px;
}

.wgc-control-group {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 12px);
    flex-wrap: wrap;
}

.wgc-control-group label {
    font-weight: 700;
    color: #444;
    font-size: clamp(0.75rem, 0.9vw, 1rem);
}

.wgc-control-group select {
    padding: clamp(6px, 0.7vw, 10px) clamp(10px, 1.2vw, 18px);
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: clamp(0.75rem, 0.85vw, 0.95rem);
    font-weight: 600;
    background: white;
    cursor: pointer;
}

.wgc-btn {
    padding: clamp(6px, 0.7vw, 10px) clamp(12px, 1.5vw, 20px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.75rem, 0.85vw, 0.95rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.wgc-btn-primary {
    background: linear-gradient(90deg, #1a2980, #4b6cb7);
    color: white;
}

.wgc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 41, 128, 0.3);
}

.wgc-btn-success {
    background: linear-gradient(90deg, #28a745, #20c997);
    color: white;
}

.wgc-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

@media (max-width: 600px) {
    .wgc-control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .wgc-control-group {
        justify-content: center;
    }
}

/* ===== اسکرول ===== */
.wgc-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.wgc-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wgc-table-wrapper::-webkit-scrollbar-thumb {
    background: #4b6cb7;
    border-radius: 3px;
}

.wgc-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #1a2980;
}