@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root { 
    /* Màu sắc cốt lõi (Giữ nguyên tone Tailwind nhưng tinh chỉnh độ sáng) */
    --main: #0f172a; --main-light: #1e293b; 
    --acc: #ef4444; --green: #10b981; --blue: #3b82f6; --orange: #f59e0b; --gray: #64748b; --purp: #8b5cf6;
    --bg: #f8fafc; /* Làm nền sáng và mát hơn một chút */
    --surface: #ffffff; 
    --text: #334155; --text-light: #64748b;
    --border: #e2e8f0; --hover: #f1f5f9; --input-bg: #f8fafc;

    /* THÊM MỚI: Hệ thống quy chuẩn UI */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --main: #020617; --main-light: #0f172a; 
    --bg: #0f172a; --surface: #1e293b; --text: #f8fafc; --text-light: #94a3b8;
    --border: #334155; --hover: #334155; --input-bg: #020617;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] {
    --main: #020617; --main-light: #0f172a; 
    --bg: #0f172a; --surface: #1e293b; --text: #f8fafc; --text-light: #94a3b8;
    --border: #334155; --hover: #334155; --input-bg: #0f172a;
}

body { font-family: 'Roboto', Arial, sans-serif; background: var(--bg); margin: 0; display: flex; height: 100vh; font-size: 13px; color: var(--text); overflow: hidden; transition: background 0.3s, color 0.3s; }
::-webkit-scrollbar { width: 6px; height: 6px; } 
::-webkit-scrollbar-track { background: transparent; } 
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

#copy-warning { position:fixed; top:0; left:0; width:100%; background:var(--acc); color:#fff; text-align:center; padding:15px; font-weight:bold; font-size:15px; z-index:999999; display: block; box-shadow: 0 4px 10px rgba(0,0,0,0.3);}

/* LOGIN */
#login-screen { position:fixed; top:0; left:0; width:100%; height:100%; background:linear-gradient(135deg, var(--main), var(--main-light)); z-index:9000; display:flex; justify-content:center; align-items:center; flex-direction:column; }
.login-box { background:var(--surface); padding:35px; border-radius:12px; width:90%; max-width:340px; text-align:center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); border: 1px solid var(--border); }
.login-box input { width:100%; padding:14px; margin-bottom:15px; border-radius:8px; border:1px solid var(--border); background:var(--input-bg); color:var(--text); font-size:14px; box-sizing:border-box; outline:none;}
.login-box input:focus { border-color: var(--blue); }

/* HEADER MOBILE & SIDEBAR */
#mobile-header { display:none; background:var(--main); color:white; padding:12px 20px; justify-content:space-between; align-items:center; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.1);}
.menu-btn { background:transparent; border:none; color:white; font-size:24px; cursor:pointer; padding:0;}

