/* =====================================================================
   ADMIN TABS — Khung 9 tab cho Admin Panel (ĐÃ FIX MOBILE)
   ===================================================================== */

/* ============ TAB BAR ============ */
.admin-tabbar-wrap {
    position: sticky;
    top: 68px;
    z-index: 9;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Tạo hiệu ứng mờ 2 mép để gợi ý vuốt ngang */
    mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
}
.admin-tabbar-wrap::-webkit-scrollbar { display: none; }

.admin-tabbar {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    min-width: max-content;
    max-width: 100%;
}

.atab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    background: #f4f4f5;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.atab:hover { background: #fee2e2; color: #991b1b; }
.atab.active {
    background: #dc2626;
    color: #fff;
    border-color: #991b1b;
    box-shadow: 0 2px 8px rgba(220,38,38,0.35);
}
.atab-icon { font-size: 15px; line-height: 1; }
.atab-label { line-height: 1; }

/* ============ PANEL ============ */
.atab-panel { display: none; }
.atab-panel.active {
    display: block;
    animation: atabFadeIn 0.2s ease;
}
@keyframes atabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ LOADING ============ */
.atab-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
}
.atab-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e5e5;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: atabSpin 0.9s linear infinite;
    margin: 0 auto 16px;
}
@keyframes atabSpin { to { transform: rotate(360deg); } }

/* ============ BRAND PREVIEW ============ */
.brand-preview {
    background: #fafafa;
    border: 2px dashed #e5e5e5;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
}
.brand-preview-label {
    font-size: 11px;
    font-weight: 900;
    color: #999;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.brand-preview-logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #dc2626;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.5px;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #991b1b;
}
.brand-preview-logo img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   NQ EDITOR
   ===================================================================== */
