/* ==========================================================================
   SBAY UI FIXES — overlay module (do not edit legacy CSS)
   Loaded via header-base-v1.php / header-base.php
   ========================================================================== */

/* ---------- 1. Cho phép zoom trên mobile (override meta no-zoom) ---------- */
@-ms-viewport { width: device-width; }

/* ---------- 2. Phan biet button primary vs success ---------- */
.btn-success,
.btn-success:focus { background-color:#28a745 !important; border-color:#1e7e34 !important; }
.btn-success:hover { background-color:#1e7e34 !important; border-color:#1c7430 !important; }

.btn-primary,
.btn-primary:focus { background-color:#1b1293 !important; border-color:#150e74 !important; }
.btn-primary:hover { background-color:#150e74 !important; border-color:#100b58 !important; }

/* ---------- 3. Alert mau dung semantic (khong override success thanh xanh duong) ---------- */
p.alert.alert-success,
.alert-success { background-color:#dff0d8 !important; color:#3c763d !important; border-color:#d6e9c6 !important; background-image:none; }
p.alert.alert-success a, .alert-success a { color:#2b542c; font-weight:700; }

/* ---------- 4. Tat shake animation gay say song ---------- */
.shake-animation,
.shake-animation.alert {
    animation: none !important;
    -webkit-animation: none !important;
}

/* ---------- 5. Footer fixed che noi dung -> doi sang static ---------- */
@media (max-width: 991px) {
    footer.main-footer { position: static !important; }
    body { padding-bottom: 0 !important; }
}

/* ---------- 6. Footer link bot chu noi (size + mau) ---------- */
footer.main-footer a {
    color: #d9534f !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* ---------- 7. Z-index widget chat khong de nut ---------- */
.zalo-chat-widget,
#fb-customer-chat,
.fb-customerchat { z-index: 100 !important; }
@media (max-width: 768px) {
    .zalo-chat-widget,
    .fb_dialog,
    #fb-customer-chat { bottom: 70px !important; }
}

/* ---------- 8. Hide loading-system khi click vao backdrop ---------- */
#loading-system { cursor: default !important; }
#loading-system img { max-width: 80px; }

/* ---------- 9. Form filter dat-cho.php khong cung 250px tren mobile ---------- */
@media (max-width: 768px) {
    input[name="bis"], input[name="StartPoint"], input[name="EndPoint"] {
        width: 100% !important;
        margin-bottom: 5px;
    }
    .danh-sach-nap-quy form .form-control,
    .danh-sach-nap-quy form select,
    .danh-sach-nap-quy form input[type="date"] {
        width: 100% !important;
        margin-bottom: 5px;
    }
}

/* ---------- 10. Bang scroll: ellipsis cho SDT (admin-dstk) ---------- */
span.sdtlienhe {
    max-width: 110px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle;
}
.tk-da-het-han {
    background: #f2dede !important;
    color: #a94442 !important;
}
.tk-da-het-han a, .tk-da-het-han .label { color: #a94442 !important; }

/* ---------- 11. Highlight vang no -> mau dieu hoa ---------- */
.danh-sach-nap-quy tr[data-status="1"] .sbay-ma-dat-cho-0,
.danh-sach-nap-quy tr[data-status1="1"] .sbay-ma-dat-cho-1 {
    background: #d4edda !important;
    color: #155724 !important;
}

/* ---------- 12. Bang dat-cho: nut hanh dong xuong dong tren mobile ---------- */
@media (max-width: 768px) {
    td .sbay-ma-dat-cho,
    td a.btn,
    td button.btn { display: inline-block; margin: 2px; font-size: 12px; }
}

/* ---------- 13. Sidebar: bang nguoi dung ngung text-shadow ---------- */
.skin-blue .sidebar-menu > li.header { color: #b8d3e8; padding-top: 12px; }

/* ---------- 14. Section notification: gioi han chieu cao + scroll ---------- */
.section-notification {
    max-height: 80px;
    overflow: hidden;
    margin: 0;
}

/* ---------- 15. Toast container (do JS dung) ---------- */
#sbay-toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100% - 32px);
}
.sbay-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 12px 36px 12px 14px;
    border-radius: 6px;
    background: #323232;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    line-height: 1.45;
    position: relative;
    animation: sbayToastIn .22s ease-out;
    word-break: break-word;
}
.sbay-toast.is-success { background: #28a745; }
.sbay-toast.is-error   { background: #d9534f; }
.sbay-toast.is-warning { background: #ec971f; }
.sbay-toast.is-info    { background: #1b1293; }
.sbay-toast .sbay-toast-close {
    position: absolute;
    top: 6px; right: 8px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: .8;
}
.sbay-toast .sbay-toast-close:hover { opacity: 1; }
@keyframes sbayToastIn {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ---------- 16. Copy button overlay cho input readonly ---------- */
.sbay-copy-wrap {
    position: relative;
    display: block;
    margin-bottom: 10px;
}
.sbay-copy-wrap input.form-control {
    padding-right: 86px;
}
.sbay-copy-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    background: #1b1293;
    color: #fff;
    border: 0;
    padding: 0 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.sbay-copy-btn:hover { background: #150e74; }
.sbay-copy-btn.is-copied { background: #28a745; }

/* ---------- 17. Pagination dat-cho: input go so trang ---------- */
.sbay-page-jump {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}
.sbay-page-jump input {
    width: 60px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 13px;
}

/* ---------- 18. Date shortcut buttons ---------- */
.sbay-date-shortcuts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}
.sbay-date-shortcuts button {
    background: #f4f4f4;
    border: 1px solid #ddd;
    color: #333;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}
.sbay-date-shortcuts button:hover { background: #1b1293; color: #fff; border-color: #1b1293; }

/* ---------- 19. Print friendly cho hoa don ---------- */
@media print {
    header.main-header,
    aside.main-sidebar,
    footer.main-footer,
    .section-notification,
    .zalo-chat-widget,
    #fb-customer-chat,
    .fb_dialog,
    #sbay-toast-host,
    .box-action,
    .pagination,
    .posts_per_page { display: none !important; }
    .content-wrapper, .content { margin-left: 0 !important; padding: 0 !important; }
    body { background: #fff !important; }
}

/* ---------- 20. Topbar tai khoan: cat khi qua dai ---------- */
.dropdown.user-menu .hidden-xs {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
