/* ==========================================================================
   OneSMS — app.css
   Bộ giao diện duy nhất của hệ thống. Thay thế toàn bộ CSS cũ
   (bootstrap 2, style.css, modern-ui.css, phuoc.css, login.css, loading.css).

   Mục lục
   1.  Tokens
   2.  Nền tảng (reset, chữ, liên kết)
   3.  Tiện ích + lưới (row-fluid / spanN)
   4.  Khung ứng dụng: topbar, sidebar, nội dung
   5.  Tiêu đề trang + breadcrumb
   6.  Box (thẻ nội dung)
   7.  Form
   8.  Nút
   9.  Thông báo (alert)
   10. Bảng + DataTables
   11. Tab
   12. Modal + dropdown
   13. Biểu tượng (icon-* cũ -> Font Awesome 6)
   14. jQuery UI (datepicker, tabs)
   15. Upload kéo thả, loading, hỗ trợ
   16. Trang đăng nhập / đăng ký
   17. Riêng từng trang (gom từ các khối <style> cũ)
   18. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --ink: #0f2b2e;            /* sidebar, chữ đậm */
    --ink-2: #173c40;
    --primary: #0b7a75;        /* màu chính: xanh "đã gửi" */
    --primary-strong: #075c58;
    --primary-soft: #e3f1ef;
    --signal: #f2a93b;         /* điểm nhấn: hotline, mục đang chọn */
    --signal-soft: #fdf1dc;

    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-2: #f7f9f8;
    --text: #1b2624;
    --muted: #5f6e6b;
    --border: #dce3e1;
    --border-strong: #c5d0cd;

    --success: #1f8a4c;
    --success-soft: #e5f4ea;
    --danger: #c2412d;
    --danger-soft: #fbe9e5;
    --info: #2563a8;
    --info-soft: #e8f0fa;
    --warning: #9a6200;
    --warning-soft: var(--signal-soft);

    --r-lg: 12px;     /* box, modal */
    --r-md: 8px;      /* nút, ô nhập */
    --r-sm: 5px;      /* badge, chip */

    --topbar-h: 48px;
    --sidebar-w: 212px;
    --ctl-h: 32px;       /* chiều cao ô nhập, nút */
    --ctl-h-sm: 26px;    /* nút trong bảng */

    --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --shadow-pop: 0 18px 48px -12px rgba(15, 43, 46, .28), 0 2px 6px rgba(15, 43, 46, .08);
    --focus: 0 0 0 3px rgba(11, 122, 117, .22);
}

/* 2. Nền tảng -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
h5 { font-size: 13px; }
h6 { font-size: 13px; }

p { margin: 0 0 .75em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); text-decoration: underline; }

img { max-width: 100%; vertical-align: middle; border: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
b, strong { font-weight: 600; }
small { font-size: 12px; }
label { display: inline-block; margin-bottom: 4px; font-weight: 500; }
ul, ol { padding-left: 20px; margin: 0 0 .75em; }
iframe { border: 0; max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus); }

::selection { background: var(--primary-soft); }

/* 3. Tiện ích + lưới -------------------------------------------------------- */
.pull-left { float: left; }
.pull-right { float: right; }
.hide, .hidden { display: none !important; }
.show { display: block !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--muted); }

.clearfix::after,
.row-fluid::after,
.container-fluid::after,
.box::after,
.box-body::after,
.control-group::after,
.controls::after,
.controls-row::after,
form::after { content: ""; display: table; clear: both; }

.container-fluid { padding: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Lưới: tương thích tên lớp Bootstrap 2, dùng padding làm khoảng cách */
.row-fluid { margin: 0 -6px; }
.row { margin: 0 -6px; }
[class*="span"] {
    float: left;
    min-height: 1px;
    padding: 0 6px;
}
.span1 { width: 8.3333%; }   .span2 { width: 16.6667%; }
.span3 { width: 25%; }       .span4 { width: 33.3333%; }
.span5 { width: 41.6667%; }  .span6 { width: 50%; }
.span7 { width: 58.3333%; }  .span8 { width: 66.6667%; }
.span9 { width: 75%; }       .span10 { width: 83.3333%; }
.span11 { width: 91.6667%; } .span12 { width: 100%; }

/* Cột Bootstrap 3 (còn sót ở vài trang) */
[class*="col-xs-"], [class*="col-sm-"], [class*="col-md-"], [class*="col-lg-"] {
    float: left; width: 100%; padding: 0 8px; min-height: 1px;
}
@media (min-width: 768px) {
    .col-sm-6 { width: 50%; }
    .col-sm-12 { width: 100%; }
}

/* 4. Khung ứng dụng --------------------------------------------------------- */
#top {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 0 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: var(--sidebar-w);
    height: 100%;
    padding: 0 20px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.01em;
    flex: none;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, .6);
    letter-spacing: 0;
    line-height: 1.2;
}

/* Biểu tượng: bong bóng tin nhắn mang số 1 */
.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 26px;
    height: 23px;
    flex: none;
    border-radius: 8px 8px 8px 3px;
    background: var(--signal);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--r-md);
    color: var(--text);
    font-weight: 500;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
}
.topbar-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar-link img { height: 16px; border-radius: 2px; }
.topbar-link .avatar {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-2); }

/* Sidebar */
#navigation {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    z-index: 990;
    overflow-y: auto;
    background: var(--ink);
    color: rgba(255, 255, 255, .78);
    padding: 6px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
}

.nav-group-title {
    margin: 12px 10px 3px;
    font-size: 11.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .45);
}
.nav-group-title:first-child { margin-top: 4px; }

.mainNav { list-style: none; margin: 0; padding: 0; }
.mainNav > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
}
.mainNav > li > a i {
    width: 18px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
}
.mainNav > li > a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    text-decoration: none;
}
.mainNav > li.active > a {
    background: var(--ink-2);
    color: #fff;
}
.mainNav > li.active > a i { color: var(--signal); }
.mainNav > li.active > a::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--signal);
}

.nav-api {
    margin: 14px 2px 0;
    padding: 10px;
    border-radius: var(--r-md);
    background: var(--ink-2);
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .75);
}
.nav-api h5 { color: #fff; margin: 0 0 4px; font-size: 12.5px; }
.nav-api p { margin: 0 0 8px; }
.nav-api a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    color: var(--signal);
    font-weight: 500;
}
.nav-api a:hover { color: #fff; }
.nav-api .tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    background: rgba(31, 138, 76, .25);
    color: #9fe0b8;
    font-size: 12px;
}

.nav-backdrop { display: none; }

/* Vùng nội dung */
#main { padding-top: var(--topbar-h); min-height: 100vh; }
#content {
    margin-left: var(--sidebar-w);
    padding: 14px 18px 24px;
    min-height: calc(100vh - var(--topbar-h));
}
#content-area { padding: 0; }

/* 5. Tiêu đề trang ----------------------------------------------------------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}
.page-header .pull-left,
.page-header .pull-right { float: none; }
.page-header h1,
.page-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.page-header h4 i { display: none; }

.bread {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: var(--muted);
}
.bread li { display: inline-flex; align-items: center; }
.bread a { color: var(--muted); }
.bread a:hover { color: var(--primary); }
.bread .divider { margin: 0 8px; color: var(--border-strong); }
.bread .active { color: var(--text); font-weight: 500; }

/* 6. Box -------------------------------------------------------------------- */
.box {
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.box-head,
.box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
}
.box-head i { color: var(--primary); }
.box-title h3 { margin: 0; font-size: 13.5px; }
.box-body { padding: 12px 14px; }
.box-body.box-body-nopadding { padding: 12px 14px; }
.box > .box-body:first-child { border-radius: var(--r-lg); }

/* Khối thông báo tiêu đề ngay đầu box (vd. "Gửi tin SMS") hiển thị như dòng tiêu đề */
.box-body > .alert.alert-info:first-child h4,
.box-body > .alert h4 { margin: 0; font-size: 13.5px; }

/* 7. Form ------------------------------------------------------------------- */
:where(input[type="text"], input[type="password"], input[type="email"],
       input[type="number"], input[type="tel"], input[type="search"],
       input[type="url"], input[type="date"], input:not([type]),
       select, textarea) {
    display: inline-block;
    height: var(--ctl-h);
    max-width: 100%;
    padding: 4px 9px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
    vertical-align: middle;
}
:where(textarea) { height: auto; min-height: 72px; line-height: 1.5; resize: vertical; }
:where(select) {
    padding-right: 26px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f6e6b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
}
:where(select[multiple]) { height: auto; background-image: none; padding-right: 11px; }

:where(input, select, textarea):focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus);
}
:where(input, select, textarea)[readonly],
:where(input, select, textarea)[disabled] {
    background-color: var(--surface-2);
    color: var(--muted);
}
::placeholder { color: #93a19e; opacity: 1; }

input[type="checkbox"], input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    vertical-align: -3px;
    accent-color: var(--primary);
}

.input-block-level, .form-control { display: block; width: 100%; }

/* Bố cục nhãn - ô nhập */
.control-group { margin-bottom: 8px; }
.control-label {
    display: block;
    margin-bottom: 3px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}
.controls :where(input[type="text"], input[type="password"], input[type="email"],
                 input[type="number"], input[type="tel"], input:not([type]),
                 select, textarea) { width: 100%; }
.controls-row [class*="span"]:first-child { padding-left: 0; }
.controls-row [class*="span"]:last-child { padding-right: 0; }
.controls-row [class*="span"] + [class*="span"] { padding-left: 6px; }

.form-horizontal .control-group::after { display: none; }
.form-horizontal .control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 12px;
}
.form-horizontal .control-label {
    flex: 0 0 130px;
    margin: 0;
    padding-top: 7px;
    text-align: left;
}
.form-horizontal .controls { flex: 1 1 0; min-width: 0; margin: 0 !important; }
/* control-group lồng bên trong control-group khác (trang gửi tin): xuống dòng riêng */
.form-horizontal .control-group > .control-group { flex: 1 1 100%; width: 100%; margin-bottom: 0; padding: 0; }
/* Bỏ các width/margin-left viết cứng trong thẻ (style="width: 8%" ...) của bố cục cũ */
.form-horizontal .control-label[style] { width: auto !important; }
.form-horizontal .span4 > .control-label,
.form-horizontal .span3 > .control-label,
.form-horizontal.span4 .control-label { flex-basis: 84px; }
.form-horizontal .control-group > .controls:only-child { margin-left: 142px !important; }

.form-bordered .control-group { margin-bottom: 8px; padding-bottom: 0; border: 0; }

.help-block {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}
.form-actions {
    clear: both;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
    background: transparent;
}

/* Lỗi của jquery.validate */
label.error, span.error, .help-block.error {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger);
}
input.error, select.error, textarea.error { border-color: var(--danger); }

/* 8. Nút -------------------------------------------------------------------- */
.button, .btn,
.btnG, .button-basic-blue, .button-basic-darkblue, .button-basic-red,
:where(button:not([class]), input[type="submit"]:not([class]),
       input[type="button"]:not([class]), input[type="reset"]:not([class])) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--ctl-h);
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    transition: background-color .15s, border-color .15s, color .15s;
    user-select: none;
}
.button:hover, .btn:hover, .button-basic-red:hover {
    background: var(--surface-2);
    border-color: var(--muted);
    color: var(--text);
    text-decoration: none;
}
.button:active, .btn:active { transform: translateY(1px); }