.sidebar { width:220px; background:var(--main); color:#f8fafc; padding:20px 15px; display:flex; flex-direction:column; z-index:1000; overflow-y:auto; transition:0.3s; flex-shrink: 0;}
.sidebar-logo { font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; color: white; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align:center;}
.nav-item { padding:10px 12px; cursor:pointer; margin-bottom:4px; border-radius:6px; transition:0.2s; display: flex; align-items: center; gap: 8px; font-weight:600; color:#cbd5e1; font-size:12px;}
.nav-item:hover { background:var(--main-light); color:white;} 
.nav-item.active { background:var(--blue); color:white; }
.content { flex:1; padding:15px 20px; overflow-y:auto; overflow-x:hidden; position:relative; display:flex; flex-direction:column; min-width: 0; } 

/* THANH CÔNG CỤ TÍCH HỢP */
.super-sync-bar { background:var(--surface); padding:8px 15px; margin-bottom:15px; border-radius:8px; display:flex; justify-content:space-between; align-items:center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); flex-wrap: wrap; gap:10px; border:1px solid var(--border); width: 100%; box-sizing: border-box;}
.ssb-row { display: flex; align-items: center; gap: 10px; }
.ssb-row-1 { flex: 1; min-width: 250px; }
.btn-shift-urgent { background: linear-gradient(135deg, #9333ea, #db2777); color: white; padding: 8px 15px; border: none; border-radius: 6px; cursor: pointer; font-weight: 800; font-size: 12px; white-space: nowrap; animation: pulse-purple 1.5s infinite; }
@keyframes pulse-purple { 0% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); } 50% { transform: scale(1); box-shadow: 0 0 0 6px rgba(168, 85, 247, 0); } 100% { transform: scale(0.98); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } }
.btn-theme { background:var(--hover); color:var(--text); padding:6px 12px; border:1px solid var(--border); border-radius:6px; cursor:pointer; font-weight:700; font-size:11px; transition:0.2s;}

.status-badge-container { display:flex; gap:12px; font-size:12px; font-weight:700; background:var(--hover); padding:6px 15px; border-radius:6px; border:1px solid var(--border); align-items:center; flex-wrap:wrap;}
.v-divider { width:1px; height:14px; background:var(--border); margin: 0 2px;}

/* DASHBOARD GRID */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; width: 100%; }
.dash-card { background: var(--surface); padding: 15px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display:flex; flex-direction:column; border-left: 4px solid var(--border); border:1px solid var(--border);}
.dash-card.d-money { border-left-color: var(--blue); }
.dash-num { font-size: 1.6rem; font-weight: 800; margin-top: 8px; color:var(--text);} 
.dash-title { color: var(--text-light); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;}

/* --- SƠ ĐỒ PHÒNG CỐ ĐỊNH KÍCH THƯỚC BẰNG NHAU --- */
.group-title { margin: 15px 0 8px 0; color: var(--text); font-size: 1.1rem; font-weight: 800; display:flex; align-items:center; gap:10px; width: 100%;}
.group-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

#grid-container { width: 100%; display: block; }
.grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 10px !important; width: 100%; align-items: stretch; margin-bottom: 20px;}
.grid-simple { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important; gap: 10px !important; width: 100%; align-items: start; margin-bottom: 20px;}

/* --- BẮT ĐẦU CẬP NHẬT: THẺ PHÒNG (CARD) --- */
.card { 
    border-radius: var(--radius-md); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: var(--transition); 
    box-shadow: var(--shadow-sm); 
    height: 100%; 
    border: 1px solid var(--border); 
    background: var(--surface);
}
.card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg); 
}

.st-free { border-left: 4px solid var(--green); } 
.st-free .badge { background: rgba(16, 185, 129, 0.15); color: var(--green); }

.st-busy { border-left: 4px solid var(--acc); } 
.st-busy .badge { background: rgba(239, 68, 68, 0.15); color: var(--acc); }

.st-dirty { border-left: 4px solid var(--orange); } 
.st-dirty .badge { background: rgba(245, 158, 11, 0.15); color: var(--orange); }

.st-maint { border-left: 4px solid var(--gray); } 
.st-maint .badge { background: rgba(100, 116, 139, 0.15); color: var(--gray); }

.st-booked { border-left: 4px solid var(--purp); } 
.st-booked .badge { background: rgba(139, 92, 246, 0.15); color: var(--purp); }

