/* =====================================================================
   CSS cho các component dùng chung tự viết (Servers/Components/Custom).
   ===================================================================== */

/* ===== SelectCustom — select tự viết có ô gõ lọc chữ (class .it-cbx) ===== */
.it-cbx {
    position: relative;
    width: 100%;
}

.it-cbx .it-cbx-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 32px 8px 12px;
    border: 1px solid #dde3ea;
    border-radius: 7px;
    font-size: 13px;
    background: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

    .it-cbx .it-cbx-input:focus {
        outline: none;
        border-color: #2f6fb2;
    }

.it-cbx.has-value .it-cbx-input {
    background-image: none;
}

.it-cbx-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
}

    .it-cbx-clear:hover {
        background: #eef1f5;
        color: #333;
    }

.it-cbx.has-value .it-cbx-clear {
    display: flex;
}

.it-cbx-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(16,24,40,.10);
    z-index: 50;
    display: none;
}

    .it-cbx-panel.open {
        display: block;
    }

.it-cbx-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #23324a;
    cursor: pointer;
}

    .it-cbx-option:hover {
        background: #2f6fb2;
        color: #fff;
    }

.it-cbx-empty {
    padding: 8px 12px;
    font-size: 12px;
    color: #98a2b3;
}

/* ===== DateInputCustom — ô nhập ngày (text tự do) + nút mở lịch ===== */
.dic-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.dic-wrap .dic-text {
    width: 100%;
    box-sizing: border-box;
    padding-right: 30px !important;
}

.dic-wrap .dic-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7683;
    cursor: pointer;
}

    .dic-wrap .dic-btn:hover {
        color: #2f6fb2;
    }

    .dic-wrap .dic-btn:disabled {
        color: #c3c9d1;
        cursor: default;
    }

/* Lịch tự vẽ (DateCalendarHost đặt ở gốc app, position:fixed theo toạ độ ô -> đè lên tất cả, không bị dialog cắt) */
.dic-cal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: transparent;
}

.dic-cal {
    position: fixed;
    z-index: 4001;
    width: 250px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #dde3ea; /* viền giống ô text */
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .12);
    padding: 10px;
}

.dic-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dic-title-btn {
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #23324a;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

    .dic-title-btn:hover {
        background: #eef3f9;
        color: #2f6fb2;
    }

/* Lưới chọn tháng */
.dic-mon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.dic-mon {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 12px 0;
    font-size: 12.5px;
    color: #23324a;
    cursor: pointer;
    text-align: center;
}

    .dic-mon:hover {
        background: #eef3f9;
    }

    .dic-mon.sel {
        background: #2f6fb2;
        color: #fff;
        font-weight: 700;
    }

.dic-nav {
    width: 26px;
    height: 26px;
    border: 1px solid #e3e7ec;
    border-radius: 6px;
    background: #fff;
    color: #5b6472;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

    .dic-nav:hover {
        border-color: #2f6fb2;
        color: #2f6fb2;
    }

.dic-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dic-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #8a93a0;
    padding: 4px 0;
}

.dic-day {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 12.5px;
    color: #23324a;
    cursor: pointer;
    text-align: center;
}

    .dic-day:hover {
        background: #eef3f9;
    }

    .dic-day.muted {
        color: #c3c9d1;
    }

    .dic-day.today {
        border-color: #2f6fb2;
    }

    .dic-day.sel {
        background: #2f6fb2;
        color: #fff;
        font-weight: 700;
    }

.dic-cal-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.dic-link {
    border: 0;
    background: transparent;
    color: #2f6fb2;
    font-size: 12.5px;
    cursor: pointer;
    padding: 2px 4px;
}

    .dic-link:hover {
        text-decoration: underline;
    }
