/* FILE: /assets/css/style.css */
/* CHUẨN GIAO DIỆN: LiquiD Glass 2.0 (Solid Layout & Hover UX) - COMPACT & READABLE EDITION */

:root {
    /* MÀU CỐ ĐỊNH */
    --primary: #3296fa;
    --primary-dark: #1e70d6;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* KÍCH THƯỚC */
    --sidebar-w: 260px;
    --sidebar-mini-w: 80px;
    --navbar-h: 60px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --blur: blur(20px);

    /* BIẾN SỐ LIGHT MODE */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-deep: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.8);
    --glass-bg: #ffffff;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.15);
    --table-header: rgba(50, 150, 250, 0.05);
    --table-border: rgba(0, 0, 0, 0.05);
}

/* BIẾN SỐ DARK MODE */
html[data-theme="dark"] {
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-deep: #070e1a;
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    --glass-bg: rgba(30, 41, 59, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.2);
    --table-header: rgba(50, 150, 250, 0.1);
    --table-border: rgba(255, 255, 255, 0.05);
}

/* ================== RESET & BASE ================== */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-deep);
    font-size: 14px;
    margin: 0; padding: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(50, 150, 250, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.08), transparent 25%);
    z-index: -1; pointer-events: none;
}
html[data-theme="dark"] body::before {
    background: radial-gradient(circle at 15% 50%, rgba(50, 150, 250, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
}

a { text-decoration: none; color: var(--primary); }
h1, h2, h3, h4, h5, h6 { color: var(--text-main); }

/* ================== LAYOUT HỆ THỐNG ================== */
.sidebar {
    width: var(--sidebar-w); background: var(--sidebar-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--glass-border);
    position: fixed; top: 0; left: 0; height: 100vh;
    display: flex; flex-direction: column; z-index: 1000;
    transition: width 0.3s ease;
}
.sidebar-header {
    height: var(--navbar-h); padding: 0 15px;
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: space-between;
}
.logo-box { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.pin-btn { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); transition: 0.3s;}
.pin-btn:hover { color: var(--primary); }

.sidebar-menu { flex: 1; padding: 10px 0; overflow-y: auto; overflow-x: hidden; }
.menu-item {
    display: flex; align-items: center; padding: 10px 15px; gap: 10px;
    color: var(--text-muted); font-weight: 600; font-size: 14px;
    transition: all 0.3s ease; cursor: pointer; border-left: 4px solid transparent;
}
.menu-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.menu-item .menu-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0;}
.menu-item .arrow { margin-left: auto; font-size: 11px; color: var(--text-muted); transition: 0.3s;}
.menu-item:hover, .menu-item.active { background: rgba(50, 150, 250, 0.1); color: var(--primary); border-left-color: var(--primary); }
.menu-item.disabled-menu { opacity: 0.5; cursor: not-allowed; }

.submenu { background: rgba(0,0,0,0.02); }
[data-theme="dark"] .submenu { background: rgba(255,255,255,0.02); }
.submenu .menu-item { padding: 10px 15px 10px 45px; font-size: 13px; font-weight: 500; border: none; }
.submenu .menu-item:hover, .submenu .menu-item.active { background: rgba(50, 150, 250, 0.1); }

/* SIDEBAR THU GỌN */
html.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar-menu { width: var(--sidebar-mini-w); overflow: visible !important; }
html.sidebar-collapsed .sidebar-header { justify-content: center; padding: 0; }
html.sidebar-collapsed .logo-box, html.sidebar-collapsed .menu-text, html.sidebar-collapsed .arrow { display: none !important; }
html.sidebar-collapsed .menu-item { justify-content: center; padding: 12px 0; position: relative;}
html.sidebar-collapsed .menu-icon { margin: 0; font-size: 20px;}
html.sidebar-collapsed .submenu { display: block !important; background: transparent !important;}
html.sidebar-collapsed .submenu .menu-item { padding: 12px 0 !important; }

html.sidebar-collapsed .menu-item::after {
    content: attr(data-tooltip);
    position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    background: var(--primary); color: white; padding: 6px 12px;
    border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap;
    opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.2s ease; z-index: 1001;
    box-shadow: 0 4px 15px rgba(50, 150, 250, 0.4);
}
html.sidebar-collapsed .menu-item::before {
    content: ""; position: absolute; left: calc(100% - 5px); top: 50%; transform: translateY(-50%);
    border: 5px solid transparent; border-right-color: var(--primary);
    opacity: 0; visibility: hidden; transition: all 0.2s ease; z-index: 1001;
}
html.sidebar-collapsed .menu-item:hover::after { opacity: 1; visibility: visible; left: calc(100% + 12px); }
html.sidebar-collapsed .menu-item:hover::before { opacity: 1; visibility: visible; left: calc(100% + 2px); }

/* TOP NAVBAR */
.main-wrapper {
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column; min-height: 100vh;
    width: calc(100% - var(--sidebar-w)); transition: margin-left 0.3s ease, width 0.3s ease;
}
html.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-mini-w); width: calc(100% - var(--sidebar-mini-w)); }

