*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}
/* --- CÁC KIỂU CHUNG & NAVBAR --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.navbar {
    background-color: #343a40;
    padding: 10px 20px;
    color: #fff;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar .brand {
    font-size: 1.5em;
    font-weight: 700;
}

.navbar .nav-actions { 
    display: flex;
    align-items: center;
}

.navbar .nav-actions a {
    color: #fff;
    text-decoration: none;
    padding: 7px 12px;
    margin-left: 10px;
    border-radius: 4px;
    transition: background-color .3s ease;
    display: inline-flex;
    align-items: center;
    font-size: 0.9em;
    border: 1px solid transparent;
}

.navbar .nav-actions a .fas { 
    margin-right: 5px;
}

.navbar .nav-actions a.btn-settings { background-color: #6c757d; border-color: #6c757d;}
.navbar .nav-actions a.btn-settings:hover { background-color: #5a6268; border-color: #545b62;}
.navbar .nav-actions a.btn-logout { background-color: #dc3545; border-color: #dc3545;} 
.navbar .nav-actions a.btn-logout:hover { background-color: #c82333; border-color: #bd2130;}
.navbar .nav-actions a.btn-home { background-color: #007bff; border-color: #007bff;}
.navbar .nav-actions a.btn-home:hover { background-color: #0056b3; border-color: #0056b3;}

.message {
    padding: 12px 18px;
    margin: 0 auto 20px auto;
    border-radius: 5px;
    font-weight: 500;
    font-size: .95em;
    max-width: 700px;
}

.message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.visually-hidden { display: none!important; }


/* --- KIỂU DÀNH RIÊNG CHO TRANG INDEX.PHP --- */
.client-container {
    max-width: 700px;
    margin: 30px auto;
    padding: 0 15px;
}

.client-panel, .client-account-panel {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    margin-bottom: 20px;
}

