/* =============================================================
   rain.css — หน้าแดชบอร์ดฝน (ใช้ร่วมกับ dashboard.css)
   ============================================================= */

.rn-empty { padding: 30px; text-align: center; color: #64748b; }

/* กล่องข้อจำกัดของข้อมูล — ต้องเด่นกว่าการ์ดปกติ คนจะได้อ่านก่อนตัวเลข */
.rn-caveat {
    display: flex; gap: 14px; align-items: flex-start;
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 16px;
    padding: 14px 18px; margin-bottom: 26px;
    font-size: 14px; line-height: 1.75; color: #78350f;
}
.rn-caveat b { color: #92400e; }
.rn-caveat code { background: #fef3c7; padding: 1px 6px; border-radius: 5px; }
.rn-caveat-ico { font-size: 22px; line-height: 1.2; }
html.dark .rn-caveat { background: #2d2007; border-color: #78350f; color: #fcd34d; }
html.dark .rn-caveat b { color: #fbbf24; }
html.dark .rn-caveat code { background: #3b2a08; }

/* ตัวอย่างสีในข้อความ */
.rn-swatch {
    display: inline-block; width: 18px; height: 11px; border-radius: 3px;
    vertical-align: -1px; margin: 0 2px; border: 1px solid rgba(15,23,42,.15);
}
.rn-sw-missing {
    background: repeating-linear-gradient(45deg, #cbd5e1 0 3px, #f1f5f9 3px 6px);
}
.rn-sw-partial { background: rgba(56,189,248,.35); border: 1.5px solid #0284c7; }

.rn-panel { margin-bottom: 22px; }
.rn-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.rn-grid .rn-panel { margin-bottom: 0; }
.rn-grid { margin-bottom: 30px; }

.rn-chart { position: relative; height: 300px; }
.rn-chart-tall { height: 340px; }
.rn-chart-short { height: 220px; }

.rn-note { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: #64748b; }
.rn-note b { color: #334155; }
html.dark .rn-note { color: #94a3b8; }
html.dark .rn-note b { color: #e2e8f0; }

.rn-legend {
    display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
    margin-top: 12px; font-size: 13px; color: #475569;
}
.rn-legend span { display: inline-flex; align-items: center; gap: 6px; }
html.dark .rn-legend { color: #94a3b8; }

/* ตารางความรุนแรง */
.rn-class-table { margin-top: 12px; display: grid; gap: 6px; }
.rn-class-row {
    display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center;
    font-size: 13.5px; padding: 5px 8px; border-radius: 8px;
}
.rn-class-row:nth-child(odd) { background: #f8fafc; }
html.dark .rn-class-row:nth-child(odd) { background: #1a1d27; }
.rn-class-row i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.rn-class-row .rng { color: #94a3b8; font-size: 12px; }
.rn-class-row .n { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.rn-class-row .mm { color: #64748b; text-align: right; font-variant-numeric: tabular-nums; min-width: 88px; }

/* ฝนกับน้ำในอ่าง */
.rn-link { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.rn-link-text { font-size: 15px; line-height: 1.8; color: #334155; }
.rn-link-text b { font-size: 17px; }
.rn-link-text .up { color: #059669; }
.rn-link-text .down { color: #dc2626; }
.rn-link-text .flat { color: #64748b; }
html.dark .rn-link-text { color: #cbd5e1; }

/* ── ปฏิทิน ── */
/* ปฏิทินกว้างกว่าจอมือถือได้ — เลื่อนแนวนอนในกล่องของตัวเอง ไม่ให้ทั้งหน้าเลื่อน */
.rn-cal-wrap { overflow-x: auto; padding-bottom: 6px; }
.rn-cal { display: flex; gap: 14px; min-width: min-content; }
.rn-cal-month { display: flex; flex-direction: column; gap: 5px; }
.rn-cal-title { font-size: 12.5px; font-weight: 800; color: #334155; text-align: center; }
.rn-cal-grid { display: grid; grid-template-columns: repeat(7, 16px); gap: 3px; }
.rn-cal-dow { font-size: 9.5px; color: #94a3b8; text-align: center; line-height: 16px; }
.rn-cal-cell {
    width: 16px; height: 16px; border-radius: 4px; background: #f1f5f9;
    position: relative; cursor: default;
}
.rn-cal-cell.blank { background: transparent; }
.rn-cal-cell.dry { background: #e2e8f0; }
.rn-cal-cell.missing {
    background: repeating-linear-gradient(45deg, #cbd5e1 0 2px, #f8fafc 2px 4px);
}
/* ค่าไม่ครบวัน — ขอบประ ให้รู้ว่าเป็นยอดขั้นต่ำ */
.rn-cal-cell.partial { outline: 1.5px dashed #0369a1; outline-offset: -1.5px; }
.rn-cal-cell:hover { outline: 2px solid #0f172a; outline-offset: 1px; z-index: 2; }
html.dark .rn-cal-title { color: #e2e8f0; }
html.dark .rn-cal-cell { background: #1e2235; }
html.dark .rn-cal-cell.dry { background: #2d3148; }
html.dark .rn-cal-cell.blank { background: transparent; }
html.dark .rn-cal-cell.missing {
    background: repeating-linear-gradient(45deg, #475569 0 2px, #1e2235 2px 4px);
}

/* tooltip ของปฏิทิน (ตัวเดียวใช้ร่วมทุกช่อง) */
.rn-tip {
    position: fixed; z-index: 1000; pointer-events: none;
    background: #0f172a; color: #e2e8f0; border-radius: 8px;
    padding: 7px 10px; font-size: 12.5px; line-height: 1.5;
    box-shadow: 0 6px 20px rgba(15,23,42,.3);
}
.rn-tip[hidden] { display: none; }
.rn-tip b { color: #fff; }

@media (max-width: 1100px) {
    .rn-grid, .rn-link { grid-template-columns: 1fr; }
}