.top-navbar {
    height: var(--navbar-h); background: var(--glass-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; position: fixed; top: 0; right: 0; left: var(--sidebar-w);
    z-index: 900; transition: left 0.3s ease;
}
html.sidebar-collapsed .top-navbar { left: var(--sidebar-mini-w); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-icon-btn { background: transparent; border: none; font-size: 20px; cursor: pointer; padding: 4px; color: var(--text-main);}
.nav-divider { height: 20px; width: 1px; background: var(--glass-border); margin: 0 5px; }
.user-info { text-align: right; line-height: 1.2; }
.user-name { margin: 0; font-size: 15px; font-weight: 700; }
.user-role { color: var(--text-muted); font-size: 11px; text-transform: uppercase; font-weight: 600;}
.user-profile-wrapper { position: relative; cursor: pointer; display: flex; align-items: center; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: bold; border: 2px solid transparent; transition: 0.3s; font-size: 16px;
}
.user-profile-wrapper:hover .user-avatar { box-shadow: 0 0 10px rgba(50,150,250,0.3);}

.profile-dropdown {
    position: absolute; top: 50px; right: 0; width: 220px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); box-shadow: var(--glass-shadow);
    display: none; flex-direction: column; padding: 8px 0; z-index: 1000;
}
.profile-dropdown.show { display: flex; animation: slideDown 0.2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item { padding: 12px 16px; color: var(--text-main); font-size: 13px; font-weight: 600; transition: 0.2s; }
.dropdown-item:hover { background: rgba(50, 150, 250, 0.1); color: var(--primary); padding-left: 20px;}
.dropdown-divider { height: 1px; background: var(--glass-border); margin: 4px 0; }
.text-danger { color: var(--danger) !important; }
.text-danger:hover { background: rgba(239, 68, 68, 0.1) !important; color: var(--danger) !important;}

/* MAIN CONTENT */
.main-content { margin-top: var(--navbar-h); padding: 8px 16px; flex: 1; }

/* ================== COMPONENT KÍNH MỜ & BẢNG (COMPACT UI) ================== */
.glass-card, .glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 12px;
    transition: 0.3s;
    overflow: visible !important;
}
.glass-card:hover { border-color: rgba(50, 150, 250, 0.3); }

.glass-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.glass-table th {
    background: var(--table-header);
    padding: 12px 14px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 2px solid var(--table-border);
}
.glass-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--table-border);
    font-size: 14px;
}
.glass-table tr:hover td { background: rgba(50, 150, 250, 0.05); }

/* ================== FORM & INPUT ================== */
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-weight: bold; margin-bottom: 6px; color: var(--text-main); font-size: 13px; text-transform: uppercase;}
.input-desc { color: var(--text-muted); font-size: 12px; margin-top: 4px; display: block; line-height: 1.4;}

input, select, textarea {
    width: 100%; padding: 10px 14px;
    background: var(--input-bg); border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); color: var(--text-main); font-family: inherit; font-size: 14px; outline: none; transition: 0.3s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(50, 150, 250, 0.2); background: var(--white);
}
[data-theme="dark"] input:focus, [data-theme="dark"] textarea:focus { background: rgba(0,0,0,0.5); }

/* Field-Level Security Lock */
.input-locked { background: rgba(239, 68, 68, 0.05) !important; border-color: rgba(239, 68, 68, 0.2) !important; color: var(--danger) !important; cursor: not-allowed; }

button, .btn, .action-btn {
    font-family: inherit; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px;
    cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; transition: 0.3s;
}
button[type="submit"], .btn-add, .btn-primary { background: var(--primary); color: var(--white); }
button[type="submit"]:hover, .btn-add:hover, .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(50,150,250,0.3);}

.action-btn { padding: 6px 12px; margin-right: 4px; color: var(--white); text-decoration: none;}
.btn-edit { background: var(--warning); color: #000 !important; }
.btn-delete { background: var(--danger); }

/* Switch Toggle (Nút Gạt) */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }
input:disabled + .slider { cursor: not-allowed; opacity: 0.5; }

/* ================== GRID HỒ SƠ CHI TIẾT ================== */
.profile-container {
    display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start;
}

.btn-sidebar-action {
    width: 100%; margin-top: 8px; background-color: var(--input-bg); color: var(--text-main);
    border: 1px solid var(--glass-border); padding: 12px 16px; border-radius: 8px;
    cursor: pointer; font-weight: 600; transition: 0.3s; text-align: left;
    display: flex; align-items: center; justify-content: space-between; font-size: 14px;
}
.btn-sidebar-action:hover { background-color: rgba(50,150,250,0.1); border-color: var(--primary); color: var(--primary); transform: translateX(5px);}

/* ================== MODAL MỚI (MỊN VÀ CHUYÊN NGHIỆP) ================== */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}

.modal-box {
    width: 100%; max-width: 500px;
    background: var(--glass-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2); overflow: hidden;
    transform: translateY(20px) scale(0.98); opacity: 0; transition: all 0.3s ease;
}

/* Kích hoạt Modal */
.modal-backdrop.show { opacity: 1; visibility: visible; }
.modal-backdrop.show .modal-box { transform: translateY(0) scale(1); opacity: 1; }