.card-header { 
    padding: 10px 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.room-name { font-size: 1.2rem; font-weight: 900; color: var(--text); }

.card-header span.badge { 
    padding: 4px 8px; 
    border-radius: 20px; 
    font-size: 9px; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}
.card-header span.type { font-size: 8px; background: rgba(128,128,128,0.2); color: var(--text); padding: 2px 4px; border-radius: 4px; font-weight: 700; margin-left:4px;}

.card-body { 
    padding: 12px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    font-size: 11px; 
    color: var(--text-light);
    justify-content: flex-start;
}

.card-actions { 
    padding: 8px 12px; 
    display: flex; 
    gap: 8px; 
    background: var(--hover); 
    border-top: 1px solid var(--border); 
    margin-top: auto;
}
.card-actions button { 
    padding: 8px; 
    font-size: 11px; 
    border-radius: var(--radius-sm);
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display:flex; align-items:center; justify-content:center;
}
.card-actions button.btn-icon { flex: 0 0 28px; font-size: 12px; padding: 8px 0; }
/* --- KẾT THÚC CẬP NHẬT --- */

.card-simple { height: 70px; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; color: var(--text); border-radius: 8px; font-weight: bold; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05);}
.card-simple:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.card-simple.st-free { border: 2px solid var(--green); background: rgba(16, 185, 129, 0.1); color: var(--green);}
.card-simple.st-busy { border: 2px solid var(--acc); background: rgba(239, 68, 68, 0.1); color: var(--acc);}
.card-simple.st-dirty { border: 2px solid var(--orange); background: rgba(245, 158, 11, 0.1); color: var(--orange);}
.card-simple.st-maint { border: 2px solid var(--gray); background: rgba(100, 116, 139, 0.1); color: var(--gray);}
.card-simple.st-booked { border: 2px solid var(--purp); background: rgba(139, 92, 246, 0.1); color: var(--purp);}
.card-simple .s-name { font-size: 1.4rem; font-weight: 800; line-height: 1.2;} 
.card-simple .s-type { font-size: 0.65rem; opacity: 0.8; text-transform: uppercase;}

.bk-card { background:var(--surface); border:1px solid var(--border); padding:10px 15px; margin-bottom:10px; border-radius:6px; display:flex; justify-content:space-between; align-items:center; border-left:4px solid var(--purp); flex-wrap:wrap; gap:10px;}

.search-wrapper { position: relative; margin-bottom: 15px; width: 100%;}
.suggest-list { position: absolute; top: 100%; left: 0; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.2); z-index: 100000; max-height: 250px; overflow-y: auto; display: none; }
.suggest-item { padding: 10px 15px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center;}
.suggest-item:hover { background: var(--hover); }

/* UI CHUNG */
.overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0, 0, 0, 0.7); z-index:9999; justify-content:center; align-items:center; backdrop-filter: blur(3px); overflow-y:auto; padding:20px 0;}
.modal { background:var(--surface); width:95%; max-width:600px; padding:20px; border-radius:12px; max-height:90vh; overflow-y:auto; overflow-x:hidden; box-sizing:border-box; border:1px solid var(--border); margin:auto;}
.modal-title { font-size:1.3rem; color:var(--text); margin-top:0; border-bottom:2px solid var(--border); padding-bottom:10px; margin-bottom:15px; font-weight:800;}
.row { display:flex; justify-content:space-between; margin-bottom:6px; border-bottom:1px dashed var(--border); padding-bottom:4px; align-items: center; font-size:13px}

/* --- BẮT ĐẦU CẬP NHẬT: INPUT & BUTTON --- */
input, select, textarea { 
    padding: 12px 14px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border); 
    background: var(--input-bg); 
    color: var(--text); 
    width: 100%; 
    box-sizing: border-box; 
    font-family: 'Roboto', Arial, sans-serif !important; 
    font-size: 14px; 
    outline: none; 
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus { 
    border-color: var(--blue); 
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); 
}

button { 
    border: none; 
    color: #fff; 
    cursor: pointer; 
    font-weight: 700; 
    border-radius: var(--radius-md); 
    transition: var(--transition); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px; 
    box-shadow: var(--shadow-sm);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.05); 
}

button:active { 
    transform: scale(0.98); 
    box-shadow: none;
}
/* --- KẾT THÚC CẬP NHẬT --- */

.btn-g { background:var(--green); } .btn-b { background:var(--blue); } .btn-r { background:var(--acc); } .btn-y { background:var(--orange); } .btn-gy { background:var(--gray); } .btn-dark { background:var(--main-light); } .btn-purp { background:var(--purp); }
.hide { display:none !important; } .show { display:block !important; }

