/* =========================================
   1. โครงสร้างพื้นฐาน (Base Styles - Light Theme)
   ========================================= */
.msr-container {
    width: 100%;
    margin: 20px 0;
    font-family: inherit;
    color: #374151; /* สีข้อความหลักเข้ม */
}
.msr-action-bar-full {
    width: 100%;
    margin-bottom: 30px;
}
.msr-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}
.msr-btn-submit {
    background-color: #0384fb; /* เขียวสว่าง */
    color: #fff;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}
.msr-btn-submit:hover {
    background-color: #008000;
    color: #fff;
}
.msr-btn-submit:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}
.msr-btn-view {
    background-color: #f3f4f6; 
    color: #374151 !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #d1d5db;
    display: inline-block;
}
.msr-btn-view:hover {
    background-color: #2563eb;
    color: #fff !important;
    border-color: #2563eb;
}

/* =========================================
   ปุ่ม Premium 100% 
   ========================================= */
.msr-btn-premium {
    position: relative;
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, #3b82f6 0%, #3b82f6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}
.msr-btn-premium .msr-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}
.msr-btn-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shine-effect 4s infinite;
}
@keyframes shine-effect {
    0% { left: -100%; }
    15% { left: 200%; }
    100% { left: 200%; }
}
.msr-btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #2563eb 100%);
}
.msr-btn-premium:hover .msr-icon {
    transform: rotate(15deg) scale(1.2);
}

/* =========================================
   2. ฟอร์ม Popup 
   ========================================= */
.msr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* พื้นหลังดำโปร่งใส */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.msr-popup-box {
    background: #ffffff; /* พื้นหลังขาว */
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: fadeIn 0.3s ease;
    box-sizing: border-box;
}
.msr-popup-box h3 {
    color: #111827;
    margin-top: 0;
    margin-bottom: 20px;
}
.msr-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}
.msr-close:hover {
    color: #111827;
}
.msr-form-group {
    margin-bottom: 15px;
    text-align: left;
}
.msr-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #4b5563;
}
.msr-form-group input {
    width: 100%;
    padding: 10px;
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-sizing: border-box;
}
.msr-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.required { color: #ef4444; }

.msr-alert {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}
.msr-alert-success { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.msr-alert-error { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* =========================================
   3. ตารางแสดงผล
   ========================================= */
.msr-table-title {
    margin: 20px 0 10px 0;
    font-weight: bold;
    color: #111827;
}
.msr-table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 20px;
}
.msr-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #ffffff;
}
.msr-table th, .msr-table td {
    border: 1px solid #e5e7eb;
    padding: 12px 15px;
    text-align: left;
    font-size: 14px;
    color: #374151;
}
.msr-table th {
    background-color: #f9fafb;
    color: #111827;
    font-weight: 700;
}
.msr-artist-label {
    color: #6b7280;
    font-size: 13px;
}
.msr-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.badge-warning { background-color: #fef3c7; color: #d97706; }
.badge-success { background-color: #dcfce7; color: #15803d; }
.msr-text-muted { color: #9ca3af; }

/* =========================================
   4. ระบบแบ่งหน้า
   ========================================= */
.msr-pagination { margin-top: 20px; text-align: center; }
.msr-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s;
}
.msr-pagination .page-numbers:hover { background: #f3f4f6; }
.msr-pagination .page-numbers.current {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* =========================================
   5. รองรับหน้าจอมือถือ (Responsive)
   ========================================= */
@media screen and (max-width: 600px) {
    .msr-table th, .msr-table td { padding: 8px 10px; font-size: 13px; }
    .msr-btn-view { padding: 4px 8px; font-size: 11px; }
    
    /* ซ่อนคอลัมน์ที่ 1 (วันที่ขอ) */
    .msr-table th:nth-child(1),
    .msr-table td:nth-child(1) {
        display: none;
    }
    
    .msr-popup-box { width: 90%; padding: 20px; }
}