.client-panel-header {
    padding: 15px 20px;
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.client-panel-header .panel-title-group { 
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-right: 10px;
}

.client-panel-header .panel-title-group .fas, 
.client-panel-header .panel-title-group .fab { 
    margin-right: 10px;
    color: #007bff;
}

.header-account-stats, .header-link-stats {
    font-size: 0.70em;
    color: #6c757d;
    font-weight: normal;
    text-align: right;
    white-space: nowrap;
}

.header-account-stats strong, .header-link-stats strong { margin-left: 2px; margin-right: 5px;} 
.header-account-stats strong:last-child, .header-link-stats strong:last-child { margin-right: 0; }
.header-account-stats .remaining { color: #28a745; } 
.header-account-stats .used { color: #ffc107; } 
.header-account-stats .total-used { color: #dc3545; } 
.header-link-stats .link-count-today { color: #17a2b8; }

.client-panel-body { padding: 20px; }
.client-panel-body textarea.form-control { width: 100%; min-height: 90px; padding: 10px; border: 1px solid #ced4da; border-radius: 5px; font-family: monospace; box-sizing: border-box; margin-bottom: 10px; }
.client-no-account-message { text-align: center; padding: 30px 0; color: #6c757d; font-size: 1.1em; }
.client-btn-block { display: block; width: 100%; padding: 12px 15px; font-size: 1.05em; border-radius: 6px; text-align: center; text-decoration: none; border: none; cursor: pointer; transition: background-color .2s ease,box-shadow .2s ease; margin-bottom: 10px; box-sizing: border-box; }
.client-btn-block .fab, .client-btn-block .fas { margin-right: 8px; }
.client-btn-custom-primary { background-color: #50a5e6; color: #fff; box-shadow: 0 2px 4px rgba(80,165,230,.3); }
.client-btn-custom-primary:hover { background-color: #3a95d8; box-shadow: 0 4px 8px rgba(80,165,230,.4); }
.client-btn-custom-secondary { background-color: #28a745; color: #fff; }
.client-btn-custom-secondary:hover { background-color: #13772a; }
.client-btn-custom-info { background-color: #17a2b8; color: #fff; }
.client-btn-custom-info:hover { background-color: #138496; }

.client-field-row, .info-field-row { margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; }
.client-field-row label, .info-field-row label { width: 110px; min-width: 110px; margin-right: 10px; font-weight: 500; color: #495057; font-size: .95em; }
.client-input-group, .info-input-group { display: flex; align-items: center; border: 1px solid #ced4da; border-radius: 5px; background-color: #f1f3f5; overflow: hidden; width: 100%; flex-grow: 1; }
.client-field-row .client-input-group input[type=text], .info-field-row .info-input-group input[type=text] { flex-grow: 1; padding: 10px 12px; border: none; background-color: transparent; font-size: .95em; color: #343a40; outline: 0; min-width: 0; min-width: 0; text-overflow: ellipsis;}
.client-btn-icon-copy, .info-btn-icon-copy { flex-shrink: 0; background-color: #fff; border: none; border-left: 1px solid #ced4da; padding: 10px 12px; cursor: pointer; color: #495057; display: flex; align-items: center; justify-content: center; transition: background-color .2s ease; }
.client-btn-icon-copy:hover, .info-btn-icon-copy:hover { background-color: #e9ecef; }

#tiktok-code-result-wrapper { display: flex; align-items: center; } 
#tiktok-code-result { width: calc(100% - 50px); padding: 10px; border: 1px solid #ccc; border-radius: 4px 0 0 4px; margin-right: 0px; background-color: #e9ecef; border-right: none; }
#copy-tiktok-code-btn { padding: 10px; background-color: #28a745; color: #fff; border: 1px solid #28a745; border-left: none; border-radius: 0 4px 4px 0; cursor: pointer; height: calc(20px + 1em + 2px); } 
#loading-indicator { text-align: center; margin: 15px 0; color: #007bff; }


/* --- KIỂU DÀNH RIÊNG CHO TRANG SETTINGS.PHP --- */
.admin-settings-wrapper { max-width: 1000px; margin: 0 auto; padding: 0 15px; }
.settings-panel { background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); margin-bottom: 30px; }
.settings-panel.initially-hidden, .settings-panel.hide-by-js { display: none; }
.settings-panel-header { background-color: #f7faff; color: #0056b3; padding: 15px 20px; font-size: 1.1em; font-weight: 600; border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom: 1px solid #dee2e6; display: flex; align-items: center; }
.settings-panel-header .fas, .settings-panel-header .fab { margin-right: 10px; font-size: 1.2em; color: #007bff; }
.settings-panel-body { padding: 25px; }
.settings-panel-body p.description { font-size: .9em; color: #666; margin-top: 0; margin-bottom: 15px; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 15px; }
.action-button { background-color: #fff; border: 1px solid #e0e0e0; border-radius: 6px; padding: 20px; text-align: center; cursor: pointer; transition: all .2s ease-in-out; color: #0056b3; font-weight: 500; text-decoration: none; }
.action-button:hover { border-color: #007bff; box-shadow: 0 4px 12px rgba(0,123,255,.1); transform: translateY(-2px); }
.action-button .fas, .action-button .fab { font-size: 1.8em; margin-bottom: 10px; display: block; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.95em; }
.form-group .label-inline { display: inline-block; margin-right: 15px; margin-bottom: 0; font-weight: 400; cursor: pointer; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 5px; font-size: .95em; box-sizing: border-box; transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;}
.form-control:focus { border-color: #80bdff; outline: 0; box-shadow: 0 0 0 .2rem rgba(0,123,255,.25); }

/* --- Cải thiện giao diện cho dropdown chọn nhân viên --- */
select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #f8f9fa; /* Màu nền xám nhạt */
    color: #495057;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}
select.form-control option {
    background: #fff;
    color: #212529;
}
/* --- Kết thúc phần cải thiện --- */

.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-left: 35px; }
.input-with-icon .fas, .input-with-icon .far { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #aaa; }
.input-with-icon .fa-eye, .input-with-icon .fa-eye-slash { left: auto; right: 12px; cursor: pointer; }
textarea.form-control { min-height: 100px; font-family: monospace; }
.btn-save-settings, .btn-action { display: block; width: 100%; background-color: #007bff; color: #fff; padding: 12px 15px; font-size: 1em; font-weight: 500; border: none; border-radius: 5px; cursor: pointer; transition: background-color .2s ease; box-sizing: border-box; }
.btn-save-settings:hover, .btn-action:hover { background-color: #0056b3; }
.btn-save-settings .fas, .btn-action .fas { margin-right: 8px; }

.switch { position: relative; display: inline-block; width: 50px; height: 24px; vertical-align: middle; }
.switch input { display: none; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #007bff; }
input:checked + .slider:before { transform: translateX(26px); }

.display-settings-section .label-title { font-size: 1.05em; color: #343a40; padding-bottom: 8px; margin-bottom: 15px; border-bottom: 1px solid #e0e0e0; }
.display-settings-section .form-group { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.display-settings-section .form-group:last-child { border-bottom: none; }
.display-settings-section .form-group label { margin-bottom: 0; }
.display-settings-section .indented { margin-left: 30px; }

.order-item-list { list-style: none; padding: 0; }
.order-item { background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 4px; padding: 10px 15px; margin-bottom: 8px; display: flex; align-items: center; cursor: grab; }
.order-item .fas.fa-bars { margin-right: 10px; color: #6c757d; }
.order-item.dragging { opacity: 0.5; background: #cce7ff; }

.search-bar-container {
    margin-bottom: 20px;
    position: relative;
}
.search-bar-container .fas {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}
.search-bar-container .form-control {
    padding-left: 40px;
}

.link-manager-container { padding: 10px; }
.lm-title { text-align:center; margin-top:0; margin-bottom:25px; color: #333; font-weight: 600; }
.lm-table-wrapper { overflow-x: auto; } 
.lm-table { width: 100%; border-collapse: collapse; font-size: 0.95em; min-width: 600px; /* Tránh bị vỡ trên màn hình nhỏ */ }
.lm-table th, .lm-table td { padding: 12px 15px; border: 1px solid #e9ecef; text-align: left; vertical-align: middle; }
.lm-table thead th { background-color: #f8f9fa; color: #495057; font-weight: 600; border-bottom: 2px solid #dee2e6; }
.lm-table .actions-header { text-align: center; }
.lm-table tbody tr:hover { background-color: #f1f3f5; }
.lm-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lm-btn { text-decoration: none !important; color: #fff !important; padding: 6px 12px; border-radius: 5px; font-size: 0.85em; display: inline-flex; align-items: center; border: none; cursor: pointer; transition: all 0.2s ease; }
.lm-btn .fas { margin-right: 5px; }
.lm-btn-view { background-color: #17a2b8; } .lm-btn-view:hover { background-color: #138496; }
.lm-btn-txt { background-color: #007bff; } .lm-btn-txt:hover { background-color: #0056b3; }
.lm-btn-csv { background-color: #28a745; } .lm-btn-csv:hover { background-color: #218838; }
.lm-btn-delete { background-color: #dc3545; } .lm-btn-delete:hover { background-color: #c82333; }
.lm-no-links { text-align: center; color: #6c757d; padding: 25px; font-size: 1.1em; }

/* --- CSS CHO EMPLOYEE MANAGER (QUẢN LÝ NHÂN VIÊN) --- */
.em-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
}
.em-tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    font-weight: 500;
    color: #6c757d;
    position: relative;
    top: 2px;
}
.em-tab-link.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}
.em-tab-link .fas { margin-right: 8px; }
.em-tab-content { display: none; }
.em-tab-content.active { display: block; animation: fadeIn 0.5s; }
.em-no-data { text-align: center; padding: 20px; color: #6c757d; }
.em-stat-detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.em-stat-detail-row:last-child { border-bottom: none; }
a.em-toggle-links { text-decoration: none; color: #007bff; font-weight: 600; }
a.em-toggle-links:hover { text-decoration: underline; }
.em-links-container textarea.em-links-textarea {
    width: 100%;
    height: 120px;
    padding: 8px;
    font-family: monospace;
    font-size: 0.9em;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
    background-color: #f8f9fa;
    margin-top: 5px;
}

/* CSS CHO MODAL (Cửa sổ Pop-up) */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { display: none; position: fixed; z-index: 1050; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; outline: 0; background-color: rgba(0,0,0,0.5); animation: fadeIn 0.3s; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0,0,0,.2); border-radius: .3rem; outline: 0; max-width: 600px; margin: 1.75rem auto; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem 1rem; border-bottom: 1px solid #dee2e6; border-top-left-radius: .3rem; border-top-right-radius: .3rem; background-color: #f7f7f7; }
.modal-title { margin-bottom: 0; line-height: 1.5; font-size: 1.25rem; font-weight: 500; }
.modal-close-btn { padding: 1rem 1rem; margin: -1rem -1rem -1rem auto; background-color: transparent; border: 0; font-size: 1.5rem; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: .5; cursor: pointer; }
.modal-close-btn:hover { opacity: .75; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-body textarea { width: 100%; height: 250px; resize: vertical; font-family: monospace; font-size: 0.9em; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: .75rem; border-top: 1px solid #dee2e6; border-bottom-right-radius: .3rem; border-bottom-left-radius: .3rem; }
.modal-footer .lm-btn { background-color: #6c757d; } .modal-footer .lm-btn:hover { background-color: #5a6268; }

/* --- CSS CHO FOOTER LINK --- */
.footer-link {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}
.footer-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
.footer-link a:hover {
    text-decoration: underline;
}
.footer-link a .fas {
    margin-right: 4px;
}


/* --- CSS RESPONSIVE (Cho màn hình nhỏ) --- */
@media (max-width:768px){
    /* Responsive cho bảng quản lý */
    .lm-table thead { display: none; }
    .lm-table, .lm-table tbody, .lm-table tr, .lm-table td { display: block; width: 100%; }
    .lm-table tr { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
    .lm-table td { text-align: right; padding-left: 50%; position: relative; border: none; border-bottom: 1px solid #eee; display: flex; align-items: center; min-height: 30px;}
    .lm-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #333;
    }
    .lm-table td:last-child { border-bottom: 0; }
    .lm-actions { justify-content: flex-end; padding-top: 15px; padding-bottom: 15px;}
}

@media (max-width:600px){
    .client-container, .admin-settings-wrapper {
        /* Giảm padding trên màn hình nhỏ */
        padding: 0 10px;
    }

    .client-field-row, .info-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .client-field-row label, .info-field-row label {
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0;
        text-align: left; /* Căn trái cho label */
    }

    .navbar {
        flex-direction: column;
        align-items: center;
        padding: 10px; /* Giảm padding navbar */
    }

    .navbar .brand {
        margin-bottom: 10px;
        display: block;
        width: 100%;
        text-align: center;
    }

    .navbar .nav-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .navbar .nav-actions a {
        margin: 5px;
        flex-grow: 1;
        text-align: center;
    }

    .client-panel-header {
        flex-wrap: wrap;
        justify-content: center; /* Căn giữa header panel */
        text-align: center;
    }
    
    .panel-title-group {
        width: 100%;
        margin-bottom: -8px; /* Thêm khoảng cách */
    }

    .header-account-stats, .header-link-stats {
        text-align: center; /* Căn giữa các thống kê */
        width: 100%;
        margin-top: 8px;
        display: block;
    }

    .header-account-stats span, .header-link-stats span {
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 3px;
    }
}

.initial-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: #6c757d;
}
.settings-panel-header .header-actions {
    display: flex;
    gap: 10px;
    margin-left: auto; /* Đẩy các nút về phía bên phải */
}

/* Responsive cho di động */
@media (max-width: 768px) {
    .settings-panel-header {
        flex-wrap: wrap; /* Cho phép các thành phần xuống dòng */
    }
    
    .settings-panel-header .header-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 10px; /* Thêm khoảng cách khi xuống dòng */
        justify-content: flex-end; /* Căn các nút về bên phải */
    }
}

.info-field-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.info-field-row:last-child {
    border-bottom: none;
}
.info-field-row label {
    font-weight: 600;
    color: #555;
    width: 120px;
    flex-shrink: 0;
}
.info-field-row span {
    word-break: break-all;
}
.account-stt-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: bold;
    color: #6f42c1;
    background-color: #e9dffc;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.client-input-group {
    display: flex;
    align-items: center;
    width: 100%;
}

.client-input-group input[type="text"] {
    flex-grow: 1;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}


.client-input-group .client-btn-icon-copy:hover {
    background-color: #e9ecef;
}

/* Nút làm mới/lấy mã 2FA */
.client-input-group .client-btn-icon-refresh {
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
    padding: 0 12px;
    cursor: pointer;
    line-height: 36px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid #ced4da; /* Thêm viền trái để tách biệt */
}

.client-input-group .client-btn-icon-refresh:hover {
    background-color: #e9ecef;
}

/* Đồng hồ đếm ngược */
.countdown-text {
    font-size: 0.9em;
    color: #6c757d;
    min-width: 35px;
    text-align: center;
    line-height: 38px;
    background-color: #f8f9fa;
    border-left: none;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}
.result-display-container .client-input-group,
#api-response-data-container .client-input-group {
    margin-top: 10px;
}

/* Áp dụng lại các style cần thiết cho input trong kết quả */
.result-display-container input[type="text"],
#api-response-data-container input[type="text"] {
    border: 1px solid #ced4da;
    border-radius: 5px; /* Bo tròn lại các góc */
    padding: 0.375rem 0.75rem;
    height: 38px;
    font-size: 1rem;
    width: 100%;
    background-color: #e9ecef; /* Màu nền cho input readonly */
}

/* Chỉnh lại nút copy cho nhất quán */
.result-display-container .client-btn-icon-copy,
#api-response-data-container .client-btn-icon-copy {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1px solid #ced4da;
    border-left: none; /* Bỏ viền trái của nút */
}
/* CSS for Email Table Display */
.email-table-container { overflow-x: auto; }
.email-table-container table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.email-table-container th, .email-table-container td { padding: 12px 15px; border: 1px solid #3a4b5f; text-align: left; }
.email-table-container th { background-color: #2c3e50; color: #ecf0f1; }
.email-table-container tr:nth-child(even) { background-color: #273444; }
.email-table-container a.view-detail-btn { color: #3498db; text-decoration: none; font-size: 0.9em; margin-left: 5px; }
.email-table-container a.view-detail-btn:hover { text-decoration: underline; }
.code-container { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-container span { font-weight: bold; color: #e67e22; }
.small-copy-btn { padding: 3px 8px !important; font-size: 0.8em !important; background-color: #e67e22 !important; border-radius: 3px !important; line-height: 1.5; }

/* CSS for Email Detail Modal */
.modal-content.large { max-width: 800px; }
.modal-subheader { padding: 10px 20px; background-color: #f8f9fa; border-bottom: 1px solid #dee2e6; }
.modal-body.email-content { max-height: 60vh; overflow-y: auto; }
.modal-body.email-content iframe { max-width: 100%; }
.mail-actions-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px; /* Khoảng cách giữa 2 nút */
}
.email-item {
    border: 1px solid #4a5568;
    border-radius: 6px;
    margin-bottom: 15px;
    background-color: #2d3748;
    color: #cbd5e0;
}
.email-from {
    padding: 10px 15px;
    background-color: #4a5568;
    border-bottom: 1px solid #718096;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}
.email-code-badge {
    background-color: #e67e22;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: bold;
}
.email-content-preview {
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.email-content-preview:hover {
    background-color: #4a5568;
}
.email-content-preview p {
    margin: 5px 0 0;
    color: #a0aec0;
    font-size: 0.95em;
}

/* CSS for Email Detail Modal (giữ nguyên) */
.modal-content.large { max-width: 800px; }
.modal-subheader { padding: 10px 20px; background-color: #f8f9fa; border-bottom: 1px solid #dee2e6; }
.modal-body.email-content { max-height: 60vh; overflow-y: auto; color: #333; } /* Sửa màu chữ cho dễ đọc */
.modal-body.email-content iframe { max-width: 100%; }
.header-account-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    align-items: center;
}

.stat-item {
    color: #bdc3c7; /* Màu chữ mặc định cho nhãn */
}

.stat-item strong {
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
}

.stat-remaining {
    color: #139348; /* Màu xanh lá cho số tài khoản còn lại */
}

.stat-used-today {
    color: #f1c40f; /* Màu vàng cho số tài khoản đã dùng hôm nay */
}

.stat-total-used {
    color: #f42929; /* Màu trắng xám cho tổng số */
}