/* Nút chính */
.button-basic-blue, .btn-primary, .btnG,
:where(button:not([class]), input[type="submit"]:not([class])) {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.button-basic-blue:hover, .btn-primary:hover, .btnG:hover,
:where(button:not([class]), input[type="submit"]:not([class])):hover {
    color: #fff;
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

/* Nút đậm (hành động chốt) */
.button-basic-darkblue, .button-basic {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}
.button-basic-darkblue:hover, .button-basic:hover {
    color: #fff;
    background: var(--ink-2);
    border-color: var(--ink-2);
}

/* Nút nguy hiểm */
.button-basic-red, .btn-danger {
    color: var(--danger);
    background: var(--surface);
    border-color: #e7b8ae;
}
.button-basic-red:hover, .btn-danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-default { color: var(--text); background: var(--surface); }
.btn-block, .button.btn-block { display: flex; width: 100%; }

/* Chỉ thuộc tính disabled thật mới khoá nút. Lớp .disabled trong code cũ được gắn
   cả cho nút đang dùng (vd. nút "Thêm" trong popup khách hàng) nên không được khoá. */
.button[disabled], .btn[disabled],
button[disabled], input[type="submit"][disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Khoảng cách giữa các nút đứng cạnh nhau */
.button + .button, .btn + .btn, .button + .btn, .btn + .button { margin-left: 4px; }

/* 9. Thông báo -------------------------------------------------------------- */
.alert {
    position: relative;
    margin: 0 0 10px;
    padding: 7px 34px 7px 10px;
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--r-md);
    background: var(--signal-soft);
    border-color: #f0d6a5;
    color: var(--warning);
    font-size: 13px;
}
.alert h4 { color: inherit; margin: 0; }
.alert-info { background: var(--info-soft); border-color: #c4d7ef; border-left-color: var(--info); color: #1d4a7e; }
.alert-success { background: var(--success-soft); border-color: #bfe2cb; border-left-color: var(--success); color: #17663a; }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: #f0c5bc; border-left-color: var(--danger); color: #922f1f; }
.alert i { margin-right: 6px; }
.alert:not(:has(.close)) { padding-right: 10px; }

/* Các khối alert căn giữa chứa tiêu đề (vd. "Danh sách", "Gửi tin SMS")
   thực chất là tiêu đề mục: hiển thị như tiêu đề, không như cảnh báo. */
.alert.alert-info[style*="text-align: center"],
.alert.alert-error[style*="text-align: center"] {
    clear: both;
    margin: 4px 0 8px;
    padding: 0 0 5px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    text-align: left !important;
}
.alert.alert-info[style*="text-align: center"] h4,
.alert.alert-error[style*="text-align: center"] h4 { font-size: 13.5px; font-weight: 600; }
.box-body > .alert.alert-info[style*="text-align: center"]:first-child { margin-top: 0; }
.alert.alert-success[style*="text-align: center"] { text-align: left !important; }

.close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: inherit;
    opacity: .6;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

.badge, .label-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 600;
}

/* 10. Bảng ------------------------------------------------------------------ */
table { border-collapse: collapse; border-spacing: 0; }

.table,
table[border="1"],
#myTable {
    width: 100%;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    font-size: 12.5px;
}
.table th, .table td,
table[border="1"] th, table[border="1"] td {
    padding: 5px 8px;
    text-align: left;
    line-height: 1.35;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid var(--border);
}
.table thead th, .table > tbody > tr:first-child > th,
table[border="1"] th,
table[border="1"] tr:first-child > td[style*="bold"] {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.table tbody tr:last-child td,
table[border="1"] tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td,
table[border="1"] tr:hover td { background: #f9fbfa; }
.table-bordered th + th, .table-bordered td + td,
table[border="1"] td + td, table[border="1"] th + th { border-left: 1px solid var(--border); }
.table-condensed th, .table-condensed td { padding: 3px 6px; }
.table-nomargin { margin-bottom: 0; }
.table-striped tbody tr:nth-child(odd) td { background: #fafcfb; }

/* Bảng cuộn ngang trên màn hình hẹp */
.box-body { overflow-x: auto; }

/* DataTables 1.9 */
.dataTables_wrapper { position: relative; clear: both; }
.dataTables_wrapper::after { content: ""; display: table; clear: both; }
.dataTables_length, .dataTables_filter {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}
.dataTables_length { float: left; }
.dataTables_filter { float: right; }
.dataTables_length select { width: auto; height: 28px; margin: 0 4px; }
.dataTables_filter input { height: 28px; margin-left: 4px; width: 180px; }
.dataTables_info {
    float: left;
    padding-top: 10px;
    font-size: 13px;
    color: var(--muted);
}
.dataTables_paginate {
    float: right;
    display: flex;
    gap: 4px;
    padding-top: 6px;
}
.dataTables_paginate a,
.dataTables_paginate span > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.dataTables_paginate a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.dataTables_paginate .paginate_active,
.dataTables_paginate .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.dataTables_paginate .paginate_button_disabled,
.dataTables_paginate .paginate_disabled_previous,
.dataTables_paginate .paginate_disabled_next { opacity: .45; cursor: default; }
.dataTables_paginate span { display: inline-flex; gap: 4px; }
.dataTables_empty { text-align: center !important; color: var(--muted); padding: 28px !important; }

table.dataTable thead th { cursor: pointer; position: relative; }
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 6px;
    font-size: 10px;
    opacity: .4;
    content: "\f0dc";
}
table.dataTable thead .sorting_asc::after { content: "\f0de"; opacity: .9; }
table.dataTable thead .sorting_desc::after { content: "\f0dd"; opacity: .9; }

/* Phân trang tự viết (ul.pagination) */
ul.pagination { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 12px 0; }
ul.pagination li { display: inline; margin: 0; padding: 0; }
ul.pagination li a, ul.pagination li span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--surface); color: var(--text); font-size: 13px;
}
ul.pagination li.active a, ul.pagination li.active span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* TableTools */
.DTTT_container { float: right; margin-bottom: 12px; display: flex; gap: 6px; }
.DTTT_button {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
}

/* 11. Tab ------------------------------------------------------------------- */
/* Thanh chọn loại gửi tin ở đầu các trang "Gửi tin" (#tabss) */
#tabss { margin: 0 0 10px; }
#tabss > ul {
    display: flex !important;
    margin: 0 !important;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 3px;
    width: fit-content;
    max-width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
#tabss > ul > li { margin: 0; list-style: none; }
#tabss > ul > li[style*="display: none"] { display: none; }
#tabss > ul > li > a {
    display: block;
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 500;
    font-size: 12.5px;
    white-space: nowrap;
}
#tabss > ul > li > a:hover { color: var(--text); text-decoration: none; background: rgba(255,255,255,.7); }
#tabss > ul > li.ui-tabs-active > a,
#tabss > ul > li.active > a {
    background: var(--surface);
    color: var(--primary-strong);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 43, 46, .1), 0 0 0 1px var(--border);
}
#tabss > div[style*="clear"] { display: none; }

/* 12. Modal + dropdown ------------------------------------------------------ */
.modal {
    position: fixed;
    top: 6vh;
    left: 50%;
    z-index: 1050;
    width: min(680px, calc(100% - 32px)) !important;
    max-height: 88vh;
    margin: 0;
    overflow-y: auto;
    transform: translateX(-50%);
    background: var(--surface);
    border: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    outline: none;
}
.modal.fade { opacity: 0; transform: translate(-50%, 12px); transition: opacity .18s ease, transform .18s ease; }
.modal.fade.in { opacity: 1; transform: translate(-50%, 0); }
.modal-dialog, .modal-content { width: auto; margin: 0; background: transparent; border: 0; box-shadow: none; }
.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.modal-header .close { position: static; order: 2; margin-left: auto; }
.modal-header h3, .modal-title { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body { padding: 12px 16px; max-height: none; overflow: visible; }
.modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-footer .btn + .btn, .modal-footer .button + .button { margin-left: 0; }
.modal iframe { width: 100%; min-height: 260px; border: 0; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 43, 46, .55);
}
.modal-backdrop.fade { opacity: 0; transition: opacity .18s; }
.modal-backdrop.in, .modal-backdrop.fade.in { opacity: 1; }
.modal-open { overflow: hidden; }

.dropdown, .btn-group { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1010;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
}
.dropdown-menu.pull-right { left: auto; right: 0; float: none; }
.open > .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--text);
}
.dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .divider { height: 1px; margin: 6px 0; background: var(--border); }

.account-head { padding: 8px 10px 10px; }
.account-head strong { display: block; font-size: 15px; }
.account-head span { color: var(--muted); font-size: 12.5px; }
.account-balance {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 0 0 2px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: 13px;
}
.account-balance b { color: var(--primary-strong); font-variant-numeric: tabular-nums; }

/* 13. Biểu tượng ------------------------------------------------------------ */
i[class^="icon-"], i[class*=" icon-"],
span[class^="icon-"], span[class*=" icon-"] {
    display: inline-block;
    width: auto;
    height: auto;
    background: none;
    font-style: normal;
    line-height: 1;
}
i[class^="icon-"]::before, i[class*=" icon-"]::before,
span[class^="icon-"]::before, span[class*=" icon-"]::before,
a.icon-remove-circle::before,
.button[class*="icon-"]::before, [class*="button-basic"][class*="icon-"]::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
}
a.icon-remove-circle::before { margin-right: 5px; }
.button[class*="icon-"]::before, [class*="button-basic"][class*="icon-"]::before { font-size: 12px; }
.table td input[style*="background-color"] { background-color: var(--surface) !important; }
.icon-large::before { font-size: 1.2em; }
.icon-file-alt::before { content: "\f15c"; }
.icon-list-ul::before { content: "\f0ca"; }
.icon-info-sign::before { content: "\f05a"; }
.icon-edit::before { content: "\f044"; }
.icon-envelope::before { content: "\f0e0"; }
.icon-th-large::before { content: "\f009"; }
.icon-user::before { content: "\f007"; }
.icon-group::before { content: "\f0c0"; }
.icon-remove-circle::before { content: "\f057"; }
.icon-calendar::before { content: "\f133"; }
.icon-signout::before { content: "\f2f5"; }
.icon-chevron-up::before { content: "\f077"; }
.icon-chevron-down::before { content: "\f078"; }
.icon-chevron-left::before { content: "\f053"; }
.icon-chevron-right::before { content: "\f054"; }
.icon-arrow-right::before { content: "\f061"; }
.icon-arrow-left::before { content: "\f060"; }
.icon-lock::before { content: "\f023"; }
.icon-unlock::before { content: "\f09c"; }
.icon-table::before { content: "\f0ce"; }
.icon-search::before { content: "\f002"; }
.icon-plus::before { content: "\f067"; }
.icon-star::before { content: "\f005"; }
.icon-star-empty::before { content: "\f005"; font-weight: 400; }

/* 14. jQuery UI -------------------------------------------------------------- */
body .ui-widget { font-family: var(--font); font-size: 13.5px; }
body .ui-datepicker {
    padding: 10px;
    width: 260px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    z-index: 1100 !important;
}
body .ui-datepicker .ui-datepicker-header {
    padding: 4px 0 8px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 600;
}
body .ui-datepicker .ui-datepicker-prev,
body .ui-datepicker .ui-datepicker-next { top: 4px; border: 0; background: transparent; cursor: pointer; }
body .ui-datepicker .ui-datepicker-prev span,
body .ui-datepicker .ui-datepicker-next span { margin-left: -8px; }
body .ui-datepicker th { color: var(--muted); font-weight: 500; font-size: 12px; }
body .ui-datepicker td a, body .ui-datepicker td span {
    text-align: center;
    padding: 6px 0;
    border: 0 !important;
    border-radius: var(--r-sm);
    background: transparent !important;
    color: var(--text);
}
body .ui-datepicker td a:hover { background: var(--primary-soft) !important; text-decoration: none; }
body .ui-datepicker .ui-state-highlight { color: var(--primary-strong); font-weight: 700; }
body .ui-datepicker .ui-state-active { background: var(--primary) !important; color: #fff; }

body .ui-tabs { padding: 0; border: 0; background: transparent; }
body .ui-tabs .ui-tabs-nav {
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}
body .ui-tabs .ui-tabs-nav li { margin: 0 4px 0 0; border: 0; background: transparent; }
body .ui-tabs .ui-tabs-nav li a { padding: 7px 14px; color: var(--muted); font-weight: 500; }
body .ui-tabs .ui-tabs-nav li.ui-tabs-active { background: var(--surface); border-radius: 7px; box-shadow: 0 0 0 1px var(--border); }
body .ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: var(--primary-strong); }
body .ui-tabs .ui-tabs-panel { padding: 16px 0; }

/* jquery-confirm */
.jconfirm .jconfirm-box { border-radius: var(--r-lg) !important; font-family: var(--font); }
.jconfirm .jconfirm-box .jconfirm-buttons button { border-radius: var(--r-md) !important; }

/* 15. Upload kéo thả, loading, hỗ trợ ---------------------------------------- */
.mu-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.mu-dropzone:hover, .mu-dropzone.mu-dragover { border-color: var(--primary); background: var(--primary-soft); }
.mu-dropzone .mu-icon {
    display: grid; place-items: center;
    width: 28px; height: 28px; margin-bottom: 2px;
    border-radius: 50%; background: var(--surface); color: var(--primary);
    font-size: 16px; font-weight: 700; border: 1px solid var(--border);
}
.mu-dropzone .mu-title { font-weight: 600; }
.mu-dropzone .mu-sub { font-size: 12.5px; color: var(--muted); }
.mu-dropzone .mu-native-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.mu-file-preview {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    position: relative;
    z-index: 2;
}
.mu-file-preview.mu-show { display: inline-flex; }
.mu-file-size { color: var(--muted); }
.mu-remove { cursor: pointer; color: var(--danger); font-size: 16px; padding: 0 4px; }