.modal-header {
    padding: 15px 20px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(50, 150, 250, 0.05);
}
.modal-header h3 { margin: 0; font-size: 18px; color: var(--primary); display: flex; align-items: center; gap: 8px; font-weight: 700; }

.close-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: transparent; color: var(--text-muted);
    font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.close-btn:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); transform: rotate(90deg); }

.modal-body { padding: 20px 20px 10px 20px; }

.modal-footer {
    padding: 15px 20px; border-top: 1px solid var(--glass-border);
    display: flex; justify-content: flex-end; gap: 10px; background: rgba(0,0,0,0.02);
}
[data-theme="dark"] .modal-footer { background: rgba(255,255,255,0.02); }

.btn-cancel {
    padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 14px;
    background: transparent; border: 1px solid var(--glass-border); color: var(--text-main);
    cursor: pointer; transition: 0.3s;
}
.btn-cancel:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .btn-cancel:hover { background: rgba(255,255,255,0.05); }

.btn-submit {
    padding: 10px 22px; border-radius: 6px; font-weight: 600; font-size: 14px;
    background: linear-gradient(135deg, #10b981, #059669); color: white;
    border: none; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5); }

/* ================== TIỆN ÍCH CHI TIẾT ================== */
.stat-box { background: rgba(50, 150, 250, 0.05); border: 1px solid rgba(50, 150, 250, 0.1); padding: 15px; border-radius: var(--radius-md); text-align: left; }
.stat-box h3 { color: var(--primary); margin: 0 0 5px 0; font-size: 24px; font-weight: bold;}
.stat-box p { color: var(--text-muted); font-size: 12px; margin: 0; text-transform: uppercase; font-weight: 800;}

.timeline { border-left: 2px solid var(--glass-border); margin-left: 10px; padding-left: 20px; margin-top: 10px;}
.timeline-item { margin-bottom: 16px; position: relative; }
.timeline-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; position: absolute; left: -26px; top: 5px; border: 2px solid var(--bg-deep); }
.timeline-item small { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase;}
.timeline-item p { margin: 4px 0 0 0; font-size: 14px; }

/* ================== CUSTOM CHECKBOX ================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.custom-cb-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: 0.2s;
}
.custom-cb-label:hover {
    border-color: var(--primary);
    background: rgba(50, 150, 250, 0.05);
}
.custom-cb-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}
.form-section-title {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--glass-border);
}

/* ================== MODULE TÀI CHÍNH & GIÁ VỐN ================== */
.floating-save-btn { position: fixed; bottom: 30px; right: 30px; z-index: 999; }
.floating-save-btn button { font-size: 15px; padding: 14px 28px; border-radius: 50px; background: var(--warning); color: #000; box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4); transition: 0.3s; }
.floating-save-btn button:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(245, 158, 11, 0.6); }

.branch-header { background: var(--table-header); padding: 14px 18px; }
.branch-header strong { font-size: 16px; color: var(--primary); text-transform: uppercase; }

.rate-active-cell { background: rgba(16, 185, 129, 0.02); }

.rate-input {
    margin: 0; padding: 10px; font-weight: bold; color: var(--warning);
    font-size: 16px; border: 1px solid var(--warning); transition: 0.3s;
    background: var(--bg-deep); width: 100%; box-sizing: border-box; border-radius: var(--radius-sm);
}
.rate-input:disabled { background: rgba(0,0,0,0.05); cursor: not-allowed; border-color: var(--glass-border); }

.note-input {
    margin: 0; padding: 10px; font-size: 14px; width: 100%;
    box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); color: var(--text-main);
}
.note-input:disabled { background: rgba(0,0,0,0.05); cursor: not-allowed; }

/* ================== CUSTOM UI: WALLET & TOAST ================== */
.currency-selector { display: flex; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; }
.currency-selector input[type="radio"] { display: none; }
.currency-selector label { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-weight: bold; color: var(--text-muted); transition: 0.3s; margin: 0; font-size: 14px;}
.currency-selector input[type="radio"]:checked + label.vnd-label { background: var(--primary); color: white; }
.currency-selector input[type="radio"]:checked + label.rmb-label { background: var(--danger); color: white; }

.system-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--glass-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    padding: 14px 26px; border-radius: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px; z-index: 10000; opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); border: 1px solid var(--glass-border); font-weight: 600; font-size: 14px;
}
.system-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.system-toast.success { border-bottom: 3px solid var(--success); color: var(--success); }
.system-toast.error { border-bottom: 3px solid var(--danger); color: var(--danger); }

