﻿.mon-page {
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size: 13px;
    color: #1e293b;
}

.mon-page .main-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 10px;
    align-items: start;
}

.mon-page .tkb-card {
    background: #ffffff;
    border: 1px solid #c8d5ea;
    border-radius: 8px;
}

.mon-page .form-card {
    padding: 10px;
}

.mon-page .right-panel {
    padding: 0;
    overflow: hidden;
}

/* ===== TỔNG TIẾT ===== */

.mon-page .tong-tiet-box {
    background: #1a3568;
    color: #c8d5ea;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 650;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .mon-page .tong-tiet-box strong {
        color: #ffffff;
        font-size: 13px;
        font-weight: 600;
    }

/* ===== INPUT NOTE ===== */

.mon-page .input-note {
    font-size: 11px;
    font-weight: 500;
    color: #4a6080;
    margin-bottom: 3px;
}

/* ===== BUTTONS ===== */

.mon-page .form-btn {
    height: 36px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: filter .15s;
    min-width: 120px;
}

    .mon-page .form-btn:hover {
        filter: brightness(.93);
    }

.mon-page .btn-save {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

.mon-page .btn-delete-all {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
}

.mon-page .btn-back {
    background: #e8eef8;
    color: #1a3568;
    border-color: #b3c5de;
}

.mon-page .btn-next {
    background: #1a3568;
    color: #fff;
    border-color: #122549;
}

/* ===== TAB BAR ===== */

.mon-page .tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px 0;
    background: #f4f7fb;
    border-bottom: 2px solid #c8d5ea;
}

.mon-page .tab-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #c8d5ea;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: #4a6080;
    background: #e8eef8;
    position: relative;
    bottom: -2px;
    transition: background .15s, color .15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .mon-page .tab-btn.active {
        background: #1a3568;
        color: #e8eef8;
        border-color: #1a3568;
        z-index: 1;
    }

    .mon-page .tab-btn:hover:not(.active) {
        background: #dce7f3;
        color: #1a3568;
    }

.mon-page .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    font-size: 10px;
    padding: 0 4px;
    min-width: 16px;
}

.mon-page .tab-btn:not(.active) .tab-badge {
    background: #c8d5ea;
    color: #1a3568;
}

/* ===== TABLE PANEL ===== */

.mon-page .table-panel {
    padding: 10px;
}

/* ===== STATS PANEL ===== */

.mon-page .stats-panel {
    background: #f4f7fb;
    border: 1px solid #dce7f3;
    border-radius: 18px;
    padding: 6px;
    margin-bottom: 12px;
}

/* 4 metric cards */
.mon-page .stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.mon-page .stat-card {
    background: #CDF5FA;
    border: 1px solid #c8d5ea;
    border-radius: 6px;
    padding: 4px 8px;
}

.mon-page .stat-card-warn {
    border-color: #CDF5FA;
    background: #fffbeb;
}

.mon-page .stat-label {
    font-size: 12px;
    color: #4a6080;
    font-weight: 600;
    margin-bottom: 3px;
}

.mon-page .stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #1a3568;
    line-height: 1.2;
}

.mon-page .stat-value-warn {
    color: #b45309;
}

.mon-page .stat-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mon-page .stats-section {
    background: #ffffff;
    border: 1px solid #c8d5ea;
    border-radius: 6px;
    padding: 8px 10px;
}

.mon-page .stats-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a3568;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e8eef8;
}

/* Warning box */
.mon-page .warn-box {
    background: #fffbeb;
    border: 1px solid #CDF5FA;
    border-radius: 5px;
    padding: 6px 9px;
    margin-top: 6px;
}

.mon-page .warn-row {
    font-size: 12px;
    color: #92400e;
    margin-bottom: 3px;
    line-height: 1.4;
}

    .mon-page .warn-row:last-child {
        margin-bottom: 0;
    }

/* ===== KHỐI HEADER ===== */