/* BẢNG RÚT GỌN & PHÂN TRANG */
.table-wrap { overflow-x: auto; background:var(--surface); border-radius:6px; margin-bottom:10px; border:1px solid var(--border);}
table { width:100%; border-collapse:collapse; white-space: nowrap; font-size:12px}
th, td { padding:8px 10px; border-bottom:1px solid var(--border); text-align:left;} 
th { background:var(--hover); color:var(--text-light); font-weight:700; text-transform:uppercase; font-size:11px;}

.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 0; }
.pagination button { padding: 6px 12px; border-radius: 6px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px;}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button:not(:disabled):hover { background: var(--hover); }

.inv-item { display:flex; justify-content:space-between; background:var(--hover); padding:8px 12px; border-radius:6px; margin-bottom:6px; align-items:center; border:1px solid var(--border); font-size:13px}
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

#user-list { display: flex; flex-wrap: wrap; gap: 15px; width: 100%;}
.user-card { flex: 1 1 250px; background:var(--hover); padding:15px; border-radius:8px; border:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; box-sizing: border-box;}

.co-guest-box { background:var(--hover); border:1px solid var(--border); padding:10px; border-radius:6px; margin-bottom:8px; position:relative;}
.btn-del-guest { position:absolute; top:6px; right:6px; background:var(--acc); color:white; border:none; border-radius:4px; width:20px; height:20px; font-size:10px; cursor:pointer; display:flex; justify-content:center; align-items:center;}

.pay-tag { padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; background: var(--hover); border: 1px solid var(--border); color: var(--text); }
.pay-cash { background: rgba(16, 185, 129, 0.1); color: var(--green); border-color: rgba(16, 185, 129, 0.3); }
.pay-bank { background: rgba(59, 130, 246, 0.1); color: var(--blue); border-color: rgba(59, 130, 246, 0.3); }
.pay-ota { background: rgba(139, 92, 246, 0.1); color: var(--purp); border-color: rgba(139, 92, 246, 0.3); }
.pay-gray { background: #f1f5f9 !important; color: #475569 !important; border-color: #cbd5e1 !important; }

/* GRID NHỎ GỌN TRONG DETAIL MODAL */
.compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px;}

