/* ─── Teacher View Container ─────────────────────────────────────────────── */

/* ─── Month Filter ────────────────────────────────────────────────────────── */
.stv-month-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stv-filter-label {
    font-weight: 700;
    color: #555;
    font-size: 14px;
    white-space: nowrap;
}

.stv-month-btn {
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.stv-month-btn:hover {
    border-color: #820c22;
    color: #820c22;
    background: #fff5f7;
}

.stv-month-btn.active {
    background: #820c22;
    border-color: #820c22;
    color: #fff;
}

/* ─── Section Blocks ─────────────────────────────────────────────────────── */
.stv-block {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stv-block-title {
    font-size: 17px;
    font-weight: 700;
    color: #820c22;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0e0e3;
}

/* ─── Highlight Current Teacher Row ─────────────────────────────────────── */
.salary-stat-actual .salary-stat-value {
    color: #fff !important;
}

.salary-stat-actual {
    background: linear-gradient(135deg, #2980b9, #3498db) !important;
    color: #fff !important;
}

.salary-stat-actual .salary-stat-label {
    color: #fff !important;
}

.salary-stat-sub {
    font-size: 0.8em;
    opacity: 0.75;
    margin-top: 2px;
    direction: rtl;
}

/* ─── Inline percentage/bouns spans (mobile) ─── */
.salary-stat-value span,
.salary-stat-value .inline-sub {
    display: inline-block;
    font-size: 0.75em;
    opacity: 0.85;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .salary-stat-value span {
        font-size: 0.7em;
    }
}

#stv-table-body tr.stv-my-row td {
    background: #fff8f9;
    font-weight: 700;
}

#stv-table-body tr.stv-my-row td:last-child {
    color: #820c22;
}

/* ─── Table Wrapper ──────────────────────────────────────────────────────── */
.stv-block .salary-table-wrapper {
    overflow-x: auto;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stv-container {
        padding: 8px;
    }
    .stv-block {
        padding: 12px;
        margin-bottom: 16px;
    }
    .stv-block-title {
        font-size: 15px;
    }
    .stv-month-filter {
        padding: 10px;
        gap: 6px;
    }
    .stv-month-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .stv-filter-label {
        font-size: 13px;
    }
    .stv-block .salary-table-wrapper {
        margin-left: -12px;
        margin-right: -12px;
        padding: 0 4px;
    }
    .salary-stat-value {
        font-size: 20px;
    }
    .salary-stat-label {
        font-size: 11px;
    }
    .salary-stat-card {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .stv-container {
        padding: 4px;
    }
    .stv-block {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    .stv-block-title {
        font-size: 14px;
    }
    .stv-month-filter {
        padding: 8px;
        gap: 4px;
        flex-wrap: wrap;
    }
    .stv-month-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    .stv-block .salary-table-wrapper {
        margin-left: -10px;
        margin-right: -10px;
    }
    .salary-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .salary-stat-card {
        padding: 10px 6px;
    }
    .salary-stat-value {
        font-size: 18px;
    }
    .salary-stat-label {
        font-size: 10px;
    }
}

/* ─── Salary Alert Card ──────────────────────────────────────────────────── */
.stv-alert-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    max-width: 520px;
    font-size: 13px;
    color: #1a5276;
}

.stv-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.stv-alert-text {
    flex: 1;
    line-height: 1.6;
    font-weight: 600;
}

.stv-alert-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    background: #820c22;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    font-family: inherit;
}

.stv-alert-btn:hover {
    background: #a10f2c;
}

/* ─── Salary Confirmation Bar ────────────────────────────────────────────── */
.stv-confirm-bar {
    background: #f0f7ff;
    border: 1px solid #c5d9f0;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
}

.stv-confirm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.stv-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #d4edda;
    color: #155724;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.stv-confirm-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a5276;
}

.stv-confirm-desc {
    font-size: 13px;
    color: #4a6785;
    line-height: 1.7;
    margin: 0 0 14px 0;
}

.stv-confirm-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stv-confirm-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c3e50;
    cursor: pointer;
    line-height: 1.5;
}

.stv-confirm-label input[type="checkbox"] {
    accent-color: #820c22;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.stv-confirm-btn {
    padding: 9px 22px;
    background: #820c22;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.stv-confirm-btn:disabled {
    background: #c0a3aa;
    cursor: not-allowed;
    opacity: 0.6;
}

.stv-confirm-btn:not(:disabled):hover {
    background: #a10f2c;
}

/* ─── Confirmation Popup ─────────────────────────────────────────────────── */
.stv-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.stv-popup-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.stv-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a5276;
    margin-bottom: 14px;
}

.stv-popup-text {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

.stv-popup-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.stv-popup-confirm {
    padding: 10px 24px;
    background: #820c22;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.stv-popup-confirm:hover {
    background: #a10f2c;
}

.stv-popup-cancel {
    padding: 10px 24px;
    background: #e0e0e0;
    color: #555;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.stv-popup-cancel:hover {
    background: #ccc;
}

/* ─── Success Message ────────────────────────────────────────────────────── */
.stv-success-msg {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
}

/* ─── Alert Card / Confirm Bar — Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
    .stv-alert-card {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        gap: 8px;
        text-align: center;
    }
    .stv-alert-btn {
        text-align: center;
    }
    .stv-confirm-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .stv-confirm-btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stv-alert-card {
        padding: 10px 12px;
        font-size: 12px;
    }
    .stv-alert-btn {
        padding: 6px 14px;
        font-size: 11px;
    }
    .stv-confirm-bar {
        padding: 14px 14px;
    }
    .stv-confirm-title {
        font-size: 14px;
    }
    .stv-confirm-desc {
        font-size: 12px;
    }
    .stv-confirm-label {
        font-size: 12px;
    }
    .stv-confirm-btn {
        padding: 8px 18px;
        font-size: 12px;
    }
}