/* ================== AUTOCOMPLETE SUGGESTION BOX ================== */
.search-wrapper { position: relative; flex: 1; min-width: 250px; }
.autocomplete-box {
    position: absolute; top: calc(100% + 5px); left: 0; width: 100%;
    background: var(--glass-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(50, 150, 250, 0.2);
    max-height: 250px; overflow-y: auto; z-index: 10000;
    display: none; flex-direction: column;
}
.autocomplete-box.show { display: flex; animation: fadeIn 0.2s ease; }
.autocomplete-item {
    padding: 10px 14px; cursor: pointer; border-bottom: 1px dashed var(--glass-border);
    display: flex; flex-direction: column; transition: 0.2s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: rgba(50, 150, 250, 0.1); padding-left: 18px; border-left: 3px solid var(--primary); }
.ac-user { font-weight: bold; color: var(--primary); font-size: 14px; }
.ac-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Sort Icon Hover */
.sort-icon { display: inline-block; margin-left: 5px; color: var(--glass-border); transition: 0.3s; font-size: 12px; }
th:hover .sort-icon { color: var(--primary); }
.sort-icon.active { color: var(--primary); font-weight: bold; }

/* ================== FINANCIAL MODULE STYLES (LEDGER & WALLETS) ================== */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.page-title { color: var(--text-main); margin: 0; font-size: 24px; font-weight: 800; }
.page-desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.filter-group { display: flex; gap: 12px; align-items: center; background: var(--glass-bg); padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.filter-btn-group { display: flex; gap: 6px; }

.tx-row { border-bottom: 1px dashed var(--glass-border); }
.tx-cell { padding: 12px 18px; vertical-align: middle; }
.tx-time { color: var(--text-main); font-size: 14px; font-weight: bold; }
.tx-date { font-size: 12px; color: var(--text-muted); }
.tx-code { font-family: monospace; font-size: 15px; font-weight: bold; color: var(--primary); text-decoration: none; transition: 0.2s; }
.tx-code:hover { text-decoration: underline; color: var(--primary-dark); }
.tx-actor { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: inline-block; }

.badge-type { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-family: monospace; font-weight: bold; }
.badge-add { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-sub { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-neutral { background: rgba(0, 0, 0, 0.05); color: var(--text-muted); border: 1px solid rgba(0, 0, 0, 0.1); }

.amt-cell { background: rgba(50, 150, 250, 0.02); text-align: right; }
.amt-pos { color: var(--success); font-size: 16px; font-weight: bold; }
.amt-neg { color: var(--danger); font-size: 16px; font-weight: bold; }
.amt-curr { font-size: 12px; color: var(--text-muted); margin-left: 2px; font-weight: bold; }
.bal-text { color: var(--text-main); font-size: 15px; font-weight: bold; }

.receipt-card { max-width: 500px; margin: 0 auto; background: var(--glass-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.receipt-header { background: var(--bg-deep); padding: 16px; text-align: center; border-bottom: 2px dashed var(--glass-border); }
.receipt-body { padding: 16px; }
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.03); font-size: 14px; }
.receipt-row:last-child { border-bottom: none; }
.receipt-label { color: var(--text-muted); font-weight: 500; }
.receipt-value { color: var(--text-main); font-weight: bold; text-align: right; max-width: 60%; }
.receipt-barcode { text-align: center; padding: 15px; background: rgba(0,0,0,0.02); margin-top: 10px; border-radius: 8px; font-family: 'Libre Barcode 39', monospace; font-size: 32px; color: var(--text-main); letter-spacing: 2px;}

.pagination-wrapper { padding: 14px 18px; background: rgba(0,0,0,0.02); display: flex; justify-content: flex-end; align-items: center; gap: 15px; border-top: 1px solid var(--glass-border); }

/* ================== MENU BADGE (CHẤM ĐỎ THÔNG BÁO) ================== */
.menu-badge {
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 20px;
    margin-left: auto;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

/* ==========================================
   MODULE FINANCE: REQUESTS & AUDIT LOGS UI
   ========================================== */

.req-tabs-wrapper { position: sticky; top: 60px; z-index: 100; background: var(--bg-deep); padding-top: 12px; margin-bottom: 15px; margin-top: -10px; }

.req-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 5px; border-bottom: 2px solid var(--glass-border); }
.req-tabs::-webkit-scrollbar { height: 4px; }
.req-tabs::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.req-tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.req-tab-item:hover { color: var(--primary); background: rgba(50, 150, 250, 0.05); }
.req-tab-item.active { color: var(--primary); background: rgba(50, 150, 250, 0.1); }
.req-tab-item.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--primary); border-radius: 2px; }

.req-tab-badge {
    background: var(--glass-border);
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transform: translateY(-6px);
    margin-left: 4px;
}

.req-tab-item.active .req-tab-badge {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(50,150,250,0.3);
}

/* ==========================================
   BỘ LỌC ĐA LUỒNG (TỐI ƯU AUTO-GRID CHO LAPTOP)
   ========================================== */
.filter-layout {
    display: flex; gap: 12px; align-items: flex-end; width: 100%; flex-wrap: wrap;
}
.filter-inputs-flex {
    flex: 1 1 min(100%, 750px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px; align-items: flex-end;
}
@media (min-width: 1024px) {
    .filter-item.search-wrapper { grid-column: span 2; }
}
.filter-item { width: 100%; position: relative; }

.filter-actions-col {
    display: flex; flex-direction: row; gap: 8px; flex: 1 1 auto;
    justify-content: flex-end; margin-top: 4px;
}

.filter-toggle {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--primary);
    font-weight: 600; font-size: 13px; margin-bottom: 12px; user-select: none;
    padding: 4px 8px; border-radius: 4px; transition: 0.2s;
}
.filter-toggle:hover { background: rgba(50, 150, 250, 0.05); }
#filterContainer { transition: all 0.3s ease; }
.hidden { display: none !important; }

.fl-input {
    width: 100%; height: 36px; border-radius: 6px; border: 1px solid var(--input-border);
    background: var(--input-bg); color: var(--text-main); padding: 0 12px; box-sizing: border-box;
    font-family: inherit; font-size: 13px; outline: none; transition: border 0.3s;
}
.fl-input:focus { border-color: var(--primary); }

.btn-mini {
    height: 36px; padding: 0 18px; font-size: 12px; font-weight: bold; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    margin: 0; box-sizing: border-box; cursor: pointer; border: none; white-space: nowrap; transition: 0.2s;
}
.btn-mini:hover { opacity: 0.8; transform: translateY(-1px); }

/* WORKSPACE CHI TIẾT & TIMELINE LƯU VẾT */
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.info-panel { background: var(--glass-bg); padding: 18px; border-radius: 10px; border: 1px solid var(--glass-border); box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.info-block { margin-bottom: 16px; }
.info-block h3 { color: var(--text-main); margin-top: 0; font-size: 15px; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; border-bottom: 1px dashed var(--glass-border); padding-bottom: 6px; margin-bottom: 10px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.02); }
.info-label { color: var(--text-muted); font-size: 13px; }
.info-value { color: var(--text-main); font-size: 14px; font-weight: 600; text-align: right; max-width: 60%; }

.timeline-panel { background: var(--glass-bg); border-radius: 10px; border: 1px solid var(--glass-border); box-shadow: 0 4px 15px rgba(0,0,0,0.02); display: flex; flex-direction: column; height: 600px; }
.timeline-header { padding: 14px 18px; border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,0.02); border-radius: 10px 10px 0 0; font-weight: bold; font-size: 14px; display: flex; justify-content: space-between; align-items: center;}
.timeline-body { flex: 1; padding: 16px 16px 16px 8px; overflow-y: auto; }

.audit-container { position: relative; padding-left: 24px; }
.audit-container::before { content: ''; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: var(--glass-border); z-index: 1; }
.audit-item { position: relative; margin-bottom: 16px; }
.audit-item:last-child { margin-bottom: 0; }
.audit-icon { position: absolute; left: -21px; top: 10px; width: 10px; height: 10px; border-radius: 50%; z-index: 2; box-shadow: 0 0 0 4px var(--glass-bg); }
.audit-icon.status { background: var(--primary); }
.audit-icon.comment { background: var(--warning); }
.audit-icon.init { background: var(--success); }

.audit-content { background: rgba(0,0,0,0.02); padding: 12px 14px; border-radius: 6px; border: 1px solid var(--glass-border); }
.audit-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--glass-border); padding-bottom: 4px; }
.audit-meta .actor { font-weight: bold; color: var(--primary); font-size: 13px; }
.audit-meta .time { font-family: monospace; font-size: 12px; }