.mon-page .khoi-header {
    font-size: 12px;
    font-weight: 600;
    color: #1a3568;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mon-page .khoi-stats {
    display: flex;
    gap: 5px;
}

.mon-page .badge {
    background: #e8eef8;
    color: #1a3568;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
}

.mon-page .badge-tiet {
    background: #1a3568;
    color: #e8eef8;
}

/* ===== TABLE ===== */

.mon-page .table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #c8d5ea;
    border-radius: 6px;
}

.mon-page .khoi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

    .mon-page .khoi-table th {
        background: #1a3568;
        color: #e8eef8;
        font-weight: 600;
        text-align: center;
        padding: 7px 5px;
        border-right: 1px solid #2d4f8a;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .mon-page .khoi-table td {
        padding: 6px 7px;
        border-right: 1px solid #dce7f3;
        border-bottom: 1px solid #dce7f3;
        color: #1e293b;
    }

        .mon-page .khoi-table th:last-child,
        .mon-page .khoi-table td:last-child {
            border-right: none;
        }

    .mon-page .khoi-table tr:last-child td {
        border-bottom: none;
    }

    .mon-page .khoi-table td.mon {
        text-align: left;
        font-weight: 500;
        color: #0f172a;
        word-break: break-word;
    }

    .mon-page .khoi-table tbody tr:hover {
        background: #f0f5fc;
    }

    .mon-page .khoi-table tbody tr:nth-child(even) {
        background: #f7f9fd;
    }

        .mon-page .khoi-table tbody tr:nth-child(even):hover {
            background: #f0f5fc;
        }

/* ===== ACTION ===== */

.mon-page .col-action {
    width: 72px;
    text-align: center;
}

.mon-page .actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.mon-page .btn-edit {
    background: #f59e0b;
    color: #4a2800;
    border: none;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
}

    .mon-page .btn-edit:hover {
        filter: brightness(.9);
    }

.mon-page .btn-delete {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
}

    .mon-page .btn-delete:hover {
        filter: brightness(.88);
    }

/* ===== MODAL SỬA MÔN ===== */

.modal-dialog {
    max-width: 500px;
}

.modal-content {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,.25);
}

.modal-header-navy {
    background: linear-gradient(135deg,#1a3568,#244b93);
    color: white;
    border-bottom: none;
    padding: 14px 18px;
}

    .modal-header-navy .modal-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0;
    }

.modal-body {
    padding: 18px;
    background: #f8fbff;
}

    /* Input */

    .modal-body .form-control {
        height: 42px;
        border: 1px solid #c8d5ea;
        border-radius: 8px;
        font-size: 13px;
    }

        .modal-body .form-control:focus {
            border-color: #1a3568;
            box-shadow: 0 0 0 0.18rem rgba(26,53,104,.15);
        }

/* Footer buttons */

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.btn-modal-save {
    min-width: 110px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #1a3568;
    color: white;
    font-weight: 600;
    transition: .2s;
}

    .btn-modal-save:hover {
        background: #244b93;
    }

.btn-modal-cancel {
    min-width: 90px;
    height: 38px;
    border: 1px solid #c8d5ea;
    border-radius: 8px;
    background: white;
    color: #475569;
    font-weight: 600;
    transition: .2s;
}

    .btn-modal-cancel:hover {
        background: #eef4ff;
    }

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    .mon-page .main-layout {
        grid-template-columns: 1fr;
    }

    .mon-page .form-card {
        order: -1;
    }
    /* 4 metric = 2 cột */
    .mon-page .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .mon-page .stats-panel,
    .mon-page .table-panel,
    .mon-page .stat-card {
        padding: 8px;
    }

    .mon-page .stat-sub {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }

    .mon-page .tab-btn {
        height: 28px;
        padding: 0 8px;
        font-size: 10px;
    }

    .mon-page .khoi-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .mon-page .khoi-stats {
        width: 100%;
        flex-wrap: wrap;
    }

    .mon-page .khoi-table {
        font-size: 11px;
    }

    .mon-page .table-wrapper {
        max-height: 300px;
    }
}