.nq-sections { display: flex; flex-direction: column; gap: 12px; }
.nq-section {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
    overflow: hidden;
}
.nq-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: 0.15s;
    background: #fff;
}
.nq-section-head:hover { background: #fee2e2; }
.nq-section-icon {
    width: 38px; height: 38px;
    background: #111; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 14px;
    border-radius: 9px;
    flex-shrink: 0;
}
.nq-section-meta { flex: 1; min-width: 0; }
.nq-section-title { font-weight: 900; font-size: 14px; }
.nq-section-sub { font-size: 12px; color: #999; margin-top: 2px; }
.nq-section-chevron { font-size: 13px; color: #999; }
.nq-section-body {
    padding: 16px;
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}
.nq-section-fields {
    background: #fff;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    margin-bottom: 14px;
}
.nq-blocks { display: flex; flex-direction: column; gap: 10px; }
.nq-block {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    position: relative;
}
.nq-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.nq-block-type {
    font-size: 11px;
    font-weight: 900;
    color: #666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.nq-block-actions { display: flex; gap: 4px; }
.nq-mini {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: #f4f4f5;
    color: #666;
    font-size: 13px;
    font-weight: 900;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}
.nq-mini:hover { background: #111; color: #fff; }
.nq-mini.danger { background: #fee2e2; color: #dc2626; }
.nq-mini.danger:hover { background: #dc2626; color: #fff; }
.nq-mini:disabled { opacity: 0.3; cursor: not-allowed; }
.nq-list { display: flex; flex-direction: column; gap: 6px; }
.nq-list-item { display: flex; gap: 6px; align-items: center; }
.nq-list-item input { flex: 1; }
.nq-table-header {
    display: grid;
    grid-template-columns: 1fr 2fr 36px;
    gap: 6px;
    font-size: 11px;
    font-weight: 900;
    color: #999;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0 2px 6px;
}
.nq-table-rows { display: flex; flex-direction: column; gap: 6px; }
.nq-table-row {
    display: grid;
    grid-template-columns: 1fr 2fr 36px;
    gap: 6px;
    align-items: center;
}
.nq-add-block-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e5e5;
}
.nq-section-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e5e5;
    flex-wrap: wrap;
}
.btn-ghost-nq {
    padding: 8px 14px;
    border-radius: 6px;
    background: #f4f4f5;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-ghost-nq:hover { background: #111; color: #fff; }
.btn-ghost-nq:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-danger-nq {
    padding: 8px 14px;
    border-radius: 6px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
    margin-left: auto;
}
.btn-danger-nq:hover { background: #dc2626; color: #fff; }

/* =====================================================================
   QD EDITOR
   ===================================================================== */
.qd-categories { display: flex; flex-direction: column; gap: 12px; }
.qd-category {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
    overflow: hidden;
}
.qd-cat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: 0.15s;
    background: #fff;
}
.qd-cat-head:hover { background: #fee2e2; }
.qd-cat-icon {
    width: 38px; height: 38px;
    background: #d97706; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    border-radius: 9px;
    flex-shrink: 0;
}
.qd-cat-meta { flex: 1; min-width: 0; }
.qd-cat-name { font-weight: 900; font-size: 14px; }
.qd-cat-sub { font-size: 12px; color: #999; margin-top: 2px; font-weight: 600; }
.qd-cat-chevron { font-size: 13px; color: #999; }
.qd-cat-body {
    padding: 16px;
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}
.qd-rules { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.qd-rule {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left-width: 4px;
    border-radius: 8px;
    padding: 12px;
    transition: 0.15s;
}
.qd-rule-positive { border-left-color: #16a34a; }
.qd-rule-negative { border-left-color: #dc2626; }
.qd-rule-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.qd-rule-row .form-input { font-size: 14px; padding: 10px 12px; }
.qd-rule-score {
    text-align: center;
    font-weight: 900;
    color: #111;
}
.qd-rule-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qd-type-toggle { display: flex; gap: 4px; }
.qd-type-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f4f4f5;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: 0.15s;
}
.qd-type-btn:hover { background: #e5e5e5; }
.qd-type-btn.active-pos {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
}
.qd-type-btn.active-neg {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}
.qd-rule-mini-actions { display: flex; gap: 4px; }

/* =====================================================================
   ALBUM EDITOR
   ===================================================================== */
.alb-folder-list { display: flex; flex-direction: column; gap: 10px; }
.alb-folder {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.alb-folder-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    transition: 0.15s;
}
.alb-folder-head:hover { background: #fef2f2; }
.alb-folder-icon {
    width: 40px; height: 40px;
    background: #dc2626;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    border-radius: 10px;
    flex-shrink: 0;
}
.alb-folder-meta { flex: 1; min-width: 0; }
.alb-folder-name { font-weight: 900; font-size: 15px; }
.alb-folder-count { font-size: 12px; color: #999; margin-top: 2px; }
.alb-folder-actions { display: flex; gap: 4px; flex-shrink: 0; }
.alb-upload-row { margin-bottom: 12px; text-align: center; }
.alb-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.alb-photo-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    padding: 6px 6px 26px;
}
.alb-photo-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #f0f0f0;
}
.alb-photo-name {
    position: absolute;
    bottom: 4px;
    left: 6px;
    right: 6px;
    font-size: 10px;
    color: #666;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.alb-photo-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(220,38,38,0.9);
    color: #fff;
    font-size: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    opacity: 0.85;
}
.alb-photo-del:hover { background: #991b1b; opacity: 1; }

/* =====================================================================
   THANHVIEN EDITOR
   ===================================================================== */
.tv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}
.tv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left-width: 4px;
    border-radius: 10px;
    transition: 0.15s;
}
.tv-item:hover { border-color: #dc2626; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.tv-item.male { border-left-color: #dc2626; }
.tv-item.female { border-left-color: #d97706; }
.tv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tv-init {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: #fff;
    background: #111;
}
.tv-item.male .tv-init { background: #dc2626; }
.tv-item.female .tv-init { background: #d97706; }
.tv-info { flex: 1; min-width: 0; }
.tv-name {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
    color: #111;
}
.tv-stt { font-size: 11px; color: #999; margin-top: 2px; }
.tv-edit {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    flex-shrink: 0;
}
.tv-edit:hover { background: #dc2626; color: #fff; }

/* =====================================================================
   BAITAP EDITOR
   ===================================================================== */
.bt-tkb-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.bt-tkb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    min-width: 500px;
    border-radius: 8px;
    overflow: hidden;
}
.bt-tkb-table th {
    background: #111;
    color: #fff;
    padding: 8px 6px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}
.bt-tkb-cell {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #e5e5e5;
    font-size: 12px;
}
.bt-tkb-period {
    background: #f4f4f5;
    font-weight: 900;
    width: 50px;
}
.bt-tkb-cell.has-subject {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 700;
}
.bt-tkb-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.bt-tkb-actions > * { flex: 1; min-width: 200px; }

.bt-hw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 2px solid #111;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
}
.bt-hw-list { display: flex; flex-direction: column; gap: 8px; }
.bt-hw-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    transition: 0.15s;
}
.bt-hw-item.exam { border-left-color: #d97706; background: #fffbeb; }
.bt-hw-type { font-size: 20px; flex-shrink: 0; }
.bt-hw-body { flex: 1; min-width: 0; }
.bt-hw-subject {
    font-weight: 900;
    font-size: 13px;
    color: #111;
    margin-bottom: 4px;
}
.bt-hw-content {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.bt-hw-meta { font-size: 11px; color: #999; margin-top: 6px; }

.bt-add-box {
    padding: 14px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px dashed #dc2626;
    margin-top: 12px;
}

.bt-pred-list { display: flex; flex-direction: column; gap: 8px; }
.bt-pred-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #d97706;
    border-radius: 10px;
}
.bt-pred-icon { font-size: 20px; flex-shrink: 0; }
.bt-pred-body { flex: 1; min-width: 0; }
.bt-pred-subject {
    font-weight: 900;
    font-size: 13px;
    color: #d97706;
    margin-bottom: 4px;
}
.bt-pred-content {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    word-break: break-word;
}
.bt-pred-days {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}
.bt-pred-day {
    display: inline-block;
    background: #fef2f2;
    color: #dc2626;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    margin-right: 4px;
}
.bt-pred-meta { font-size: 11px; color: #999; margin-top: 4px; }

.bt-cansu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.bt-cansu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}
.bt-cansu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.bt-cansu-body { flex: 1; min-width: 0; }
.bt-cansu-name {
    font-weight: 900;
    font-size: 14px;
    color: #111;
}
.bt-cansu-pass {
    font-size: 12px;
    color: #666;
    font-family: monospace;
    margin-top: 2px;
}

.bt-log-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.bt-log-row {
    padding: 10px 12px;
    background: #fafafa;
    border-left: 4px solid #999;
    border-radius: 8px;
    font-size: 13px;
}
.bt-log-row.login { border-left-color: #2563eb; }
.bt-log-row.post { border-left-color: #dc2626; }
.bt-log-row.exam { border-left-color: #d97706; }
.bt-log-row.tkb { border-left-color: #16a34a; }
.bt-log-row.del { border-left-color: #991b1b; }
.bt-log-row.admin { border-left-color: #7c3aed; }
.bt-log-label {
    font-weight: 900;
    color: #111;
    font-size: 13px;
}
.bt-log-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    font-family: monospace;
}
.bt-log-detail {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

/* =====================================================================
   HETHONG EDITOR
   ===================================================================== */
.sys-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    flex-wrap: wrap;
}
.sys-info-row:last-child { border-bottom: none; }
.sys-info-key {
    font-size: 13px;
    font-weight: 700;
    color: #666;
}
.sys-info-val {
    font-size: 13px;
    color: #111;
    font-weight: 600;
    text-align: right;
}
.sys-info-val code {
    background: #f4f4f5;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-family: monospace;
    color: #dc2626;
    word-break: break-all;
}
.sys-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.3px;
}
.sys-badge.ok { background: #dcfce7; color: #14532d; }
.sys-badge.warn { background: #fef3c7; color: #92400e; }

.sys-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e5e5e5;
}
.sys-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}
.sys-user-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sys-user-icon.super { background: linear-gradient(135deg, #d97706, #dc2626); }
.sys-user-icon.normal { background: #2563eb; }
.sys-user-body { flex: 1; min-width: 0; }
.sys-user-name {
    font-weight: 900;
    font-size: 14px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sys-user-meta {
    font-size: 12px;
    color: #666;
    font-family: monospace;
    margin-top: 3px;
}
.sys-you-badge {
    font-size: 10px;
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.sys-ai-current {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.sys-backup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.sys-backup-btn {
    padding: 18px 12px;
    border-radius: 12px;
    background: #fafafa;
    border: 2px dashed #dc2626;
    color: #111;
    cursor: pointer;
    transition: 0.15s;
    font-family: inherit;
    text-align: center;
}
.sys-backup-btn:hover {
    background: #fee2e2;
    border-style: solid;
    transform: translateY(-2px);
}
.sys-backup-icon {
    font-size: 28px;
    margin-bottom: 6px;
    color: #dc2626;
}
.sys-backup-label {
    font-weight: 900;
    font-size: 14px;
    color: #dc2626;
    margin-bottom: 3px;
}
.sys-backup-sub {
    font-size: 11px;
    color: #999;
}

/* ============ DARK MODE ============ */
body.dark-mode {
    background: #171b2e;
    color: #ecead9;
}
body.dark-mode .admin-card,
body.dark-mode .admin-tabbar-wrap,
body.dark-mode .admin-page {
    background: #1c2138;
    color: #ecead9;
    border-color: #2a3048;
}
body.dark-mode .admin-tabbar-wrap {
    border-bottom-color: #2a3048;
}
body.dark-mode .atab {
    background: #232842;
    color: #9aaccc;
}
body.dark-mode .atab.active {
    background: #dc2626;
    color: #fff;
}
body.dark-mode .form-input,
body.dark-mode .nq-section,
body.dark-mode .qd-category,
body.dark-mode .bt-hw-item,
body.dark-mode .bt-pred-item,
body.dark-mode .bt-cansu-item,
body.dark-mode .tv-item,
body.dark-mode .sys-user-item,
body.dark-mode .alb-folder {
    background: #232842;
    color: #ecead9;
    border-color: #2a3048;
}
body.dark-mode .form-label,
body.dark-mode .card-desc,
body.dark-mode .sys-info-key {
    color: #9aaccc;
}
body.dark-mode .card-title,
body.dark-mode .nq-section-title,
body.dark-mode .qd-cat-name,
body.dark-mode .tv-name,
body.dark-mode .bt-hw-subject,
body.dark-mode .sys-user-name {
    color: #ecead9;
}

/* ============ MOBILE (FIX LỖI CẮT TAB) ============ */
@media (max-width: 640px) {
    .admin-tabbar-wrap { 
        top: 60px; 
        /* Giữ nguyên hiệu ứng mờ 2 mép */
        mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black calc(100% - 15px), transparent);
    }
    .admin-tabbar { padding: 10px 12px; gap: 6px; }
    .atab { padding: 8px 12px; font-size: 12px; border-radius: 8px; }
    .atab-icon { font-size: 14px; }
    
    /* Thu gọn chữ của tab không active để đỡ chiếm chỗ, chỉ hiện icon */
    .atab-label { display: none; }
    .atab.active .atab-label { display: inline; }

    .nq-table-header,
    .nq-table-row { grid-template-columns: 1fr 1.5fr 32px; }
    .nq-section-actions { flex-direction: column; }
    .btn-danger-nq { margin-left: 0; width: 100%; }

    .qd-rule-row { grid-template-columns: 1fr; }
    .qd-rule-score { text-align: left; }
    .qd-rule-actions { flex-direction: column; align-items: stretch; }
    .qd-type-toggle { justify-content: center; }
    .qd-rule-mini-actions { justify-content: flex-end; }

    .alb-photo-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

    .tv-modal-box { padding: 22px 16px; }
    .tv-modal-avatar { width: 110px; height: 110px; }

    .bt-tkb-actions { flex-direction: column; }
    .bt-tkb-actions > * { width: 100%; }

    .sys-backup-grid { grid-template-columns: 1fr; }
    .sys-info-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .sys-info-val { text-align: left; }
}