.audit-status-change { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.audit-badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; border: 1px solid rgba(0,0,0,0.1); }
.audit-comment { font-style: italic; color: var(--text-main); border-left: 3px solid var(--warning); padding-left: 10px; background: rgba(245, 158, 11, 0.05); padding: 8px 10px; border-radius: 0 4px 4px 0; font-size: 14px; line-height: 1.5; margin-top: 6px; }

.timeline-footer { padding: 14px; border-top: 1px solid var(--glass-border); background: var(--bg-deep); border-radius: 0 0 10px 10px; display: flex; gap: 10px; align-items: center; }

/* 4. CUSTOM CONFIRM MODAL */
.custom-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.custom-modal.show { display: flex; }
.c-modal-box { background: var(--bg-deep); width: 100%; max-width: 360px; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center; }
.c-modal-body { padding: 25px; }
.c-modal-title { font-size: 18px; color: var(--text-main); margin: 0 0 8px 0; font-weight: bold; }
.c-modal-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.c-modal-actions { display: flex; gap: 8px; }
.btn-c-cancel { flex: 1; padding: 10px; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-main); border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; }
.btn-c-confirm { flex: 1; padding: 10px; background: var(--primary); border: none; color: #fff; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; }

/* ==========================================
   MODULE FINANCE: SLA WARNING & TOOLTIPS
   ========================================== */
.sla-wrapper { position: relative; display: inline-block; margin-top: 4px; cursor: help; }
.sla-tag { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; display: inline-flex; align-items: center; gap: 4px; }
.sla-tooltip { visibility: hidden; opacity: 0; position: absolute; bottom: 100%; left: 0; transform: translateY(8px); width: 240px; background: var(--bg-deep); border: 1px solid var(--danger); border-radius: 6px; padding: 12px; box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15); z-index: 999; transition: all 0.2s ease; text-align: left; }
.sla-wrapper:hover .sla-tooltip { visibility: visible; opacity: 1; transform: translateY(-6px); }
.sla-tooltip::after { content: ''; position: absolute; top: 100%; left: 16px; border-width: 6px; border-style: solid; border-color: var(--danger) transparent transparent transparent; }
.sla-title { font-size: 13px; font-weight: bold; color: var(--danger); border-bottom: 1px dashed var(--glass-border); padding-bottom: 4px; margin-bottom: 8px; text-transform: uppercase; }
.sla-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--text-main); }
.sla-row span.late { color: var(--danger); font-weight: bold; }
.sla-row span.ok { color: var(--success); }
.sla-total {
    border-top: 1px solid var(--glass-border);
    margin-top: 6px;
    padding-top: 6px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}
