.d-r-m {
    float: left;
    width: 100%;
    height: 40px;
    text-align: right;
}

.d-row {
    float: left;
    width: 100%;
    height: 120px;
}

.d-day {
    float: left;
    width: 13.5%;
    height: auto;
    text-align: right;
    color: #999;
    font-weight: normal;
    font-size: 0.85em;
    margin-left: 5px;
    background: #fbfbfb;
    padding-top: 2px;
}

.head-day {
    height: 30px;
}

.d-date {
    border-top: 1px solid #ddd;
    float: left;
    width: 13.5%;
    height: 120px;
    margin-left: 5px;
}

.current-day {
    background: #baefc5;
    border-top: 1px solid #479c1c;
}

.d-date .d-date-num {
    text-align: right;
    color: #999;
    font-weight: normal;
    font-size: 0.85em;
    display: block;
}

.d-date .d-date-text {
    text-align: left;
    color: #999;
    font-weight: normal;
    font-size: 0.85em;
    display: block;
    padding-left: 10px;
}

.d-blank {
    background-color: #f7f7f7;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.41' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    cursor: not-allowed;
}

.d-holiday {
    border-top: 1px solid #ce3f3f;
    background-color: #f9eded;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 28' width='56' height='28'%3E%3Cpath fill='%23f98f8f' fill-opacity='0.11' d='M56 26v2h-7.75c2.3-1.27 4.94-2 7.75-2zm-26 2a2 2 0 1 0-4 0h-4.09A25.98 25.98 0 0 0 0 16v-2c.67 0 1.34.02 2 .07V14a2 2 0 0 0-2-2v-2a4 4 0 0 1 3.98 3.6 28.09 28.09 0 0 1 2.8-3.86A8 8 0 0 0 0 6V4a9.99 9.99 0 0 1 8.17 4.23c.94-.95 1.96-1.83 3.03-2.63A13.98 13.98 0 0 0 0 0h7.75c2 1.1 3.73 2.63 5.1 4.45 1.12-.72 2.3-1.37 3.53-1.93A20.1 20.1 0 0 0 14.28 0h2.7c.45.56.88 1.14 1.29 1.74 1.3-.48 2.63-.87 4-1.15-.11-.2-.23-.4-.36-.59H26v.07a28.4 28.4 0 0 1 4 0V0h4.09l-.37.59c1.38.28 2.72.67 4.01 1.15.4-.6.84-1.18 1.3-1.74h2.69a20.1 20.1 0 0 0-2.1 2.52c1.23.56 2.41 1.2 3.54 1.93A16.08 16.08 0 0 1 48.25 0H56c-4.58 0-8.65 2.2-11.2 5.6 1.07.8 2.09 1.68 3.03 2.63A9.99 9.99 0 0 1 56 4v2a8 8 0 0 0-6.77 3.74c1.03 1.2 1.97 2.5 2.79 3.86A4 4 0 0 1 56 10v2a2 2 0 0 0-2 2.07 28.4 28.4 0 0 1 2-.07v2c-9.2 0-17.3 4.78-21.91 12H30zM7.75 28H0v-2c2.81 0 5.46.73 7.75 2zM56 20v2c-5.6 0-10.65 2.3-14.28 6h-2.7c4.04-4.89 10.15-8 16.98-8zm-39.03 8h-2.69C10.65 24.3 5.6 22 0 22v-2c6.83 0 12.94 3.11 16.97 8zm15.01-.4a28.09 28.09 0 0 1 2.8-3.86 8 8 0 0 0-13.55 0c1.03 1.2 1.97 2.5 2.79 3.86a4 4 0 0 1 7.96 0zm14.29-11.86c1.3-.48 2.63-.87 4-1.15a25.99 25.99 0 0 0-44.55 0c1.38.28 2.72.67 4.01 1.15a21.98 21.98 0 0 1 36.54 0zm-5.43 2.71c1.13-.72 2.3-1.37 3.54-1.93a19.98 19.98 0 0 0-32.76 0c1.23.56 2.41 1.2 3.54 1.93a15.98 15.98 0 0 1 25.68 0zm-4.67 3.78c.94-.95 1.96-1.83 3.03-2.63a13.98 13.98 0 0 0-22.4 0c1.07.8 2.09 1.68 3.03 2.63a9.99 9.99 0 0 1 16.34 0z'%3E%3C/path%3E%3C/svg%3E");
}