/* ĐIỆN THOẠI RESPONSIVE - BẢN HOÀN THIỆN NÚT BẤM TRONG THẺ PHÒNG */
@media (max-width: 768px) {
    html, body { width: 100% !important; max-width: 100vw !important; overflow-x: hidden !important; margin: 0 !important; padding: 0 !important; flex-direction: column;} 
    #mobile-header { display: flex; width: 100%; box-sizing: border-box; }
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 240px; transition: 0.3s; z-index:10001; } 
    .sidebar.open { left: 0; }
    #sidebar-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); z-index:10000; backdrop-filter: blur(2px);} 
    #sidebar-overlay.open { display:block; }
    
    #main-content, .content, .view { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; padding: 6px !important; margin: 0 !important; overflow-x: hidden !important; }
    
    input, select, textarea { font-size: 13px !important; padding: 8px !important; min-height: 34px !important; box-sizing: border-box !important; max-width: 100% !important;}
    button { padding: 8px !important; font-size: 12px !important; min-height: 34px !important; }
    .btn-g, .btn-b, .btn-r, .btn-y, .btn-gy, .btn-purp, .btn-dark { padding: 6px 10px !important; }

    #grid-container .grid { 
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; 
        gap: 8px !important;
        align-items: stretch !important; 
    }
    
    #grid-container .grid-simple { 
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important; 
        gap: 6px !important;
    }
    
    #grid-container .grid > div, #grid-container .grid-simple > div { 
        min-width: 0 !important; 
        overflow: hidden !important; 
    } 

    .card { 
        height: 100% !important; 
        padding: 0 !important; 
        display: flex !important;
        flex-direction: column !important;
    }
    
    .card-header { padding: 6px 4px !important; margin-bottom: 0 !important; min-height: unset !important; display: flex; flex-wrap: wrap; justify-content: center;}
    .room-name { font-size: 1.1rem !important; margin: 0 !important; text-align: center; width: 100%;}
    .card .type { display: none !important; } 
    .card .badge { font-size: 9px !important; padding: 2px 6px !important; }
    
    .card-body { 
        flex: 1 !important; 
        padding: 6px 4px !important; 
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; 
        gap: 4px !important; 
    }
    
    .card-body > div { 
        font-size: 10px !important; 
        margin: 0 !important; 
        padding: 0 !important;
        line-height: 1.3 !important; 
        white-space: nowrap !important; 
        overflow: hidden !important; 
        text-overflow: ellipsis !important; 
        text-align: center !important;
        width: 100% !important;
    }
    
    .card-body > div > div { 
        font-size: 10px !important; 
        padding: 2px 6px !important; 
        margin: 2px auto !important; 
        white-space: nowrap !important; 
        overflow: hidden !important; 
        text-overflow: ellipsis !important;
        width: fit-content !important;
        max-width: 95% !important; 
    }
    
    /* ========================================================= */
    /* VÁ LỖI NÚT BẤM: CHIA DÒNG THÔNG MINH CHO NÚT NHẬN PHÒNG   */
    /* ========================================================= */
    .card-actions { 
        padding: 6px !important; 
        margin-top: auto !important; 
        display: flex !important; 
        flex-direction: row !important; 
        flex-wrap: wrap !important; 
        justify-content: space-between !important;
        gap: 4px !important;
    }
    
    /* Nút chữ (Nhận, Mở phòng...) chiếm trọn 100% hàng ngang để dễ bấm */
    .card-actions button:not(.btn-icon) { 
        font-size: 12px !important; 
        padding: 8px 4px !important; 
        min-height: 32px !important; 
        height: auto !important; 
        margin: 0 !important; 
        flex: 1 1 100% !important; 
    }
    
    /* Ngoại lệ: Chia đôi không gian nếu phòng Đã đặt có 2 nút chữ (Nhận và Hủy) */
    .card.st-booked .card-actions button:not(.btn-icon) {
        flex: 1 1 calc(50% - 4px) !important;
    }
    
    /* Các nút biểu tượng icon (Khóa, Chổi, Cờ lê) chia đều nhau ở hàng thứ 2 */
    .card-actions button.btn-icon {
        font-size: 12px !important;
        padding: 6px 0 !important;
        min-height: 28px !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Sơ đồ rút gọn */
    .card-simple { height: 50px !important; padding: 4px !important; }
    .card-simple .s-name { font-size: 1.2rem !important; }
    .card-simple .s-type { font-size: 0.7rem !important; }
    .card-simple div[style*="absolute"] { font-size: 9px !important; top: 4px !important; right: 4px !important; }
    .card-simple div[style*="font-size: 13px"] { font-size: 10px !important; width: 18px !important; height: 18px !important; top: -4px !important; left: -4px !important; border-width: 1px !important;} 

    /* THANH CÔNG CỤ & POPUP (ĐƯỢC THU GỌN VỪA PHẢI) */
    .super-sync-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; box-sizing: border-box; width: 100%; }
    .ssb-row { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
    .ssb-row-1 > span { font-size: 11px !important; padding: 10px 8px; }
    .ssb-row-1 > select { flex: 1; padding: 10px 6px !important; font-size: 12px !important; }
    .ssb-row-1 > input { flex: 1.5; padding: 10px 10px !important; font-size: 13px !important; }
    .status-badge-container { justify-content: center; gap: 10px; padding: 8px; margin: 0; font-size: 11px; box-sizing: border-box; width: 100%; flex-wrap: nowrap; }
    .status-badge-container b { font-size: 13px !important; }
    .ssb-row-2 > select, .ssb-row-2 > button { padding: 10px 6px !important; font-size: 12px !important; }
    .ssb-row-3 { margin-top: 4px; align-items: stretch; }
    .money-badge { padding: 8px; font-size: 12px !important; }
    #db-money { font-size: 14px !important; margin-left: 4px !important; }
    .ssb-row-3 > button { padding: 10px !important; font-size: 12px !important; }
    
    .modal { width: 95% !important; max-width: 100% !important; padding: 16px !important; margin: 10px auto !important; box-sizing: border-box !important;}
    h2.modal-title, h3 { font-size: 1.2rem !important; margin-bottom: 12px !important; padding-bottom: 6px !important; }
    .compact-grid, .input-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .input-grid label { font-size: 12px !important; margin-bottom: 4px !important; }
    #ci-prepaid-wrapper, #ci-prepaid-wrapper > div, #d-add-dep-wrapper { gap: 8px !important; flex-direction: column !important; align-items: stretch !important; }
    
    .bk-card { flex-direction: column; align-items: stretch; gap: 10px !important; padding: 12px !important; box-sizing: border-box; }
    .bk-card > div:first-child { flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; font-size: 12px !important; }
    .bk-card > div:last-child { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; gap: 6px; }
    .bk-card > div:last-child button { width: 100%; padding: 8px !important; font-size: 12px !important; min-height: 32px !important; }

    table th, table td { font-size: 12px !important; padding: 8px 4px !important; }
    .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; margin-bottom: 8px !important; width: 100% !important; box-sizing: border-box; }
    .user-card { width: 100%; flex: none; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px !important; box-sizing: border-box;}
}