.sla-total span.late { color: var(--danger); font-weight: bold; }
.sla-total span.ok { color: var(--success); }

/* BỔ SUNG CSS MỚI: LOYALTY GRID & RESPONSIVE */
.loyalty-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Bọc bảng để không vỡ layout trên mobile */
.table-responsive { width: 100%; overflow-x: auto; }

/* ================== MEDIA QUERY CHO MOBILE & TABLET ================== */
@media (max-width: 992px) {
    .profile-container, .loyalty-grid, .workspace-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .main-content { padding: 12px 10px; }
    .glass-card, .glass-panel {
        padding: 14px;
        margin-bottom: 10px;
    }

    .filter-layout { flex-direction: column; align-items: stretch; gap: 10px; }
    .filter-actions-col { justify-content: stretch; flex-direction: column; gap: 8px; }
    .filter-actions-col .btn-primary { width: 100%; }

    .stat-box h3 { font-size: 18px; }
}

/* ================== FLEXBOX & LAYOUT UTILITIES ================== */
.flex { display: flex; }
.flex-column { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.align-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-100 { width: 100%; }
.m-0 { margin: 0; }

/* ================== BỘ UTILITIES CHUẨN BOOTSTRAP ================== */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 48px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 48px !important; }
.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }

/* HIỆU ỨNG GLOW EFFECT (LIQUID Glass 2.0) */
.glow-effect {
    box-shadow: 0 4px 15px rgba(50, 150, 250, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glow-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(50, 150, 250, 0.7), 0 0 10px rgba(50, 150, 250, 0.5) inset;
    filter: brightness(1.1);
}

/* ================== GRID THÔNG MINH TỰ CO GIÃN ================== */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.w-4 {
    width: 20px;
    text-align: center;
    display: inline-block;
    color: var(--primary);
}

/* ================== BỐ CỤC CHI TIẾT ĐƠN HÀNG (FIXED SPLIT-SCREEN) ================== */
.order-detail-layout {
    display: block;
    margin-top: 15px;
}

.detail-main-col {
    margin-right: 350px; /* Thụt nội dung sang trái 350px để chừa chỗ cho Khung Chat */
}

/* CỘT CHAT BÊN PHẢI (20%) - GHIM CỐ ĐỊNH TẠI CHỖ */
.detail-sidebar-col {
    position: fixed;
    top: 85px; /* Cách đỉnh 85px để né thanh Top Navbar */
    right: 25px; /* Bám sát mép phải màn hình */
    width: 320px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99;
}

/* --- COMPONENT CHAT BOX CHUẨN --- */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0 !important;
    overflow: hidden;
}

.chat-header {
    padding: 10px 14px;
    background: var(--table-header);
    border-bottom: 1px solid var(--glass-border);
    font-weight: bold;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-content::-webkit-scrollbar { width: 4px; }
.chat-content::-webkit-scrollbar-track { background: transparent; }
.chat-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }

.chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.chat-empty i { font-size: 28px; margin-bottom: 10px; opacity: 0.3; }

.chat-input-area {
    padding: 10px 12px;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid var(--table-border);
    border-radius: 50px;
    padding: 8px 14px;
    background: var(--bg-deep);
    outline: none;
    font-size: 14px;
}

.chat-input-area button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: 0.2s;
}

@media (max-width: 1200px) {
    .detail-main-col { margin-right: 0; width: 100%; }
    .detail-sidebar-col {
        position: static;
        width: 100%;
        height: 600px;
        margin-top: 15px;
    }
}

/* ================== LIST THÔNG TIN DẠNG CHẤM MỜ (LEDGER LIST) ================== */
.ledger-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ledger-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 13px;
}
.ledger-list-item .label {
    color: var(--text-muted);
    background: var(--input-bg);
    padding-right: 6px;
    z-index: 2;
}
.ledger-list-item .value {
    font-weight: 600;
    color: var(--text-main);
    background: var(--input-bg);
    padding-left: 6px;
    z-index: 2;
    text-align: right;
}
.ledger-list-item::after {
    content: '';
    flex: 1;
    border-bottom: 1px dotted var(--glass-border);
    margin: 0 5px;
    position: relative;
    top: -4px;
    z-index: 1;
}

/* ================== HEADER ĐƠN HÀNG LÀM MỚI (ORDER DETAIL HEADER) ================== */
.order-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--glass-bg);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-bottom: 12px;
    gap: 16px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1.2;
    min-width: 220px;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    background: var(--input-bg);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.order-meta {
    display: flex;
    flex-direction: column;
}

.order-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.order-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.order-title h2:hover {
    color: var(--danger);
}

.order-title h2 .copy-icon {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 8px;
    opacity: 0;
    transition: 0.2s;
}

.order-title h2:hover .copy-icon {
    opacity: 1;
}

