/* RM config pages — การ์ด/ฟอร์ม สไตล์เดียวทั้งกลุ่ม (พนักงาน/ทีม/แพคเกจ) */
.rm-page { max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px; }
/* หน้ารายงานตารางกว้าง — ใช้ความกว้างจอเต็มที่ (ไม่ cap 1100) */
.rm-page.wide { max-width: none; }
.rm-page h1 { font-size: 1.5rem; color: #16395e; margin: 8px 0 2px; }
.rm-sub { font-size: .85rem; color: #6b7280; margin-bottom: 14px; }

.rm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.rm-toolbar .spacer { flex: 1 1 auto; }

.rm-card { background:#fff; border:1px solid #e3e8ef; border-radius:12px;
    box-shadow:0 1px 3px rgba(16,57,94,.08); padding:18px 20px; margin:14px 0; }
.rm-card.clickable { cursor:pointer; transition:box-shadow .15s, border-color .15s; }
.rm-card.clickable:hover { border-color:#9db8d6; box-shadow:0 3px 10px rgba(16,57,94,.15); }
.rm-card-title { font-size:1.05rem; font-weight:700; color:#16395e; margin:0 0 12px;
    border-bottom:2px solid #eef2f7; padding-bottom:8px; display:flex; align-items:center; gap:10px; }
.rm-card-title .pill { font-size:.72rem; font-weight:600; background:#eef4fb; color:#2c5f93;
    border-radius:999px; padding:2px 10px; }

/* ฟอร์ม: label อยู่บน input ใหญ่ */
.rm-form { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px 18px; }
.rm-field { display:flex; flex-direction:column; gap:4px; }
.rm-field > label { font-size:.8rem; font-weight:600; color:#374151; }
.rm-field input, .rm-field select {
    font-size:.95rem; padding:8px 10px; border:1px solid #cdd5e0; border-radius:8px; background:#fff; width:100%; }
.rm-field input:focus, .rm-field select:focus { outline:none; border-color:#2c5f93; box-shadow:0 0 0 3px rgba(44,95,147,.15); }
.rm-field .suffix { font-size:.78rem; color:#9ca3af; }

/* แถวขั้น (tier) ชัดเจน */
.rm-tier { display:grid; grid-template-columns:90px 1fr 1fr 90px; gap:10px; align-items:end;
    padding:10px 12px; border:1px dashed #d7deea; border-radius:8px; margin:8px 0; background:#fafcff; }
.rm-tier .tier-no { font-weight:700; color:#2c5f93; align-self:center; }

/* ตารางอ่านง่าย */
.rm-table { width:100%; border-collapse:separate; border-spacing:0; font-size:.92rem; }
.rm-table thead th { background:#16395e; color:#fff; font-weight:600; padding:10px 12px; text-align:left; }
.rm-table thead th:first-child { border-top-left-radius:10px; }
.rm-table thead th:last-child { border-top-right-radius:10px; }
.rm-table tbody td { padding:9px 12px; border-bottom:1px solid #eef2f7; }
.rm-table tbody tr.clickable { cursor:pointer; }
.rm-table tbody tr.clickable:hover { background:#f3f8ff; }
.rm-table .num { text-align:right; font-variant-numeric:tabular-nums; }
.rm-team-chip { font-size:.78rem; background:#eef4fb; color:#2c5f93; border-radius:6px; padding:2px 8px; }

/* ปุ่ม */
.rm-btn { font-size:.9rem; font-weight:600; border:none; border-radius:8px; padding:8px 16px; cursor:pointer; color:#fff; background:#2c5f93; }
.rm-btn:hover { background:#244e7a; }
.rm-btn.green { background:#1f8a4c; } .rm-btn.green:hover { background:#19733f; }
.rm-btn.red { background:#c0392b; } .rm-btn.red:hover { background:#a3301f; }
.rm-btn.ghost { background:#fff; color:#2c5f93; border:1px solid #b7c6da; }
.rm-btn.ghost:hover { background:#f3f8ff; }
.rm-msg-ok { color:#1f8a4c; font-weight:600; } .rm-msg-err { color:#c0392b; font-weight:600; }

/* select ในฟอร์ม/toolbar */
.rm-input { width:100%; padding:8px 10px; border:1px solid #b7c6da; border-radius:8px; font-size:.92rem; background:#fff; }

/* การ์ดสรุปทีม (รายงาน incentive) */
.rm-team-cards { display:flex; gap:14px; flex-wrap:wrap; margin:6px 0 18px; }
.rm-stat-card { min-width:190px; flex:0 0 auto; background:#fff; border:1px solid #dce5f0; border-left:5px solid #2c5f93;
                border-radius:12px; padding:12px 16px; cursor:pointer; box-shadow:0 1px 3px rgba(20,50,90,.06); transition:.12s; }
.rm-stat-card:hover { box-shadow:0 3px 10px rgba(20,50,90,.12); transform:translateY(-1px); }
.rm-stat-card.active { border-left-color:#1f8a4c; background:#f4fbf6; }
.rm-stat-team { font-weight:700; color:#16395e; font-size:.95rem; }
.rm-stat-incentive { font-size:1.5rem; font-weight:800; color:#1a7f37; margin:4px 0 2px; font-variant-numeric:tabular-nums; }
.rm-stat-sub { font-size:.8rem; }
.rm-stat-sub .ok { color:#1f8a4c; font-weight:600; margin-right:8px; }
.rm-stat-sub .bad { color:#c0392b; font-weight:600; margin-right:8px; }
.rm-stat-sub .muted { color:#9aa7b6; }

/* badge สถานะถึงเป้า/ขาด + ไฮไลต์แถวคนที่ขาด */
.rm-badge { font-size:.78rem; font-weight:700; border-radius:20px; padding:3px 10px; white-space:nowrap; }
.rm-badge.ok { background:#e4f6ea; color:#1a7f37; }
.rm-badge.bad { background:#fdecea; color:#c0392b; }
.rm-table tbody tr.row-short { background:#fff8f7; }
.rm-table tbody tr.row-short:hover { background:#fdeeec; }

/* แถบแจ้งเตือน (เช่น ref_code ที่ยังไม่ตั้ง incentive / หุ้นกู้ใหม่ยังไม่ใส่) */
.alert-bar { background:#fdf3e3; border:1px solid #f0d9a8; color:#9a6b08; border-radius:10px; padding:10px 16px; margin:10px 0; font-size:.92rem; }
.menu-alert-badge { display:inline-block; min-width:18px; padding:0 6px; margin-left:6px; background:#c0392b; color:#fff;
    border-radius:999px; font-size:.72rem; font-weight:700; text-align:center; vertical-align:middle; }