.d-holiday span {
    color: #de6b6b !important;
}

.d-sat {
    border-top: 1px solid #bfb5f5;
    background: #f0e6f7;
}

.d-sun {
    border-top: 1px solid #f193be;
    background: #fdeaf0;
}

.r-week {
    float: left;
    width: 100%;
    height: 125px
}

.d-calen {
    overflow: hidden;
}

.d-date-text .t0 {
    background: #f9d9ec;
    border-left: 3px solid #e6a2cb;
    font-size: 0.65em;
    color: #c1398a;
    display: block;
    margin-top: 1px;
}
.d-date-text .t1 {
    background: #c5a7f7;
    border-left: 3px solid #9a60f8;
    font-size: 0.65em;
    color: #5725a7;
    display: block;
    margin-top: 1px;
}
.d-date-text .t2 {
    background: #dbfa86;
    border-left: 3px solid #c0e065;
    font-size: 0.65em;
    color: #80a911;
    display: block;
    margin-top: 1px;
} 

.dlremove {
    text-align: center;
    position: absolute;
    right: 30px;
    border-radius: 10px;
    border: 1px solid #ea7171;
    width: 30px;
    background: #ea7171;
    color: #fff !important;
    cursor: pointer;
}
.remark-color-t0{
    background: #f9d9ec;
    border-left: 3px solid #e6a2cb;
    font-size: 0.65em;
    color: #c1398a;
    display: block;
    margin-top: 1px;
    width: 150px;
}
.remark-color-t1{
    background: #c5a7f7;
    border-left: 3px solid #9a60f8;
    font-size: 0.65em;
    color: #5725a7;
    display: block;
    margin-top: 1px;
    width: 150px;
}
.remark-color-t2{
    background: #dbfa86;
    border-left: 3px solid #c0e065;
    font-size: 0.65em;
    color: #80a911;
    display: block;
    margin-top: 1px;
    width: 150px;
}
.dledit {
    text-align: center;
    position: absolute;
    right: 60px;
    border-radius: 10px;
    border: 1px solid #89ea71;
    width: 30px;
    background: #89ea71;
    color: #fff !important;
    cursor: pointer;
}

@media (max-width: 760px) {
    .d-date {
        width: 120px;
    }
    .d-day {
        width: 120px;
    }
    .d-calen {
        overflow-x: scroll;
        width: 100%;
    }
    .d-r-m {
        width: 840px;
    }
    .d-row {
        width: 890px;
    }
    .r-week {
        width: 890px;
    }
}

/* ป้ายรายการในเซลล์: ไม่ให้ล้นกรอบ ตัดด้วย ... และมี "+N รายการ" เมื่อมีมาก */
.d-date-text .t0,
.d-date-text .t1,
.d-date-text .t2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.d-date-text .d-more {
    display: block;
    margin-top: 1px;
    font-size: 0.65em;
    font-weight: bold;
    color: #666;
    text-align: right;
    padding-right: 4px;
}
.dlist-date {
    cursor: pointer;
    overflow: hidden;
}

/* =====================================================================
   Pastel Thai Calendar — ทับกฎด้านบน (รูปแบบเดียวกับ doc/Pastel Thai Calendar Dashboard.png)
   ===================================================================== */
.d-calen {
    padding-bottom: 6px;
}

/* ชื่อเดือน-ปี */
.d-r-m {
    height: 54px;
    text-align: left;
    font-size: 1.9rem;
    font-weight: 700;
    color: #d6336c;
    line-height: 1.2;
}
.d-r-m strong {
    color: #2b2f4a;
}