.order-id {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.order-time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-financials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 2;
    padding: 0 16px;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

.finance-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.finance-box.text-right { text-align: right; }
.finance-box.text-left { text-align: left; }

.finance-box label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.finance-value {
    font-size: 20px;
    font-weight: 800;
}

.finance-value.main-total { color: var(--text-main); }
.finance-value.system-fee { color: var(--danger); }

.finance-value .currency {
    font-size: 14px;
    vertical-align: top;
    margin-left: 2px;
}

.finance-value .sub-currency {
    font-size: 15px;
    color: var(--primary);
    font-weight: 700;
    margin-left: 6px;
}

.header-status {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 120px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .order-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .header-financials {
        width: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px dashed var(--glass-border);
        border-bottom: 1px dashed var(--glass-border);
        padding: 12px 0;
        justify-content: space-between;
        gap: 12px;
    }

    .finance-box.text-right,
    .finance-box.text-left {
        text-align: left;
    }

    .header-status {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ================== CUSTOMER INFO CARDS (MINIMALIST UI) ================== */
.card-header-styled {
    border-bottom: 1px dashed var(--glass-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.card-header-styled h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: stretch;
}

.c-info-box {
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.c-info-box.box-primary { border: 1px solid #93c5fd; }
.c-info-box.box-default { border: 1px solid #e5e7eb; }
.c-info-box.box-danger  { border: 1px solid #fecdd3; background-color: #fff1f2; }
.c-info-box.box-warning { border: 1px solid #fde68a; background-color: #fefce8; }

.c-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.c-info-item label {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.c-info-item .text-xl {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.branch-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.branch-tag {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .customer-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .customer-info-grid {
        grid-template-columns: 1fr;
    }
}

/* --- COMPONENT TAB (LIQUID GLASS STYLE) --- */
.liquid-tabs {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.tabs-header {
    position: relative;
    display: flex;
    border-bottom: 1px solid var(--table-border);
    background: rgba(255,255,255,0.5);
    overflow-x: auto;
}
.tabs-header::-webkit-scrollbar { height: 0px; }

.tab-btn {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    border: none;
    background: transparent;
    outline: none;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); font-weight: 700; }

.tab-ink-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--primary);
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 0;
}

.tab-content { padding: 20px; }
.tab-pane { display: none; animation: slideUp 0.3s ease; }
.tab-pane.active { display: block; }

/* --- THANH ACTION BAR GHIM ĐÁY (FIXED BOTTOM) --- */
.fixed-action-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-w); /* Mặc định: Bám sát menu lúc mở to (260px) */
    right: 350px; /* Thụt 350px để né Khung Chat bên phải */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    border-radius: 16px 16px 0 0;
    padding: 12px 24px; 
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
    /* Ma thuật ở đây: Hiệu ứng trượt mượt mà bám theo độ thò thụt của Sidebar */
    transition: left 0.3s ease, right 0.3s ease; 
}

/* KHI MENU TRÁI BỊ THU GỌN (THỤT VÀO) */
html.sidebar-collapsed .fixed-action-bar {
    left: var(--sidebar-mini-w); /* Tự động bám sát mép menu nhỏ (80px) */
}

/* Định dạng cho các nút bấm bên trong form */
.fixed-action-bar form {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Ép các nút bấm dàn hàng sát lề trái */
    gap: 12px;
    margin: 0;
    flex-wrap: wrap;
    width: 100%;
}

/* Kích hoạt lại khoảng an toàn cho nội dung khi cuộn xuống đáy */
.padding-bottom-safe {
    padding-bottom: 80px; 
}

/* ================= RESPONSIVE TRÊN MÀN HÌNH NHỎ ================= */
@media (max-width: 1200px) {
    .fixed-action-bar { 
        right: 0; /* Khung chat tụt xuống đáy, Action Bar được bung full lề phải */
    } 
}

@media (max-width: 768px) {
    /* Trên điện thoại, menu trái thường ẩn hẳn đi nên action bar bám sát lề trái màn hình */
    .fixed-action-bar,
    html.sidebar-collapsed .fixed-action-bar { 
        left: 0; 
    } 
}
/* ================= HEADER BÁM TRÁI NÉ KHUNG CHAT ================= */
.detail-header-safe {
    margin-right: 350px; /* Thụt lề phải 350px để thẳng hàng với cột nội dung và né Khung Chat */
}

/* Đảm bảo Responsive trên màn hình nhỏ (khi khung chat bị rớt xuống dưới) */
@media (max-width: 1200px) {
    .detail-header-safe {
        margin-right: 0;
    }
}


/* ================== COMPONENT: TAB DATA & VAS ================== */

/* 1. DỊCH VỤ VAS (PILL BUTTONS) DỒN PHẢI */
.top-services-wrapper {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--glass-border);
}

.top-services-form {
    display: flex;
    justify-content: flex-end; /* Ép toàn bộ khối VAS sang phải */
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.top-services-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
}
.top-services-name {
    margin-right: auto; /* CHÍNH LÀ DÒNG NÀY: Đẩy phần còn lại sang phải */
    
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    /* justify-content không có tác dụng ở đây nên hãy xóa đi */
}



.top-services-list {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.vas-checkbox-hidden { display: none; }
.service-pill-btn { cursor: pointer; margin: 0; display: inline-block; }

.service-pill-text {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: var(--white); border: 1px solid var(--glass-border);
    border-radius: 50px; transition: all 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    user-select: none;
}

.service-pill-text:hover {
    border-color: rgba(50, 150, 250, 0.4); color: var(--primary); transform: translateY(-1px);
}

.vas-checkbox-hidden:checked + .service-pill-text {
    background: rgba(50, 150, 250, 0.1); border-color: var(--primary);
    color: var(--primary); box-shadow: 0 2px 8px rgba(50, 150, 250, 0.15);
}

.vas-checkbox-hidden:checked + .service-pill-text::before {
    content: '\f00c'; font-family: 'FontAwesome'; font-size: 11px; font-weight: 900;
}

/* 2. BỐ CỤC LƯỚI & TIÊU ĐỀ */
.grid-2-cols { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; gap: 25px; }
.section-title { font-weight: 700; font-size: 14px; color: var(--text-main); display: block; margin-bottom: 12px; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; }
.empty-state { text-align: center; font-size: 12px; color: var(--text-muted); font-style: italic; background: var(--input-bg); padding: 15px; border-radius: 8px; }

/* 3. CỘT TEXT (TRÁI) - FIX TỶ LỆ 40/60 & BỐ CỤC */
.data-text-list { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

/* Áp dụng Grid để phân chia tỷ lệ chính xác (Ví dụ 45% - 55%) */
.data-text-row { 
    display: grid;
    grid-template-columns: 40% 1fr; /* Nhãn chiếm 40%, Khung copy chiếm phần còn lại */
    align-items: stretch; /* Đảm bảo 2 bên cao bằng nhau */
    gap: 15px;
    padding: 8px 12px; 
    border-radius: 6px; 
    background: transparent; 
    transition: all 0.2s ease; 
}
.data-text-row:hover { 
    background: rgba(0,0,0,0.02); 
}

.data-text-label { 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--text-muted); 
    display: flex;
    align-items: center; /* Căn giữa chữ theo chiều dọc */
    white-space: normal; /* Cho phép rớt dòng gọn gàng nếu cần */
    line-height: 1.4;
}

.data-text-group { 
    display: flex; 
    align-items: stretch; /* Để nút copy và text cao bằng nhau */
    width: 100%; 
    background: var(--input-bg); 
    border: 1px solid var(--glass-border); 
    border-radius: 6px; 
    transition: 0.2s;
    overflow: hidden; /* Cắt phần bo góc thừa */
    cursor: pointer;
}
.data-text-group:hover { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 2px rgba(50,150,250,0.1); 
}

.data-text-value { 
    flex: 1; 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text-main); 
    padding: 8px 12px; 
    background: transparent; 
    border: none; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.btn-copy-icon { 
    width: 50px; /* Độ rộng vừa phải cho nút Copy */
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: var(--primary);
    border: none; 
    border-left: 1px solid var(--glass-border); 
    color: var(--white); 
    border-radius: 0; 
    cursor: pointer; 
    transition: 0.2s; 
    font-size: 11px;
    font-weight: 600;
}
.btn-copy-icon:hover { 
    filter: brightness(0.9);
}

/* ========================================================================= */
/* BỔ SUNG FIX HOVER TRONG DARK MODE CHO CỘT TEXT                            */
/* ========================================================================= */
html[data-theme="dark"] .data-text-row:hover {
    background: rgba(255, 255, 255, 0.05); /* Hiệu ứng hover nổi bật trên nền đen */
}

/* Giữ nút Copy luôn giữ form chuẩn trên Dark Mode */
html[data-theme="dark"] .btn-copy-icon {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* Đảm bảo Icon Copy không bao giờ bị CSS khác ẩn đi */
.btn-copy-icon .copy-icon, .data-img-btn .copy-icon { opacity: 1 !important; visibility: visible !important; }

/* 4. CỘT ẢNH (PHẢI) */
.data-img-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; }
.data-img-card { background: #fff; border: 1px solid var(--glass-border); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.02); display: flex; flex-direction: column; transition: 0.3s; }
.data-img-card:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(50, 150, 250, 0.1); border-color: var(--primary); }
.data-img-header { padding: 10px 15px; font-size: 13px; font-weight: 700; color: var(--text-main); background: var(--bg-deep); border-bottom: 1px solid var(--glass-border); text-align: center;}
.data-img-view { display: block; background: #fafafa; padding: 0; }
.data-img-view img { width: 100%; height: auto; max-height: 800px; display: block; object-fit: contain; margin: 0 auto; }

.data-img-actions { display: flex; border-top: 1px solid var(--glass-border); background: var(--bg-deep); flex-shrink: 0; }
.data-img-btn { flex: 1; padding: 12px 0; background: transparent; border: none; font-size: 12px; font-weight: 600; color: var(--text-main); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.data-img-btn:first-child { border-right: 1px solid var(--glass-border); }
.data-img-btn:hover { background: rgba(0,0,0,0.03); color: var(--primary); }
.data-img-btn.text-primary { color: var(--primary); }

/* Responsive */
@media (max-width: 992px) {
    .grid-2-cols { grid-template-columns: 1fr; }
    .top-services-form, .top-services-list { justify-content: flex-start; }
}