/* IN HÓA ĐƠN A5 CHUẨN */
#print-section { display: none; }
@media print {
    @page { size: A5; margin: 10mm; } body { background: #fff !important; margin:0; padding:0; display:block !important; overflow: visible !important; font-family: 'Times New Roman', serif, sans-serif !important; color:#000 !important;} body > * { display: none !important; }
    #print-section { display: block !important; width: 100%; max-width: 148mm; margin: 0 auto; padding: 0; font-size: 13px; box-sizing: border-box; color:#000 !important;}
    .print-header { text-align: center; margin-bottom: 15px; border-bottom: 2px solid #000; padding-bottom: 10px; } .print-title { font-size: 20px; font-weight: bold; margin: 0; letter-spacing: 2px; text-transform: uppercase;} .print-invoice-title { font-size: 16px; font-weight: bold; text-align: center; margin: 15px 0; text-transform: uppercase; }
    .print-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 12px; } .print-table th, .print-table td { border: 1px solid #333; padding: 5px 6px; color:#000 !important; } .print-table th { background-color: #f0f0f0 !important; text-align: center; font-weight: bold; -webkit-print-color-adjust: exact; } .print-table td:nth-child(2), .print-table td:nth-child(3), .print-table td:nth-child(4) { text-align: right; }
    .print-summary { width: 100%; display: flex; justify-content: flex-end; } .print-summary-box { width: 75%; font-size:12px; } .print-summary-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #ccc; padding: 3px 0;} .print-summary-row.total { font-weight: bold; font-size: 14px; border-bottom: 2px solid #000; margin-top:5px; padding-top:5px;} .print-footer { text-align: center; margin-top: 20px; font-style: italic; font-size: 11px; }
}
.pay-debt { background: #fee2e2 !important; color: #dc2626 !important; border-color: #fca5a5 !important; font-weight: bold !important; }

<style>
    /* Ẩn nút xuất Excel dòng tiền đối với Lễ tân và Nhân viên */
    body[data-user-role="user"] .btn-excel-acc,
    body[data-user-role="receptionist"] .btn-excel-acc {
        display: none !important;
    }
</style>