/* หัวคอลัมน์วัน */
.head-day {
    height: 50px;
}
.d-day {
    text-align: center;
    background: #e3f4fb;
    color: #1f4f4e;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.25;
    padding: 6px 2px;
    border-radius: 8px;
}
.head-day .d-day:nth-child(6),
.head-day .d-day:nth-child(7) {
    background: #fde4ec;
    color: #d6336c;
}
.d-day small {
    display: block;
    font-weight: 400;
    color: #8a8fa8;
}
.head-day .d-day:nth-child(6) small,
.head-day .d-day:nth-child(7) small {
    color: #e48aab;
}

/* ช่องวัน */
.d-date {
    background: #fff;
    border: 1px solid #e9ecf5;
    border-radius: 10px;
    height: 120px;
    margin-top: 5px;
    padding: 2px 4px 4px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.dlist-date:hover {
    box-shadow: 0 6px 16px rgba(120, 140, 190, 0.22);
    transform: translateY(-1px);
}
.d-date .d-date-num {
    color: #6b708a;
    font-weight: 600;
    font-size: 0.9em;
    padding-right: 4px;
}
.d-date .d-date-text {
    padding-left: 0;
    color: #6b708a;
}
.r-week {
    height: 126px;
}

.d-blank {
    background-color: #f4f6fa;
    border: 1px solid #eef0f6;
    cursor: default;
}
.d-blank:hover {
    box-shadow: none;
    transform: none;
}

.d-sat {
    background: #f1ebfc;
    border-color: #e4d9fa;
}
.d-sun {
    background: #fdeaf1;
    border-color: #f8d3e1;
}
.d-holiday {
    background-color: #fdeef1;
    border-color: #f7b6cd;
}
.d-holiday .d-date-num {
    color: #d6336c;
    font-weight: 700;
}
.d-holiday span {
    color: #d6336c !important;
}
.d-holiday .d-date-text {
    font-size: 0.95em;
    font-weight: 600;
}
.current-day {
    background: #d5f5e3;
    border-color: #7ccf9f;
}
.current-day .d-date-num {
    color: #1f7a4a;
    font-weight: 700;
}

/* ป้ายรายการ: ชมพู = ล่วงเวลา, ม่วงอ่อน = ตารางงาน, เขียวมิ้นต์ = บันทึกแจ้ง */
.d-date-text .t0,
.d-date-text .t1,
.d-date-text .t2 {
    border-left: 0;
    border-radius: 7px;
    padding: 2px 6px;
    margin-top: 3px;
    font-size: 0.72em;
    font-weight: 600;
}
.d-date-text .t0 { background: #fbd5e5; color: #b02a62; }
.d-date-text .t1 { background: #e3d6fb; color: #5b3fa8; }
.d-date-text .t2 { background: #cdf2dd; color: #1f7a4a; }
.d-date-text .d-more {
    color: #8a8fa8;
    font-size: 0.72em;
}

/* คำอธิบายสีใต้ปฏิทิน */
.remark-color-t0,
.remark-color-t1,
.remark-color-t2 {
    border-left: 0;
    border-radius: 999px;
    padding: 3px 12px;
    margin-top: 6px;
    font-size: 0.8em;
    font-weight: 600;
    width: 170px;
}
.remark-color-t0 { background: #fbd5e5; color: #b02a62; }
.remark-color-t1 { background: #e3d6fb; color: #5b3fa8; }
.remark-color-t2 { background: #cdf2dd; color: #1f7a4a; }

/* ปุ่มแก้ไข/ลบในกล่องรายละเอียด */
.dlremove,
.dledit {
    border-radius: 999px;
    font-size: 0.8em;
    line-height: 1.6;
}
.dlremove {
    background: #f7b6cd;
    border-color: #f7b6cd;
}
.dledit {
    background: #9fdcbc;
    border-color: #9fdcbc;
}
.d-holiday .d-date-text .t0 { color: #b02a62 !important; }
.d-holiday .d-date-text .t1 { color: #5b3fa8 !important; }
.d-holiday .d-date-text .t2 { color: #1f7a4a !important; }