/* Lớp chờ xử lý */
.loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    font-size: 0;
    color: transparent;
    background: rgba(243, 245, 244, .7);
    backdrop-filter: blur(1px);
}
.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Nút liên hệ nổi + hotline */
.support-dock {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 980;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.support-dock a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15, 43, 46, .12);
}
.support-dock a:hover { border-color: var(--primary); }
.support-dock img { width: 22px; height: 22px; }

.app-footer {
    clear: both;
    margin: 16px 0 0;
    padding: 10px 0 0;
    font-size: 12px;
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    border-top: 1px solid var(--border);
}
.app-footer a { color: var(--text); font-weight: 600; }
.app-footer .hotline-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 3px 10px; border-radius: 999px;
    background: var(--signal-soft); color: var(--warning); font-weight: 600;
}
.app-footer .hotline-pill a { color: inherit; }

.app-footer i { margin-right: 4px; }
.app-footer-copy { margin-left: auto; }

/* Dải giải pháp Công Nghệ Xanh Group ở chân các trang bên trong */
.cnx-band {
    clear: both;
    position: relative;
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(0, 1.6fr) minmax(0, 1.3fr);
    gap: 20px 28px;
    align-items: start;
    margin: 20px 0 0;
    padding: 18px 22px;
    color: rgba(255, 255, 255, .75);
    border-radius: var(--r-lg);
    background:
        radial-gradient(420px 220px at 100% 0%, rgba(242, 169, 59, .18), transparent 70%),
        radial-gradient(420px 260px at 0% 100%, rgba(11, 122, 117, .45), transparent 70%),
        var(--ink);
    overflow: hidden;
}
.cnx-band a { text-decoration: none !important; }
.cnx-band-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.cnx-band-brand img { flex: 0 0 40px; width: 40px; height: 40px; padding: 2px; border-radius: 50%; background: #fff; }
.cnx-band-brand b { display: block; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
.cnx-band-brand small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: #7cc4f0; }
.cnx-band-brand em { display: block; margin-top: 3px; font-size: 11.5px; font-style: normal; color: rgba(255, 255, 255, .55); }
.cnx-band-brand em i { font-size: 8px; }
.cnx-band-brand:hover em { color: #7fe0c4; }
.cnx-band-label { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.cnx-band-label span { display: inline-grid; place-items: center; min-width: 22px; height: 17px; font-size: 10px; letter-spacing: 0; color: var(--ink); background: #7fe0c4; border-radius: 5px; }
.cnx-band-build .cnx-band-label span { background: var(--signal); }
.cnx-band-services { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cnx-band-services a {
    display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
    font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
    transition: background .15s, border-color .15s;
}
.cnx-band-services a i { font-size: 11px; color: #7fe0c4; }
.cnx-band-services a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; }
.cnx-band-build {
    padding: 12px 14px; border-radius: 12px;
    background: linear-gradient(160deg, rgba(242, 169, 59, .16), rgba(255, 255, 255, .03));
    box-shadow: inset 0 0 0 1px rgba(242, 169, 59, .45);
}
.cnx-band-build .cnx-band-label { margin-bottom: 6px; }
.cnx-band-build b { display: block; font-size: 14.5px; line-height: 1.35; color: #fff; }
.cnx-band-build b i { margin-right: 5px; color: #f2c26b; }
.cnx-band-build p { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .68); }
.cnx-band-cta { display: flex; flex-wrap: wrap; gap: 6px; }
.cnx-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--ink) !important; background: var(--signal); border-radius: 8px; }
.cnx-btn:hover { filter: brightness(1.06); }
.cnx-btn-ghost { font-weight: 600; color: #fff !important; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); }
.cnx-btn-ghost:hover { background: rgba(255, 255, 255, .14); }
@media (max-width: 1200px) {
    .cnx-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cnx-band-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .cnx-band { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .app-footer-copy { margin-left: 0; }
}
/* Trang trong popup / iframe: không hiện dải giới thiệu */
body.frame-page .cnx-band, body:not(:has(#top)) .cnx-band { display: none; }

/* Trang bên trong iframe (không có header/sidebar) */
body.frame-page, body:not(:has(#top)) { background: var(--surface); }

/* 16. Trang đăng nhập / đăng ký ---------------------------------------------- */
body.auth-page { background: var(--surface); min-height: 100vh; }

/* Bố cục: trái = hệ sinh thái dịch vụ CNX Group, phải = OneSMS + form */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---- Cột trái: dịch vụ Công Nghệ Xanh Group ---- */
.auth-aside {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 36px 48px 28px;
    background: var(--ink);
    color: rgba(255, 255, 255, .78);
    overflow: hidden;
}
.eco-glow {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(520px 360px at 0% 0%, rgba(11, 122, 117, .45), transparent 70%),
        radial-gradient(480px 380px at 100% 100%, rgba(242, 169, 59, .16), transparent 70%),
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 100% 28px,
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 28px 100%;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
            mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.eco-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eco-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; }
.eco-mark {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--ink);
    background: linear-gradient(135deg, #7fe0c4, #f2a93b);
    box-shadow: 0 6px 18px -6px rgba(127, 224, 196, .6);
}
.eco-brand b { display: block; font-size: 14.5px; letter-spacing: .04em; }
.eco-brand small { display: block; font-size: 12px; color: rgba(255, 255, 255, .55); }
.eco-brand small i { font-size: 9px; margin-left: 2px; }
.eco-brand:hover small { color: #7fe0c4; }
.eco-iso {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    font-size: 11.5px; font-weight: 600; color: #cdeee4;
    border: 1px solid rgba(127, 224, 196, .3); border-radius: 999px; background: rgba(127, 224, 196, .08);
}
.eco-intro { margin-top: auto; }
.eco-eyebrow { display: inline-block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #7fe0c4; }
.eco-intro h1 {
    margin: 0 0 10px; max-width: 16em; color: #fff;
    font-size: clamp(24px, 2.5vw, 34px); font-weight: 700; line-height: 1.18; letter-spacing: -.02em;
}
.eco-intro p { margin: 0; max-width: 34em; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .62); }

.eco-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.eco-card {
    position: relative; display: flex; align-items: flex-start; gap: 12px; height: 100%;
    padding: 13px 34px 13px 13px; color: inherit; text-decoration: none !important;
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px;
    transition: background .2s, border-color .2s, transform .2s;
    opacity: 0; transform: translateY(8px); animation: ecoIn .45s ease forwards; animation-delay: var(--d, 0ms);
}
.eco-card:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); transform: translateY(-2px); }
.eco-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; color: #fff; background: var(--eco, #0b7a75); }
.eco-card.c1 { --eco: linear-gradient(135deg, #ff7a59, #e8483f); }
.eco-card.c2 { --eco: linear-gradient(135deg, #8a6cf0, #5b4bd8); }
.eco-card.c3 { --eco: linear-gradient(135deg, #e070d6, #a14fe0); }
.eco-card.c4 { --eco: linear-gradient(135deg, #3db8e8, #2f7de0); }
.eco-card.c5 { --eco: linear-gradient(135deg, #36c3c9, #2b8be8); }
.eco-card.c6 { --eco: linear-gradient(135deg, #f2a93b, #e07b2b); }
.eco-text { min-width: 0; }
.eco-text b { display: block; font-size: 14px; line-height: 1.3; color: #fff; }
.eco-text em {
    margin-left: 4px; padding: 1px 6px; font-size: 10px; font-style: normal; font-weight: 700; vertical-align: 2px;
    color: var(--ink); background: var(--signal); border-radius: 999px;
}
.eco-text small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .6); }
.eco-go { position: absolute; right: 13px; top: 16px; font-size: 11px; color: rgba(255, 255, 255, .3); transition: color .2s, transform .2s; }
.eco-card:hover .eco-go { color: #fff; transform: translateX(3px); }
.eco-card.is-here { border-color: rgba(242, 169, 59, .45); background: rgba(242, 169, 59, .07); }
@keyframes ecoIn { to { opacity: 1; transform: none; } }

.eco-telcos { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: rgba(255, 255, 255, .5); }
.eco-telcos ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.eco-telcos li { padding: 3px 10px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; }

.auth-contact {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
    padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px;
}
.auth-contact i { margin-right: 4px; color: rgba(255, 255, 255, .45); }
.auth-contact a { color: #fff; font-weight: 600; }
.auth-contact .socials { display: flex; gap: 8px; margin-left: auto; }
.auth-contact .socials a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-contact .socials img { width: 20px; height: 20px; }
.eco-address { flex-basis: 100%; font-size: 12px; color: rgba(255, 255, 255, .5); }

/* Logo công ty (giữ nguyên), giải pháp có sẵn + giải quyết theo yêu cầu */
.auth-aside { gap: 18px; }
.eco-logo { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .6); }
.eco-brand b { font-size: 16px; letter-spacing: .02em; }
.eco-brand small { margin-top: 1px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: #7cc4f0; }
.eco-site { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: #cdeee4 !important; text-decoration: none !important; border: 1px solid rgba(127, 224, 196, .3); border-radius: 999px; background: rgba(127, 224, 196, .08); }
.eco-site i { font-size: 9px; }
.eco-site:hover { background: rgba(127, 224, 196, .16); }
.eco-intro { margin-top: 6px; }
.eco-intro h1 { max-width: none; margin-bottom: 8px; font-size: clamp(23px, 2.3vw, 32px); }
.eco-intro h1 span { background: linear-gradient(90deg, #f2c26b, #f2a93b 40%, #7fe0c4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eco-block { display: flex; flex-direction: column; gap: 10px; }
.eco-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.eco-label::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .1); }
.eco-num { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; font-size: 11px; color: var(--ink); background: #7fe0c4; border-radius: 6px; letter-spacing: 0; }
.eco-block + .eco-block .eco-num { background: var(--signal); }
.eco-card.c7 { --eco: linear-gradient(135deg, #22c55e, #0f9b6c); }
.eco-card { padding: 11px 32px 11px 11px; }
.eco-icon { flex-basis: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
.eco-text b { font-size: 13.5px; }
.eco-text small { font-size: 12px; }
.eco-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Khối "Giải quyết theo yêu cầu": nổi bật nhất cột trái */
.eco-build {
    position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px;
    border-radius: 16px; background: linear-gradient(160deg, rgba(242, 169, 59, .14), rgba(11, 122, 117, .18) 60%, rgba(255, 255, 255, .03));
    border: 1px solid transparent;
    background-clip: padding-box;
    box-shadow: inset 0 0 0 1px rgba(242, 169, 59, .45), 0 18px 40px -24px rgba(242, 169, 59, .55);
}
.eco-build-main { display: flex; gap: 14px; align-items: flex-start; }
.eco-build-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; font-size: 18px; color: var(--ink); background: linear-gradient(135deg, #f2c26b, #f2a93b); border-radius: 12px; }
.eco-build-main b { display: block; font-size: 17px; line-height: 1.3; color: #fff; letter-spacing: -.01em; }
.eco-build-main p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .7); }
.eco-build-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.eco-build-tags li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; }
.eco-build-tags i { font-size: 11px; color: #f2c26b; }
.eco-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 0; list-style: none; counter-reset: st; font-size: 12px; color: rgba(255, 255, 255, .75); }
.eco-steps li { display: inline-flex; align-items: center; gap: 6px; counter-increment: st; }
.eco-steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 10.5px; font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, .85); border-radius: 50%; }
.eco-steps li:not(:last-child)::after { content: "→"; margin-left: 2px; color: rgba(255, 255, 255, .35); }
.eco-build-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.eco-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 700; color: var(--ink) !important; text-decoration: none !important; background: var(--signal); border-radius: 9px; transition: filter .15s, background .15s; }
.eco-btn:hover { filter: brightness(1.06); }
.eco-btn-ghost { color: #fff !important; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); font-weight: 600; }
.eco-btn-ghost:hover { background: rgba(255, 255, 255, .14); }

/* ---- Cột phải: giới thiệu OneSMS + form ---- */
.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 36px 32px;
}
.auth-product { width: 100%; max-width: 380px; }
.auth-product .brand {
    display: inline-flex; align-items: center; gap: 10px; width: auto; height: auto; padding: 0;
    background: transparent; color: var(--text); font-size: 18px; font-weight: 700; text-decoration: none !important;
}
.auth-product .brand small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.auth-product h1 { margin: 16px 0 14px; color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }

/* Chuỗi tin nhắn: tính năng hiển thị như bong bóng SMS */
.thread { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.thread li {
    position: relative; align-self: flex-start; display: flex; align-items: baseline; gap: 8px; max-width: 94%;
    padding: 8px 12px; border-radius: 14px 14px 14px 4px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--ink-2); font-size: 13px; line-height: 1.45;
    opacity: 0; transform: translateY(6px); animation: bubble .35s ease forwards;
}
.thread li i { flex: 0 0 auto; font-size: 11px; color: var(--primary); }
.thread li:nth-child(1) { animation-delay: .15s; }
.thread li:nth-child(2) { animation-delay: .35s; }
.thread li:nth-child(3) { animation-delay: .55s; }
.thread li:nth-child(4) { animation-delay: .75s; }
.thread li:nth-child(5) { animation-delay: 1s; }
.thread li.me {
    align-self: flex-end; border-radius: 14px 14px 4px 14px; border-color: transparent;
    background: var(--signal); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
}
.thread-meta { align-self: flex-end; margin-top: -4px; font-size: 12px; color: var(--muted); }
@keyframes bubble { to { opacity: 1; transform: none; } }

/* Màn hình rộng: OneSMS và form đứng cạnh nhau ở cột phải */
@media (min-width: 1500px) {
    .auth-panel { flex-direction: row; align-items: center; gap: 48px; padding: 40px 48px; }
    .auth-product { max-width: 360px; padding-right: 48px; border-right: 1px solid var(--border); }
    .auth-product h1 { font-size: 26px; }
    .thread li { font-size: 13.5px; }
}
/* Màn hình vừa (laptop): OneSMS nằm trên form, tính năng gọn thành lưới 2 cột để form vẫn nằm trong màn hình */
@media (min-width: 901px) and (max-width: 1499px) {
    .auth-panel { gap: 22px; padding: 28px 32px; }
    .auth-product h1 { font-size: 20px; margin: 12px 0 12px; }
    .auth-product .thread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .auth-product .thread li { max-width: none; padding: 7px 10px; font-size: 12px; border-radius: 10px; }
    .auth-product .thread li.me { display: none; }
    .auth-card h2 { font-size: 22px; }
    .auth-card .lead { margin-bottom: 16px; }
    .auth-card .field { margin-bottom: 12px; }
    .eco-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .auth-aside { padding: 30px 40px 24px; gap: 16px; }
}
/* Màn hình thấp: bỏ mô tả thẻ dịch vụ bên trái */
@media (max-height: 940px) and (min-width: 901px) {
    .eco-intro p, .eco-steps, .eco-address { display: none; }
    .eco-build-main p { display: none; }
}
@media (max-height: 800px) and (min-width: 901px) {
    .eco-text small { display: none; }
}
@media (max-width: 900px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-panel { order: -1; padding: 28px 16px; gap: 20px; }
    .auth-aside { padding: 28px 16px 22px; }
    .eco-intro { margin-top: 0; }
    .eco-grid { grid-template-columns: minmax(0, 1fr); }
    .eco-head { flex-wrap: wrap; }
    .auth-contact .socials { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .eco-card, .thread li { animation: none; opacity: 1; transform: none; }
}

.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .lead { margin: 0 0 24px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text); }
.field :where(input) { width: 100%; height: 44px; font-size: 15px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row img {
    flex: none;
    width: 120px;
    height: 44px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-2);
}
.captcha-row input { flex: 1; min-width: 0; }

.auth-card .button { height: 46px; font-size: 15px; margin-top: 8px; }
.auth-card .button + .button { margin-left: 0; }
.auth-note { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-alt { margin-top: 12px; text-align: center; }
.auth-alt .button { height: 40px; font-size: 14px; }

/* 17. Riêng từng trang ------------------------------------------------------- */
/* Ô dữ liệu không viền trong bảng xem trước khi gửi */
input.data_sent, textarea.data_sent {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 2px 4px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    box-shadow: none;
    resize: none;
}
input.data_sent:focus, textarea.data_sent:focus { background: var(--primary-soft); box-shadow: none; }

/* Bảng tìm kiếm ở các trang báo cáo cũ */
table.tablesearch { margin: 0 0 16px !important; width: auto; }
table.tablesearch td { padding: 4px 6px; border: 0; text-align: left; }
table.tablesearch input, table.tablesearch select { width: auto; min-width: 120px; margin: 0; }

table.tablenote { position: absolute; margin-top: 30px; max-width: 174px; }
table.tablenote td { text-align: left; font-size: 11px; padding-left: 5px; line-height: 15px; }

input.cauhoi-field { display: block; width: 100%; }
#param1_thucong { min-height: 160px; }

.mobilefix label { font-size: 13px; }

/* Bộ đếm "Số tin / Ký tự" đặt cạnh ô soạn nội dung */
input[id^="bantin"], input[id^="kytu"] {
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Nút và form nằm trong ô bảng (cột "Thao tác") */
.table td form, table[border="1"] td form { display: inline-flex; gap: 6px; margin: 0 !important; vertical-align: middle; }
.table td .button, .table td .btn,
.table td .button-basic-blue, .table td .button-basic-darkblue, .table td .button-basic-red {
    height: var(--ctl-h-sm);
    padding: 0 9px;
    font-size: 12px;
    margin: 1px 3px 1px 0 !important;
    background-color: var(--surface);
}
.table td .button-basic-blue { color: var(--primary); border-color: #9fd0cb; }
.table td .button-basic-blue:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.table td .button-basic-darkblue { color: var(--ink); border-color: var(--border-strong); }
.table td .button-basic-darkblue:hover { color: #fff; background: var(--ink); border-color: var(--ink); }
.table td .button-basic-red { color: var(--danger); }
.table td .button-basic-red:hover { color: #fff; background: var(--danger); }
.table td { white-space: normal; }

/* Ô nhập đứng riêng trong form ngang: không kéo dài hết màn hình, nút nằm cạnh ô */
.form-horizontal .controls > :where(input[type="text"], input[type="email"], input[type="password"],
                                    input[type="number"], input[type="tel"], input:not([type]), select) {
    max-width: 440px;
}
.form-horizontal .controls > input + .button,
.form-horizontal .controls > input + input[type="submit"],
.form-horizontal .controls > input + b.button,
.form-horizontal .controls > .button + .button,
.form-horizontal .controls > .button + b,
.form-horizontal .controls > input[type="submit"] + b { margin: 0 0 0 8px; }

/* Thanh lọc / tìm kiếm phía trên danh sách */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    margin: 2px 0 12px;
    padding: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.filter-field { display: flex; flex-direction: column; min-width: 130px; flex: 1 1 140px; max-width: 220px; }
.filter-field label { margin: 0 0 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
.filter-field :where(input, select) { width: 100%; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.filter-actions .button + .button { margin-left: 0; }

/* Ô chọn giờ/phút và nút radio có width viết cứng trong thẻ */
select[style*="width: 50px"], select[style*="width:50px"],
select[style*="width: 70px"] { width: 78px !important; padding-right: 28px; background-position: right 10px center; margin: 0 10px 0 4px; }
input[type="radio"][style*="width"], input[type="checkbox"][style*="width"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 6px 0 0 !important;
}
input[type="radio"] + b, input[type="checkbox"] + b { margin-right: 16px; font-weight: 500; }
input.hasDatepicker[style*="width: auto"] { width: 140px !important; margin-right: 10px; }

/* Thanh lọc ở trang báo cáo: nhãn + ô nhập theo cột, nút cuối hàng */
.filter-bar > .filter-field, .filter-bar > .filter-actions { float: none; width: auto; padding: 0; margin: 0; }
.filter-field .control-label { margin: 0 0 3px; padding: 0; width: auto; font-size: 12px; color: var(--muted); }
.filter-field .controls, .filter-actions .controls { margin: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.filter-field .controls > :where(input, select) { width: 100%; max-width: none; }
.filter-actions .button + .button { margin-left: 0; }
.filter-bar > .clearfix { display: none; }

/* Form thêm nhanh (khách hàng, nhóm): các ô nằm trên một hàng */
.form-inline-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
    margin: 0 0 12px;
    padding: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.form-inline-bar::after, .form-inline-bar > .clearfix { display: none; }
.form-inline-bar > .control-group {
    float: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 170px;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.form-inline-bar > .control-group[style*="display: none"] { display: none; }
.form-inline-bar .control-label { margin: 0 0 3px; padding: 0; width: auto !important; font-size: 12px; color: var(--muted); }
.form-inline-bar .controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.form-inline-bar .controls > :where(input[type="text"], input[type="email"], input[type="number"], input:not([type]), select) {
    flex: 1 1 160px;
    width: auto;
    max-width: 360px;
}
.form-inline-bar .controls > .button, .form-inline-bar .controls > input[type="submit"] { margin: 0 !important; }
.form-inline-bar > .cg-actions { flex: 0 0 auto; }
.form-inline-bar > .control-group:only-of-type { flex: 1 1 100%; }

/* Dòng tổng trong báo cáo lưu lượng (tô vàng cứng trong JSP) */
.table tr[style*="yellow"] td { background: var(--signal-soft) !important; color: var(--text) !important; font-weight: 600; }

/* Ví dụ cách viết template có tham số {P} */
.tpl-example {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--info-soft);
    color: #1d4a7e;
    font-size: 12px;
    font-weight: 400;
}
.tpl-example b { color: var(--danger) !important; }

/* Thanh lọc: bỏ phần tử clearfix ẩn trong .controls (nó làm ô nhập cao hơn nút 6px) */
.filter-field .controls::after, .filter-actions .controls::after,
.form-inline-bar .controls::after, .cp-field::after { display: none; }
.filter-actions .controls > * { height: var(--ctl-h); }

/* DataTables Buttons (Copy / Excel / CSV / PDF) */
.dt-buttons { float: left; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 12px 8px 0; }
.dt-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}
.dt-button:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.dt-button::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    font-size: 13px;
}
.dt-button.buttons-copy::before  { content: "\f0c5"; }
.dt-button.buttons-excel::before { content: "\f1c3"; color: #1f7a45; }
.dt-button.buttons-csv::before   { content: "\f15c"; }
.dt-button.buttons-pdf::before   { content: "\f1c1"; color: var(--danger); }
.dataTables_filter label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.dataTables_filter input { margin: 0; }
.dataTables_wrapper .dataTables_info { padding-top: 8px; }
.dataTables_paginate { flex-wrap: wrap; justify-content: flex-end; }
.dataTables_paginate .ellipsis { display: inline-flex; align-items: flex-end; padding: 0 2px; color: var(--muted); }
.dataTables_paginate a.previous, .dataTables_paginate a.next { padding: 0 10px; }
.dataTables_paginate a.disabled { opacity: .45; pointer-events: none; }
div.dt-button-info {
    position: fixed; top: 30%; left: 50%; z-index: 2100; transform: translateX(-50%);
    min-width: 260px; padding: 14px 18px; text-align: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop);
}
div.dt-button-info h2 { margin: 0 0 4px; font-size: 14px; }

/* 17b. Trang gửi tin (bố cục do js/composer.js dựng) ------------------------ */
.cp-legacy { display: none !important; }
.box:has(.composer) { background: transparent; border: 0; }
.box:has(.composer) > .box-body { padding: 0; overflow: visible; }
form.guitinsubmit { margin: 0; }

.composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
    align-items: start;
}
.composer-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.cp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.cp-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.cp-head-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cp-card-body { padding: 10px 12px 12px; }

.cp-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-row + .cp-field, .cp-row + .cp-row { margin-top: 10px; }
.cp-field { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; margin: 0; padding: 0; float: none; width: auto; }
.cp-field.cp-grow { flex: 3 1 260px; }
.cp-field.cp-narrow { flex: 0 1 150px; }
.cp-field.cp-time { flex: 0 0 84px; }
.cp-label { margin: 0 0 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cp-field :where(select, input[type="text"]) { width: 100% !important; max-width: none; }

.cp-message textarea {
    width: 100%;
    min-height: 110px;
    border-radius: var(--r-md) var(--r-md) 0 0;
    font-size: 13.5px;
    line-height: 1.5;
}
.cp-meter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    padding: 5px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-top: 0;
    border-radius: 0 0 var(--r-md) var(--r-md);
    font-size: 12px;
    color: var(--muted);
}
.cp-meter-item { display: inline-flex; align-items: baseline; gap: 4px; }
.cp-meter-item input {
    width: 2.6em !important;
    max-width: none !important;
    text-align: right !important;
    color: var(--text) !important;
    font-size: 12.5px;
}
.cp-meter-item:first-child input { color: var(--primary-strong) !important; }
.cp-limit { margin: 0 0 0 auto; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.cp-limit b { font-weight: 600; color: var(--text) !important; }

/* Người nhận */
.cp-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cp-add-btn.button {
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    margin: 0 !important;
}
.cp-add-btn.button::before {
    content: "+";
    font-weight: 600;
    color: var(--primary);
}
.cp-add-btn.button:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.cp-count-pill b {
    display: inline-block;
    min-width: 22px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.cp-has-rows .cp-count-pill b { background: var(--primary-soft); border-color: #b9dcd8; color: var(--primary-strong); }

.cp-table-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.cp-table-wrap #myTable { margin: 0; border: 0; border-radius: 0; }
.cp-table-wrap #myTable thead th { position: sticky; top: 0; z-index: 1; }
.cp-table-wrap #myTable th:first-child, .cp-table-wrap #myTable td:first-child { width: 150px; }
.cp-table-wrap #myTable th:last-child:not(:nth-child(2)), .cp-table-wrap #myTable td:last-child:not(:nth-child(2)) { width: 70px; text-align: center; }
.composer:not(.cp-has-rows) .cp-table-wrap { display: none; }
.cp-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12.5px;
}
.cp-empty i { font-size: 18px; color: var(--border-strong); }
.cp-has-rows .cp-empty { display: none; }

/* Thời gian gửi */
.cp-seg {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.cp-seg-item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
}
.cp-seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.cp-seg-item:has(input:checked) { background: var(--surface); color: var(--primary-strong); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(15,43,46,.08); }
.cp-seg-item:has(input:focus-visible) { box-shadow: var(--focus); }
.cp-when { margin-top: 10px; max-width: 420px; }
.composer:not(.cp-later) .cp-when { display: none; }
.cp-when .cp-field:first-child { flex: 1 1 140px; }

/* Cột tóm tắt */
.composer-side { position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 10px; }

.cp-help {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}
.cp-help h4 { margin: 0 0 4px; font-size: 12.5px; color: var(--text); }
.cp-help p { margin: 0 0 4px; }
.cp-help b { color: var(--text) !important; }
.cp-help-warn { padding: 6px 8px; border-radius: 6px; background: var(--signal-soft); color: var(--warning); }

/* ---- Điểm nhấn trang gửi tin ------------------------------------------- */

/* Chọn loại tin: 3 thẻ kênh, thẻ đang chọn viền màu chính */
#tabss.cp-channels { margin: 0 0 12px; }
#tabss.cp-channels > ul {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
}
#tabss.cp-channels > ul > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: none;
    color: var(--text);
    white-space: normal;
}
#tabss.cp-channels > ul > li > a:hover { border-color: var(--border-strong); background: var(--surface); }
#tabss.cp-channels > ul > li > a > i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 15px;
}
.cp-ch-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cp-ch-title { font-size: 13.5px; font-weight: 600; }
.cp-ch-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
#tabss.cp-channels > ul > li.ui-tabs-active > a {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary) inset;
    background: linear-gradient(0deg, var(--primary-soft), var(--primary-soft)) padding-box;
}
#tabss.cp-channels > ul > li.ui-tabs-active > a > i { background: var(--primary); color: #fff; }
#tabss.cp-channels > ul > li.ui-tabs-active .cp-ch-title { color: var(--primary-strong); }

/* Thẻ từng bước: số bước đặc, hoàn tất thì chuyển dấu tích */
.cp-card { position: relative; transition: border-color .2s; }
.cp-card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.005em; }
.cp-step {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.cp-card.is-done .cp-step { background: var(--primary); font-size: 0; }
.cp-card.is-done .cp-step::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10.5px;
}
.cp-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 122, 117, .10); }

/* Thẻ tóm tắt: nền tối, là điểm nhìn chính của trang */
.cp-summary {
    padding: 14px;
    background: var(--ink);
    border: 0;
    border-radius: 12px;
    color: rgba(255, 255, 255, .72);
}
.cp-summary .cp-k { font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.cp-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cp-sum-head h3 { margin: 0; font-size: 14px; color: #fff; }
.cp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: 11.5px;
    color: rgba(255, 255, 255, .7);
}
.cp-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.cp-ready .cp-status { background: rgba(31, 138, 76, .22); color: #a7e3bf; }
.cp-ready .cp-status::before { background: #4ade80; }

.cp-channel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--ink-2);
}
.cp-channel b { color: #fff; font-size: 13.5px; font-weight: 600; }
.cp-channel .cp-sub { color: var(--signal); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cp-channel .cp-sub:empty { display: none; }

.cp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 8px 0 0;
    border-radius: 8px;
    background: var(--ink-2);
}
.cp-stat { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; min-width: 0; }
.cp-stat + .cp-stat { border-left: 1px solid rgba(255, 255, 255, .08); }
.cp-stat b { color: #fff; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-stat:last-child b { font-size: 12.5px; padding-top: 2px; }

.cp-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin: 14px 0 12px;
}
.cp-total b {
    color: var(--signal);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}
.cp-send.button, input.cp-send {
    width: 100%;
    height: 42px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    background: var(--signal);
    border-color: var(--signal);
}
.cp-send.button:hover, input.cp-send:hover { color: var(--ink); background: #f7bd5e; border-color: #f7bd5e; }
.composer:not(.cp-ready) .cp-send { background: rgba(255, 255, 255, .12); border-color: transparent; color: rgba(255, 255, 255, .75); }

/* Thẻ phần riêng của trang (vd. "Chèn form phản hồi"): làm gọn bố cục cũ bên trong */
.cp-extra .cp-card-body > .controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 !important; }
.cp-extra .cp-card-body > .controls > [class*="span"] { float: none; padding: 0; width: auto; }
.cp-extra .cp-card-body > .controls > .span6 { flex: 2 1 440px; }
.cp-extra .cp-card-body > .controls > .span2 { flex: 0 0 180px; }
.cp-extra .cp-card-body > .controls > .span4 { flex: 1 1 200px; font-size: 12.5px; color: var(--muted); }
.cp-extra .control-group {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px !important;
    padding: 0 !important;
    background: transparent !important;
    float: none;
    width: auto;
}
.cp-extra .control-group > [class*="span"], .cp-extra .control-group > div > [class*="span"] { float: none; width: auto; padding: 0; }
.cp-extra .control-group > div:not([class]), .cp-extra .control-group > div[class=""] { display: contents; }
.cp-extra .control-group .control-label[style] {
    color: var(--text) !important;
    text-align: left !important;
    font-size: 12.5px;
    font-weight: 500;
    padding: 0;
    margin: 0;
}
.cp-extra .control-group .span3:last-child { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cp-extra .control-group .span3:last-child label { margin: 0; font-size: 12.5px; }
.cp-extra .control-group .button { height: var(--ctl-h); }
.cp-extra .block[style*="phone.jpg"] { background-size: cover; border-radius: 10px; }
.cp-extra .block label { font-size: 12.5px; }

/* ---- Trang gửi tin: bản gọn ---------------------------------------------- */
.composer { gap: 10px; }
.composer-main { gap: 8px; }
.cp-card-head { padding: 7px 12px; min-height: 40px; }
.cp-card-body { padding: 10px 12px; }
.cp-row-top { gap: 8px; }
.cp-row-top .cp-sender { flex: 1 1 170px; }
.cp-row-top .cp-grow { flex: 2 1 240px; }
.cp-row-top .cp-narrow { flex: 0 1 130px; }
.cp-row-top + .cp-field { margin-top: 8px; }
.cp-message textarea { min-height: 84px; }
.cp-head-actions .cp-add { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.cp-head-actions .cp-add-btn.button { height: 26px; padding: 0 9px; font-size: 12px; }
.cp-empty { padding: 8px 12px; }
.cp-table-wrap { max-height: 280px; }

/* Kênh gửi gọn hơn */
#tabss.cp-channels { margin: 0 0 10px; }
#tabss.cp-channels > ul > li > a { padding: 7px 12px; gap: 10px; }
#tabss.cp-channels > ul > li > a > i { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.cp-ch-title { font-size: 13px; }
.cp-ch-sub { font-size: 11px; }

/* Thời gian gửi nằm trong khối tóm tắt nền tối */
.cp-schedule { margin-top: 8px; padding: 8px; border-radius: 8px; background: var(--ink-2); }
.cp-schedule .cp-seg { display: flex; width: 100%; background: rgba(0, 0, 0, .18); border-color: transparent; }
.cp-schedule .cp-seg-item { flex: 1; justify-content: center; color: rgba(255, 255, 255, .65); }
.cp-schedule .cp-seg-item:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: none; }
.cp-schedule .cp-when { display: grid; grid-template-columns: 1fr 64px 64px; gap: 6px; margin-top: 8px; max-width: none; }
.composer:not(.cp-later) .cp-schedule .cp-when { display: none; }
.cp-schedule .cp-label { color: rgba(255, 255, 255, .55); font-size: 11px; }
.cp-schedule .cp-field { flex: none; }
.cp-schedule :where(input, select) { height: 30px; font-size: 12.5px; }
.cp-schedule select[style*="width"], .cp-schedule select { width: 100% !important; margin: 0 !important; padding-right: 20px; background-position: right 6px center; }
.cp-schedule input.hasDatepicker { width: 100% !important; margin: 0 !important; }
.cp-summary { padding: 12px; }
.cp-sum-head { margin-bottom: 10px; }
.cp-total { margin: 12px 0 10px; }
.cp-total b { font-size: 30px; }

/* ---- Hộp thoại (popup) chuẩn hoá bởi app.js -------------------------------- */
.modal-header { flex-wrap: wrap; row-gap: 4px; }
.modal-header .modal-title { order: 0; }
.modal-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.modal-header .modal-sub { font-size: 12px; color: var(--muted); }
.modal-header .button { order: 1; height: 28px; padding: 0 10px; font-size: 12.5px; margin: 0 0 0 8px !important; }
.modal-header .close { order: 3; }
.modal-pad { padding: 14px 16px; margin: 0; }
.modal-pad.form-horizontal .control-group, .modal-pad .control-group { display: block; margin: 0 0 10px; float: none; width: auto; }
.modal-pad .controls, .modal-body .controls { margin: 0 !important; }
.modal pre {
    margin: 10px 0 6px;
    padding: 8px 10px;
    font-family: inherit !important;
    font-size: 12.5px !important;
    line-height: 1.6;
    white-space: pre-line;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.modal pre b { color: var(--text); }
.modal .help-block a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.modal .help-block a::before { content: "\f019"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; }
.modal-footer { align-items: center; }
.modal-footer > .button, .modal-footer > input[type="submit"] { order: 2; }
.modal-footer > .btn { order: 1; }
.modal .mu-dropzone { padding: 16px 12px; }
.modal-body .table { margin: 0; }
.modal-body .table td .button { height: 26px !important; padding: 0 10px !important; font-size: 12px !important; }
.modal-body .dataTables_wrapper .dataTables_filter input { width: 160px; }

/* Dòng "Lưu ý" dưới ô nội dung (giữ nguyên chữ và màu đỏ nhấn như trang cũ) */
.cp-notes { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.cp-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text); }
.cp-note b { font-weight: 600; }

/* Nút xoá dữ liệu upload (trang kết quả upload) */
.cp-del-upload {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 9px;
    font: inherit; font-size: 12px; font-weight: 500;
    color: var(--danger); background: var(--surface);
    border: 1px solid #e7b8ae; border-radius: 6px; cursor: pointer;
}
.cp-del-upload:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

/* Link tải file mẫu trong popup upload: .xlsx / .xls / .csv */
.sample-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sample-links a {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 9px;
    border: 1px solid var(--border-strong); border-radius: 6px;
    background: var(--surface); color: var(--text); font-weight: 500;
}
.sample-links a:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); text-decoration: none; }

/* Hộp xác nhận gửi */
/* Hộp thoại mở bằng $(...).show() thay vì .modal(): tự phủ nền tối */
.modal:not(.in):not([style*="display: none"]):not([style*="display:none"]) {
    opacity: 1;
    transform: translate(-50%, 0);
    box-shadow: var(--shadow-pop), 0 0 0 100vmax rgba(15, 43, 46, .5);
}
.cp-confirm { width: min(440px, calc(100% - 32px)) !important; top: 12vh !important; }
.cp-confirm .modal-body { padding: 12px 16px; }
.cp-confirm .control-group { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--border); }
.cp-confirm .control-group:last-child { border-bottom: 0; }
.cp-confirm .control-group > label.control-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
}
.cp-confirm .control-group > label b { color: var(--text); font-size: 14px; font-weight: 600; text-align: right; }
.cp-confirm #Noidung_xacnhan {
    display: block;
    max-width: 70%;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    white-space: pre-wrap;
}
.cp-confirm .control-group:has(#dausocodinh_xacnhan) { display: flex; gap: 6px; font-size: 13px; }
.cp-confirm .modal-footer .button { height: 32px; }

/* 18. Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
    .form-horizontal .control-label { flex-basis: 110px; }
    .form-horizontal .control-group > .controls:only-child { margin-left: 122px !important; }
}

@media (max-width: 1100px) {
    .composer { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 991px) {
    .composer { grid-template-columns: 1fr; }
    .composer-side { position: static; }
    .nav-toggle { display: grid; place-items: center; order: -1; margin: 0 0 0 8px; }
    #top { padding-right: 12px; }
    #top .brand { width: auto; background: transparent; color: var(--text); padding: 0 4px; }
    #top .brand small { color: var(--muted); }
    .topbar-title { display: none; }

    #navigation {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: none;
    }
    body.nav-open #navigation { transform: none; box-shadow: var(--shadow-pop); }
    body.nav-open .nav-backdrop {
        display: block;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        z-index: 985;
        background: rgba(15, 43, 46, .45);
    }

    #content { margin-left: 0; }
    #content { padding: 12px 12px 24px; }
}

@media (max-width: 767px) {
    .filter-field { flex: 1 1 100%; max-width: none; }
    .form-inline-bar .controls > :where(input, select) { max-width: none; }
    .filter-actions { margin-left: 0; }
    [class*="span"] { float: none; width: 100%; padding: 0; }
    .row-fluid, .row { margin: 0; }
    .controls [class*="span"] + [class*="span"] { padding-left: 0; margin-top: 8px; }

    .form-horizontal .control-group { display: block; }
    .form-horizontal .control-label { padding-top: 0; margin-bottom: 3px; }
    .form-horizontal .control-group > .controls:only-child { margin-left: 0 !important; }

    .page-header h1, .page-header h4 { font-size: 16px; }
    .bread { display: none; }
    .box-body, .box-body.box-body-nopadding { padding: 10px; }
    .box-head { padding: 8px 10px; }

    .topbar-link .label-text { display: none; }

    .dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { float: none; }
    .dataTables_filter input { width: 100%; margin: 6px 0 0; }
    .dataTables_paginate { flex-wrap: wrap; }

    .modal { top: 12px; max-height: calc(100vh - 24px); }

    /* trang đăng nhập trên điện thoại: giữ giới thiệu OneSMS gọn, form lên trên */
    .auth-product h1 { font-size: 19px; }
    .thread li:not(.me) { display: none; }
    .auth-panel { align-items: stretch; }
    .auth-product, .auth-card { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .thread li { opacity: 1; transform: none; }
}

@media print {
    #top, #navigation, .support-dock, .app-footer, .cnx-band { display: none !important; }
    #main { padding: 0; }
    #content { margin: 0; padding: 0; }
}

/* 19. Đăng ký template (/dang-ky-template, js/template-builder.js) ---------- */
.tb [hidden], .tb-history [hidden] { display: none !important; }
.tb {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 336px;
    gap: 14px;
    align-items: start;
    margin: 0 0 14px;
}
.tb-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tb-flash { white-space: pre-line; }

/* Chọn kênh */
.tb-channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tb-channel {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; text-align: left;
    font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.tb-channel:hover { border-color: var(--border-strong); }
.tb-channel > i {
    flex: 0 0 34px; height: 34px; display: grid; place-items: center;
    font-size: 15px; color: var(--muted); background: var(--surface-2); border-radius: 9px;
}
.tb-channel b { display: block; font-size: 13px; font-weight: 600; }
.tb-channel small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.tb-channel.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--primary-soft); }
.tb-channel.is-active > i { color: #fff; background: var(--primary); }
.tb-channel[data-channel="ZALO"].is-active { border-color: #0068ff; box-shadow: 0 0 0 1px #0068ff inset; background: #eaf2ff; }
.tb-channel[data-channel="ZALO"].is-active > i { background: #0068ff; }

/* Thẻ */
.tb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.tb-card-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-size: 13px; font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.tb-step {
    width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 50%;
}
.tb-head-right { margin-left: auto; font-weight: 500; }
.tb-muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.tb-card-body { padding: 10px 12px 12px; }
.tb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-span2 { grid-column: 1 / -1; }
.tb-field { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; }
.tb-field input, .tb-field select { width: 100% !important; max-width: none; margin: 0; }
.tb-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.tb-label em { color: var(--danger); font-style: normal; }
.tb-label small { font-weight: 400; color: var(--muted); opacity: .85; }
.tb-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tb-label-row > span { flex: 1; }
.tb-hint {
    margin: 0; padding: 7px 10px; font-size: 12px; line-height: 1.5; color: var(--ink-2);
    background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md);
}
.tb-hint:empty { display: none; }
.tb code, .tb-history code { font-size: 11.5px; padding: 0 4px; background: var(--primary-soft); color: var(--primary-strong); border-radius: 4px; }

.tb-textarea {
    display: block; width: 100% !important; max-width: none; min-height: 0; margin: 0;
    padding: 8px 10px; font: inherit; font-size: 13.5px; line-height: 1.55; resize: vertical;
}
#smsText { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }

/* Thanh chèn biến */
.tb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 7px; }
.tb-toolbar-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.tb-chip {
    display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
    font: inherit; font-size: 12px; font-weight: 500; color: var(--primary-strong);
    background: var(--primary-soft); border: 1px solid #b9dcd8; border-radius: 999px; cursor: pointer;
}
.tb-chip i { font-size: 10.5px; }
.tb-chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tb-enc { padding: 2px 8px; font-size: 11.5px; font-weight: 600; color: var(--success); background: var(--success-soft); border-radius: 999px; }
.tb-enc.is-uni { color: var(--warning); background: var(--warning-soft); }

.tb-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.tb-meter b { color: var(--text); font-variant-numeric: tabular-nums; }
.tb-meter-bar { flex: 1 1 80px; max-width: 160px; height: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.tb-meter-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.tb-meter-bar i.is-near { background: var(--signal); }
.tb-meter-bar i.is-over { background: var(--danger); }
.tb-meter-limit { margin-left: auto; font-size: 11.5px; }
.tb-link {
    display: inline-flex; align-items: center; gap: 5px; padding: 0; height: auto;
    font: inherit; font-size: 12px; font-weight: 600; color: var(--primary); background: none; border: 0; cursor: pointer;
}
.tb-link:hover { color: var(--primary-strong); text-decoration: underline; }

/* Nhóm nút chuyển (segmented) */
.tb-seg { display: inline-flex; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.tb-seg button {
    height: 24px; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 500;
    color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer;
}
.tb-seg button.is-active { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 43, 46, .14); font-weight: 600; }
.tb-seg-sm button { height: 22px; padding: 0 8px; font-size: 11.5px; }

/* Soạn Zalo */
.tb-zalo { display: flex; flex-direction: column; gap: 12px; }
.tb-list { display: flex; flex-direction: column; gap: 6px; }
.tb-list:empty { display: none; }
.tb-item { position: relative; }
.tb-item-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.tb-item-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 30px; gap: 6px; }
.tb-item-btn { display: grid; grid-template-columns: 130px minmax(0, 2fr) minmax(0, 3fr) 30px; gap: 6px; }
.tb-item-row input, .tb-item-btn input, .tb-item-btn select { width: 100% !important; max-width: none; margin: 0; }
.tb-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-count.is-bad { color: var(--danger); font-weight: 600; }
.tb-icon-btn {
    width: 30px; height: var(--ctl-h); display: inline-grid; place-items: center; padding: 0;
    color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--r-md); cursor: pointer;
}
.tb-item-meta .tb-icon-btn { height: 22px; width: 24px; }
.tb-icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* Biến */
.tb-param-add {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center;
    padding: 8px; margin-bottom: 10px; background: #eaf2ff; border: 1px solid #c8dafc; border-radius: var(--r-md);
}
.tb-param-add input, .tb-param-add select { width: 100% !important; max-width: none; margin: 0; }
.tb-param-add .tb-token { cursor: default; }
.tb-vars { display: flex; flex-direction: column; gap: 5px; }
.tb-var { display: grid; grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 30px; gap: 6px; align-items: center; }
.tb-var input, .tb-var select { width: 100% !important; max-width: none; margin: 0; }
.tb-var-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tb-var-head span:last-child { grid-column: 4 / 6; }
.tb-var.is-unused { opacity: .55; }
.tb-var-sample { position: relative; display: block; }
.tb-var-sample input { padding-right: 46px; }
.tb-var-len { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); pointer-events: none; }
.tb-var-len.is-bad { color: var(--danger); font-weight: 600; }
.tb-token {
    display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 0; height: 26px; padding: 0 8px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600;
    color: var(--primary-strong); background: var(--primary-soft); border: 1px solid #b9dcd8; border-radius: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.tb-token:disabled { cursor: default; opacity: 1; }
.tb-token sub { font-size: 9.5px; color: var(--muted); }
.tb-token.is-bad { color: var(--danger); background: var(--danger-soft); border-color: #f0c5bc; }
button.tb-token:not(:disabled):hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.tb-empty { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Cột xem trước */
.tb-side {
    position: sticky; top: calc(var(--topbar-h) + 12px);
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.tb-preview-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; }
.tb-preview-head i { color: var(--primary); }
.tb-phone {
    width: 270px; margin: 0 auto; padding: 7px;
    background: #0f1716; border-radius: 34px;
    box-shadow: 0 0 0 1px #2a3534 inset, 0 14px 30px -14px rgba(15, 43, 46, .5);
}
.tb-phone-screen {
    display: flex; flex-direction: column; height: 470px; overflow: hidden;
    border-radius: 28px; background: #fff; font-size: 12.5px; line-height: 1.45;
}
.pv-status { display: flex; justify-content: space-between; padding: 8px 18px 4px; font-size: 11px; font-weight: 600; }
.pv-status i { margin-left: 4px; font-size: 10px; }
.pv-day { margin: 8px 0; text-align: center; font-size: 10.5px; color: #8a9593; }
.pv-placeholder { color: #9aa4a2; font-style: italic; }
mark.pv-var { padding: 0 2px; color: inherit; background: rgba(242, 169, 59, .28); border-radius: 3px; box-shadow: 0 -1px 0 rgba(242, 169, 59, .7) inset; }
mark.pv-var-raw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: rgba(11, 122, 117, .14); box-shadow: none; color: var(--primary-strong); }
mark.pv-var sub { font-size: 8px; }

/* SMS */
.pv-sms { background: #fff; }
.pv-sms-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px; border-bottom: 1px solid #eef1f0; }
.pv-sms-head > i { color: #0a84ff; font-size: 13px; }
.pv-sms-head b { display: block; font-size: 13px; line-height: 1.2; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sms-head small { display: block; font-size: 10px; color: #8a9593; }
.pv-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; font-weight: 700; color: #fff; background: linear-gradient(160deg, #9aa5a3, #6e7a78); border-radius: 50%; }
.pv-sms-body { flex: 1; overflow-y: auto; padding: 0 12px 10px; }
.pv-bubble {
    max-width: 88%; padding: 8px 11px; color: #111; background: #e9e9eb;
    border-radius: 16px 16px 16px 5px; word-wrap: break-word; overflow-wrap: anywhere;
}
.pv-sms-input { display: flex; align-items: center; gap: 8px; margin: 6px 10px 12px; padding: 6px 6px 6px 12px; color: #9aa4a2; border: 1px solid #e1e5e4; border-radius: 999px; font-size: 11.5px; }
.pv-sms-input span { flex: 1; }
.pv-sms-input i { color: #c7cdcc; font-size: 18px; }

/* Zalo */
.pv-zalo { background: #e2e9f1; }
.pv-zalo .pv-status { background: #0068ff; color: #fff; }
.pv-zalo-head { display: flex; align-items: center; gap: 8px; padding: 4px 12px 9px; color: #fff; background: #0068ff; }
.pv-zalo-head b { display: block; font-size: 13px; line-height: 1.2; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-zalo-head b i { font-size: 10px; color: #ffd24d; }
.pv-zalo-head small { display: block; font-size: 10px; opacity: .85; }
.pv-oa-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; font-weight: 700; color: #0068ff; background: #fff; border-radius: 50%; }
.pv-zalo-body { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
.pv-zcard { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); word-wrap: break-word; overflow-wrap: anywhere; }
.pv-zlogo { display: flex; align-items: center; height: 48px; padding: 8px 12px; border-bottom: 1px solid #eef1f4; }
.pv-zlogo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.pv-zlogo-empty span { font-weight: 800; font-size: 13px; letter-spacing: .02em; color: #0068ff; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-ztitle { padding: 10px 12px 2px; font-size: 13.5px; font-weight: 700; line-height: 1.35; color: #111; }
.pv-zp { padding: 6px 12px 0; color: #222; }
.pv-ztable { margin: 8px 12px 0; border-top: 1px solid #eef1f4; }
.pv-ztable > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #eef1f4; font-size: 11.5px; }
.pv-ztable span { color: #7a8794; flex: 0 0 auto; max-width: 45%; }
.pv-ztable b { font-weight: 600; text-align: right; color: #111; }
.pv-zotp { margin: 10px 12px 0; padding: 8px; text-align: center; background: #f2f6fc; border-radius: 8px; }
.pv-zotp small { display: block; font-size: 10.5px; color: #7a8794; }
.pv-zotp b { font-size: 22px; letter-spacing: .18em; color: #0068ff; font-variant-numeric: tabular-nums; }
.pv-zbtns { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.pv-zbtn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; font-size: 12px; font-weight: 600; color: #0068ff; background: #eaf2ff; border-radius: 8px; }
.pv-zbtn.is-primary { color: #fff; background: #0068ff; }
.pv-zbtn i { font-size: 10px; }
.pv-zcard > .pv-zp:last-child, .pv-zcard > .pv-ztable:last-child { padding-bottom: 12px; }
.pv-zalo-input { display: flex; align-items: center; gap: 10px; padding: 9px 14px 14px; color: #8a96a3; background: #fff; font-size: 12px; }
.pv-zalo-input span { flex: 1; }

.tb-pv-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.tb-pv-meta b { color: var(--text); }

/* Danh sách kiểm tra */
.tb-checks { border-top: 1px solid var(--border); padding-top: 9px; }
.tb-checks-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
.tb-checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; }
.tb-chk { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; line-height: 1.45; }
.tb-chk i { margin-top: 2px; font-size: 12px; flex: 0 0 auto; }
.tb-chk-ok i { color: var(--success); }
.tb-chk-warn i { color: #d48a12; }
.tb-chk-err i { color: var(--danger); }
.tb-chk-err span { color: #7d2a1c; }
.tb-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; font-size: 11px; font-weight: 600; border-radius: 999px; }
.tb-badge-err { color: var(--danger); background: var(--danger-soft); }
.tb-badge-warn { color: var(--warning); background: var(--warning-soft); }
.tb-badge-ok { color: var(--success); background: var(--success-soft); }
.tb-submit { width: 100%; height: 38px; font-size: 13.5px; }
.tb-submit:disabled { opacity: .45; cursor: not-allowed; }
.tb-submit-note { margin: -4px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

/* Lịch sử */
.tb-history .box-body { padding: 0; }
.tb-history .tb-empty { padding: 14px; }
.tb-table { margin: 0; }
.tb-nowrap { white-space: nowrap !important; }
.tb-inline { display: inline-flex; }
.tb-actions { white-space: nowrap !important; text-align: right; }
.tb-kenh { display: inline-block; padding: 1px 7px; font-size: 11px; font-weight: 600; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); }
.tb-kenh-zalo { color: #0050c8; background: #eaf2ff; }
.tb-kenh-brandname { color: var(--primary-strong); background: var(--primary-soft); }
.tb-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.tb-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tb-status-wait { color: var(--info); }
.tb-status-ok { color: var(--success); }
.tb-status-err { color: var(--danger); }
.tb-status-off { color: var(--muted); }
.tb-reason { margin-top: 2px; font-size: 11.5px; color: var(--danger); }

@media (max-width: 1180px) {
    .tb { grid-template-columns: minmax(0, 1fr) 300px; }
    .tb-phone { width: 250px; }
    .tb-var { grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1.2fr) 30px; }
    .tb-var > input[type="text"]:nth-child(2) { display: none; }
    .tb-var-head span:nth-child(2) { display: none; }
    .tb-var-head span:last-child { grid-column: 3 / 5; }
}
@media (max-width: 900px) {
    .tb { grid-template-columns: minmax(0, 1fr); }
    .tb-side { position: static; }
    .tb-channels { grid-template-columns: minmax(0, 1fr); }
    .tb-channel small { display: none; }
}
@media (max-width: 600px) {
    .tb-grid { grid-template-columns: minmax(0, 1fr); }
    .tb-param-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .tb-item-btn { grid-template-columns: minmax(0, 1fr) 30px; }
    .tb-item-btn select, .tb-item-btn input { grid-column: 1 / 2; }
    .tb-item-btn .tb-icon-btn { grid-column: 2; grid-row: 1; }
    .tb-var { grid-template-columns: 84px minmax(0, 1fr) 30px; }
    .tb-var > select { grid-column: 2 / 4; }
    .tb-var-sample { grid-column: 2 / 4; }
    .tb-var-head { display: none; }
    .tb-meter-limit { margin-left: 0; width: 100%; }
}

/* 20. Trang Template (esms/template.jsp) ------------------------------------- */
.tpl-box .box-head { display: flex; align-items: center; gap: 8px; }
.tpl-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.tpl-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; margin: 0; }
.tpl-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tpl-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.tpl-field input, .tpl-field textarea { width: 100% !important; max-width: none; margin: 0; }
.tpl-field textarea { min-height: 96px; padding: 8px 10px; line-height: 1.55; resize: vertical; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.tpl-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.tpl-label em { font-style: normal; color: var(--danger); }
.tpl-red { color: var(--danger) !important; }
.tpl-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: -2px; font-size: 12px; color: var(--muted); }
.tpl-meter b { color: var(--text); font-variant-numeric: tabular-nums; }
.tpl-enc { padding: 2px 8px; font-size: 11.5px; font-weight: 600; color: var(--success); background: var(--success-soft); border-radius: 999px; }
.tpl-enc.is-uni { color: var(--warning); background: var(--warning-soft); }
.tpl-bar { flex: 1 1 80px; max-width: 160px; height: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.tpl-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.tpl-bar i.is-near { background: var(--signal); }
.tpl-bar i.is-over { background: var(--danger); }
.tpl-limit { margin-left: auto; }
.tpl-error { padding: 6px 10px; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border-radius: var(--r-md); }
.tpl-error[hidden] { display: none; }
.tpl-actions { display: flex; gap: 6px; }
.tpl-guide { padding: 10px 12px; font-size: 12.5px; line-height: 1.5; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.tpl-guide p { margin: 0 0 8px; color: var(--muted); }
.tpl-guide-title { margin-bottom: 8px; font-weight: 600; color: var(--text); }
.tpl-guide-title i { color: var(--signal); }
.tpl-sample { display: inline-block; margin-top: 2px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.tpl-guide-note { margin-bottom: 0 !important; padding-top: 8px; border-top: 1px solid var(--border); }
.tpl-table { margin: 0; }
.tpl-table td { vertical-align: top; }
.tpl-name { font-weight: 600; min-width: 120px; }
.tpl-content { min-width: 260px; word-break: break-word; }
.tpl-var { color: var(--danger); font-weight: 600; }
.tpl-nowrap { white-space: nowrap !important; }
.tpl-type { padding: 1px 7px; font-size: 11.5px; font-weight: 600; color: var(--success); background: var(--success-soft); border-radius: var(--r-sm); }
.tpl-type.is-uni { color: var(--warning); background: var(--warning-soft); }
.tpl-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; text-decoration: none !important; }
.tpl-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tpl-status.is-on { color: var(--success); }
.tpl-status.is-off { color: var(--muted); }
.tpl-status:hover { text-decoration: underline !important; }
.tpl-row-actions { text-align: right; }
.tpl-row-actions form { display: inline-flex; margin: 0; }
.tpl-empty { padding: 18px !important; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
    .tpl-form { grid-template-columns: minmax(0, 1fr); }
    .tpl-limit { margin-left: 0; width: 100%; }
}

/* 21. Lọc số điện thoại (esms/phone_format.jsp) ----------------------------- */
.pf-box .box-head { display: flex; align-items: center; gap: 8px; }
.pf-order { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-muted { color: var(--muted); font-size: 12px; }
.pf-sub { margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.pf-sub i { color: var(--primary); }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pf-stat {
    position: relative; padding: 10px 12px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
    border-top: 3px solid var(--border-strong);
}
.pf-stat span { display: block; font-size: 12px; color: var(--muted); }
.pf-stat b { display: block; margin-top: 2px; font-size: 22px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-stat small { position: absolute; right: 12px; bottom: 12px; font-size: 12px; font-weight: 600; color: var(--success); }
.pf-stat.is-ok { border-top-color: var(--success); }
.pf-stat.is-ok b { color: var(--success); }
.pf-stat.is-dup { border-top-color: var(--signal); }
.pf-stat.is-bad { border-top-color: var(--danger); }
.pf-stat.is-bad b { color: var(--danger); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pf-net { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 12.5px; }
.pf-net-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-net-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.pf-net-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.pf-net-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-net-val b { color: var(--text); }
.pf-download { padding-left: 16px; border-left: 1px solid var(--border); }
.pf-download .pf-muted { margin: 0 0 10px; }
.pf-dl-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-sub-table { margin-top: 16px; }
.pf-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.pf-table { margin: 0; }
.pf-table thead th { position: sticky; top: 0; z-index: 1; }
.pf-phone { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
.pf-badge { display: inline-block; padding: 1px 8px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
.pf-badge.is-ok { color: var(--success); background: var(--success-soft); }
.pf-badge.is-dup { color: var(--warning); background: var(--warning-soft); }
.pf-badge.is-bad { color: var(--danger); background: var(--danger-soft); }
.pf-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; margin: 0; }
.pf-upload { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-error { padding: 6px 10px; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border-radius: var(--r-md); }
.pf-error[hidden], .pf-actions [hidden] { display: none; }
.pf-guide { padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.pf-guide ul { margin: 0 0 10px 16px; padding: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.pf-guide li { margin-bottom: 3px; }
.pf-guide code { font-size: 11.5px; padding: 0 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); }
@media (max-width: 900px) {
    .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-grid, .pf-form { grid-template-columns: minmax(0, 1fr); }
    .pf-download { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--border); }
    .pf-net { grid-template-columns: 90px minmax(0, 1fr) 90px; }
}

/* 22. Bảng mã lỗi (maloi/chitiet.jsp) --------------------------------------- */
.ml-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ml-intro { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ml-intro-icon { flex: 0 0 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; font-size: 15px; }
.ml-intro b { display: block; font-size: 14px; }
.ml-intro p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.ml-search { position: relative; flex: 0 0 320px; margin: 0; }
.ml-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.ml-search input { width: 100% !important; max-width: none; margin: 0; padding-left: 32px !important; }
.ml-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ml-tab {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; margin-bottom: -1px;
    font: inherit; font-size: 13px; font-weight: 500; color: var(--muted);
    background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
}
.ml-tab i { font-size: 11.5px; }
.ml-tab:hover { color: var(--text); }
.ml-tab.is-active { color: var(--primary-strong); font-weight: 600; border-bottom-color: var(--primary); }
.ml-tab-count { min-width: 22px; padding: 0 6px; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-variant-numeric: tabular-nums; }
.ml-tab.is-active .ml-tab-count { color: #fff; background: var(--primary); border-color: var(--primary); }
.ml-pane[hidden], .ml-table tr[hidden] { display: none !important; }
.ml-table { margin: 0; border: 0 !important; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ml-table td { vertical-align: middle; }
.ml-col-code { width: 120px; }
.ml-code {
    position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 24px; padding: 0 9px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600;
    color: var(--danger); background: var(--danger-soft); border: 1px solid #f3cfc7; border-radius: 6px; cursor: copy;
}
.ml-code:hover { border-color: var(--danger); }
.ml-code.is-copied { color: var(--success); background: var(--success-soft); border-color: var(--success); }
.ml-code.is-copied::after {
    content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; padding: 1px 6px; z-index: 2;
    font-family: inherit; font-size: 11px; font-weight: 500; color: #fff; background: var(--ink); border-radius: 4px; white-space: nowrap;
}
.ml-desc { font-size: 13px; line-height: 1.5; }
.ml-empty td, .ml-none td { padding: 22px !important; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
    .ml-top { flex-direction: column; align-items: stretch; }
    .ml-search { flex-basis: auto; }
    .ml-col-code { width: 92px; }
}

/* 23. Cập nhật tài khoản (update_user.jsp) ---------------------------------- */
.uu-profile {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.uu-avatar { flex: 0 0 48px; height: 48px; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 50%; }
.uu-who b { display: block; font-size: 16px; }
.uu-type { display: inline-block; margin-top: 3px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
.uu-type.is-pre { color: var(--warning); background: var(--warning-soft); }
.uu-type.is-post { color: var(--success); background: var(--success-soft); }
.uu-balances { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.uu-balance { min-width: 150px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.uu-balance span { display: block; font-size: 11.5px; color: var(--muted); }
.uu-balance span i { color: var(--primary); margin-right: 3px; }
.uu-balance b { font-size: 17px; font-variant-numeric: tabular-nums; }
.uu-balance small { margin-left: 4px; font-size: 11.5px; color: var(--muted); }

.uu-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin: 0 0 12px; }
.uu-card { margin: 0 !important; }
.uu-card .box-head, .uu-history .box-head { display: flex; align-items: center; gap: 8px; }
.uu-optional { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.uu-card .box-body { display: flex; flex-direction: column; gap: 12px; }
.uu-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.uu-field input { width: 100% !important; max-width: none; margin: 0; }
.uu-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.uu-help { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.uu-help i { color: #d48a12; }
.uu-readonly { background: var(--surface-2) !important; color: var(--ink-2) !important; }
.uu-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px !important; }
.uu-secret { display: flex; gap: 6px; }
.uu-secret input { flex: 1; min-width: 0; }
.uu-secret .button { flex: 0 0 auto; width: var(--ctl-h); padding: 0; justify-content: center; }
.uu-sep { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text); }
.uu-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.uu-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uu-strength { display: flex; align-items: center; gap: 8px; margin-top: -4px; font-size: 11.5px; color: var(--muted); }
.uu-strength[hidden] { display: none; }
.uu-strength i { position: relative; flex: 0 0 120px; height: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.uu-strength i::after { content: ""; position: absolute; inset: 0; width: 8%; background: var(--danger); border-radius: 99px; }
.uu-strength.is-1 i::after { width: 34%; background: var(--danger); }
.uu-strength.is-2 i::after { width: 67%; background: var(--signal); }
.uu-strength.is-3 i::after { width: 100%; background: var(--success); }
.uu-choice { display: grid; gap: 6px; }
.uu-option {
    display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 12px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
}
.uu-option input { width: auto !important; height: auto !important; margin: 3px 0 0 !important; flex: 0 0 auto; }
.uu-option > span { flex: 1; min-width: 0; }
.uu-option b { display: block; font-size: 13px; font-weight: 600; }
.uu-option b i { color: var(--primary); width: 16px; }
.uu-option small { display: block; font-size: 11.5px; color: var(--muted); }
.uu-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.uu-steps { margin: 0 0 0 18px; padding: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.uu-card .box-body > .button { align-self: flex-start; }
.uu-actions {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.uu-error { margin-right: auto; padding: 5px 10px; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border-radius: var(--r-md); }
.uu-error[hidden] { display: none; }
.uu-table { margin: 0; }
.uu-nowrap { white-space: nowrap !important; }
.uu-ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap !important; color: var(--muted); font-size: 12px; }
.uu-empty { padding: 18px !important; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
    .uu-form { grid-template-columns: minmax(0, 1fr); }
    .uu-balances { margin-left: 0; width: 100%; }
    .uu-balance { flex: 1; min-width: 0; }
}
@media (max-width: 600px) {
    .uu-row2 { grid-template-columns: minmax(0, 1fr); }
}
.ml-row.is-hit td { background: var(--warning-soft) !important; }

/* 24. Báo cáo (js/report.js, includes/report_head.jsp) ---------------------- */
.rp-filter { padding: 10px 12px 12px; margin-bottom: 12px; }
.rp-filter .filter-bar { margin: 0; padding: 0; border: 0; background: none; }
.rp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.rp-presets-label { margin-right: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.rp-presets-label i { margin-right: 5px; }
.rp-chip {
    height: 26px; padding: 0 11px; font: inherit; font-size: 12px; font-weight: 500; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer;
}
.rp-chip:hover { border-color: var(--primary); color: var(--primary-strong); }
.rp-chip.is-active { color: #fff; background: var(--primary); border-color: var(--primary); }

.rp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rp-kpi {
    position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0;
    padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.rp-kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--border-strong); }
.rp-kpi.is-ok::before { background: var(--success); }
.rp-kpi.is-bad::before { background: var(--danger); }
.rp-kpi.is-wait::before { background: var(--signal); }
.rp-kpi-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-kpi-label i { margin-right: 6px; font-size: 11px; }
.rp-kpi.is-ok .rp-kpi-label i { color: var(--success); }
.rp-kpi.is-bad .rp-kpi-label i { color: var(--danger); }
.rp-kpi.is-wait .rp-kpi-label i { color: #d48a12; }
.rp-kpi-value { font-size: 22px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-kpi-foot { display: flex; align-items: center; gap: 8px; min-height: 18px; font-size: 12px; }
.rp-kpi-pct { font-weight: 600; color: var(--ink-2); }
.rp-delta { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
.rp-delta i { font-size: 9px; }
.rp-delta.is-good { color: var(--success); background: var(--success-soft); }
.rp-delta.is-worse { color: var(--danger); background: var(--danger-soft); }
.rp-delta.is-flat { color: var(--muted); background: var(--surface-2); }
.rp-compare-note { margin: 6px 2px 12px; font-size: 11.5px; color: var(--muted); }
.rp-compare-note i { margin-right: 4px; }

.rp-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.rp-insights .box, .rp-panel { margin: 0 !important; }
.rp-panel .box-head, .rp-table-box .box-head, .rp-chart-box .box-head { display: flex; align-items: center; gap: 8px; }
.rp-head-link { margin-left: auto; font-size: 12px; font-weight: 500; }
.rp-head-link i { font-size: 9px; }
.rp-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; gap: 8px; align-items: center; margin-bottom: 7px; font-size: 12.5px; }
.rp-bar:last-child { margin-bottom: 0; }
.rp-bar-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.rp-bar-track > i { position: relative; display: block; height: 100%; background: #f2c3b9; border-radius: 99px; overflow: hidden; }
.rp-bar-track > i > em { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); }
.rp-bar-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-bar-val small { color: var(--muted); font-size: 11px; }
.rp-err { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.rp-err:last-child { border-bottom: 0; }
.rp-err-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rp-muted { color: var(--muted); font-size: 12.5px; margin: 0; }
.rp-ok { color: var(--success); }

.rp-table-box .box-head { flex-wrap: wrap; }
.rp-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.rp-export { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.rp-export .button-small i { margin-right: 3px; }
.rp-dt-top, .rp-dt-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rp-dt-top { margin-bottom: 8px; }
.rp-dt-bottom { margin-top: 8px; }
.rp-dt-top label { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.rp-dt-top select { width: auto !important; height: 28px; margin: 0 !important; }
.rp-dt-top input[type=search] { width: 240px !important; height: 30px; margin: 0 !important; }
table.rp-dt { margin: 0 !important; border-collapse: collapse !important; }
table.rp-dt thead th { white-space: nowrap; }
.rp-nowrap { white-space: nowrap !important; }
.rp-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.rp-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
.rp-muted-cell { color: var(--muted); font-size: 12px; }
.rp-content { min-width: 220px; max-width: 420px; }
.rp-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.45; }
.rp-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.rp-tag { display: inline-block; padding: 0 5px; font-size: 10px; font-weight: 700; color: var(--info); background: rgba(46, 108, 168, .1); border-radius: 4px; vertical-align: 1px; }
.rp-badge { display: inline-block; padding: 1px 8px; font-size: 11.5px; font-weight: 600; border-radius: 999px; }
.rp-badge.is-ok { color: var(--success); background: var(--success-soft); }
.rp-badge.is-fail { color: var(--danger); background: var(--danger-soft); }
.rp-badge.is-wait { color: var(--warning); background: var(--warning-soft); }
.rp-code {
    display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; margin-left: 4px; padding: 0 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-weight: 600;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; text-decoration: none !important; cursor: help;
}
.rp-code.is-fail { color: var(--danger); border-color: #f3cfc7; background: #fff; }
a.rp-code:hover { border-color: currentColor; }

.rp-chart-box .box-body { padding-bottom: 6px; }
.rp-chart { width: 100%; min-height: 220px; }
.rp-chart svg { display: block; overflow: visible; }
.rp-chart .rp-grid { stroke: var(--border); stroke-width: 1; }
.rp-chart .rp-axis { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.rp-chart .rp-col { fill: var(--primary); transition: fill .15s; }
.rp-chart .rp-hit { fill: transparent; }
.rp-chart a:hover .rp-col, .rp-chart .rp-hit:hover + .rp-col { fill: var(--primary-strong); }
.rp-chart a { cursor: pointer; }
.rp-chart-empty { padding: 70px 0; text-align: center; }

@media (max-width: 1200px) {
    .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rp-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rp-insights { grid-template-columns: minmax(0, 1fr); }
    .rp-export { margin-left: 0; width: 100%; }
    .rp-dt-top input[type=search] { width: 100% !important; }
}
.rp-sep { margin: 0 8px; color: var(--border-strong); }
.rp-chart-box { margin-bottom: 12px; }
.rp-chart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: center; }
.rp-chart-stats { display: flex; flex-direction: column; gap: 10px; padding-left: 16px; border-left: 1px solid var(--border); }
.rp-chart-stats span { display: block; font-size: 11.5px; color: var(--muted); }
.rp-chart-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rp-chart-stats b small, .rp-chart-stats > div > small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.rp-share { min-width: 140px; }
.rp-share .rp-bar-track { display: inline-block; width: 90px; vertical-align: middle; margin-right: 8px; }
.rp-share small { color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-row-link { text-align: right; }
.rp-row-link a { font-size: 12px; font-weight: 600; }
.rp-row-link i { font-size: 10px; }
@media (max-width: 760px) {
    .rp-chart-wrap { grid-template-columns: minmax(0, 1fr); }
    .rp-chart-stats { flex-direction: row; justify-content: space-between; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}
.rp-funnel { margin-bottom: 12px; }
.rp-funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 130px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 12.5px; }
.rp-funnel-row:last-child { margin-bottom: 0; }
.rp-funnel-name { font-weight: 600; }
.rp-funnel-track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rp-funnel-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #3aa59e); border-radius: 4px; }
.rp-funnel-row:nth-child(4) .rp-funnel-track i { background: var(--signal); }
.rp-funnel-val { text-align: right; font-variant-numeric: tabular-nums; }
.rp-funnel-val small { color: var(--muted); }
.rp-fail-num { color: var(--danger); font-weight: 600; }
.rp-share b { font-variant-numeric: tabular-nums; margin-right: 3px; }
.rp-kpis.rp-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.rp-actions { white-space: nowrap; }
.rp-resched, .rp-inline { display: inline-flex; align-items: center; gap: 4px; margin: 0; vertical-align: middle; }
.rp-resched input.rp-date { width: 98px !important; height: 26px; margin: 0 !important; padding: 0 8px; font-size: 12px; }
.rp-resched select { width: 56px !important; height: 26px; margin: 0 !important; padding: 0 4px; font-size: 12px; }
.rp-resched span { color: var(--muted); }
.rp-inline { margin-left: 4px; }
.rp-row-link-a { font-size: 12px; font-weight: 600; }
.rp-row-link-a i { font-size: 10px; }
@media (max-width: 1200px) { .rp-kpis.rp-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-prev { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-kpi-foot { flex-wrap: wrap; }

/* Gửi tin: chưa chọn kiểu ký tự */
select.cp-need { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.cp-enc-msg { margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: var(--danger); }
.cp-enc-msg[hidden] { display: none; }
#kieukytu_xacnhan { color: var(--success); }
#kieukytu_xacnhan.is-uni { color: #c2410c; }
#kieukytu_xacnhan.is-none { color: var(--danger); }
