/* ==========================================================================
   1. ADMIN STYLES - GENERAL
   ========================================================================== */
.nvtrag-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin-top: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; margin-right: 6px; font-size: 12px; }
.nvtrag-bar { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.nvtrag-bar__fill { height: 100%; background: #60a5fa; width: 0; display: block; transition: width 0.3s ease, background-color 0.3s ease; }
.nvtrag-kv { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 4px 0; border-bottom: 1px dashed #eee; padding: 8px 0; }
.nvtrag-kv small { color: #64748b; }
.nvtrag-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.muted { color:#6b7280; }
.badge { display:inline-block; padding: 2px 8px; border-radius: 999px; background: #eef6ff; color: #1d4ed8; font-weight: 600; }
.paypal-button-container { margin-bottom: 10px; }

/* Admin Notices Cleanup */
.toplevel_page_nvtrag-saas .notice { margin: 20px 20px 0 0 !important; box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
.toplevel_page_nvtrag-saas .wrap { margin-top: 20px; }
.toplevel_page_nvtrag-saas .e-notice, 
.toplevel_page_nvtrag-saas .update-nag { display: none !important; }

/* Responsive Grid */
@media(max-width:900px){ .nvtrag-grid { grid-template-columns:1fr; } }

/* Status Styles */
.nvtrag-status { padding: 6px 10px; border-radius: 4px; display: inline-block; }
.nvtrag-ok { background: #eaffea; border: 1px solid #46b450; color: #070; }
.nvtrag-err { background: #ffeaea; border: 1px solid #cc0000; color: #c00; }

/* =========================================================
   DASHBOARD – AI SYSTEM STATUS
   ========================================================= */

.nvtrag-ai-status-wrap {
  margin-top: 20px;
}

.nvtrag-ai-status-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.nvtrag-ai-status-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #111827;
}

.nvtrag-ai-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 14px;
}

.nvtrag-ai-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
}

.nvtrag-ai-status-item strong {
  margin-left: auto;
  font-weight: 700;
}

/* ===== AI DOT ===== */
.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}

/* STATES */
.nvtrag-ai-status-item.is-live .ai-dot {
  background: #22c55e;
  animation: nvtrag-pulse-green 2s infinite;
}

.nvtrag-ai-status-item.is-ok .ai-dot {
  background: #3b82f6;
}

.nvtrag-ai-status-item.is-ai .ai-dot {
  background: #8b5cf6;
}

.nvtrag-ai-status-item.is-muted {
  opacity: 0.7;
}

/* Pulse animation */
@keyframes nvtrag-pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* =========================================================
   DASHBOARD – METRICS
   ========================================================= */

.nvtrag-dashboard-metrics {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 16px;
}

.nvtrag-metric-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  transition: transform .2s ease, box-shadow .2s ease;
}

.nvtrag-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.metric-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}

.nvtrag-metric-card.is-warning .metric-value {
  color: #f59e0b;
}

.nvtrag-metric-card.is-ai .metric-value {
  background: linear-gradient(90deg,#6366f1,#8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =========================================================
   DASHBOARD – AI ACTIVITY
   ========================================================= */

.nvtrag-ai-activity-card {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 24px;
}

.nvtrag-ai-activity-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.nvtrag-ai-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nvtrag-ai-activity-list li {
  font-size: 13px;
  color: #374151;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nvtrag-ai-activity-list .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot.live { background: #22c55e; }
.dot.ai   { background: #6366f1; }
.dot.sys  { background: #9ca3af; }

/* ==========================================================================
   3. INGEST TAB (COMMON)
   ========================================================================== */
.nvtrag-filters button { margin-left: 4px; }
.nvtrag-filters button.active { font-weight: bold; border-color: #2271b1; box-shadow: inset 0 0 0 1px #2271b1; color: #2271b1; }
.nvtrag-pagination a.page-numbers { text-decoration: none; padding: 5px 10px; border: 1px solid #ccc; border-radius: 4px; margin: 0 2px; }
.nvtrag-pagination a.page-numbers:hover { border-color: #999; }
.nvtrag-pagination a.page-numbers.current { background: #2271b1; color: white; border-color: #2271b1; }

/* Ingest Job Progress Bar */
#nvtrag-ingest-progress .nvtrag-bar { height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
#nvtrag-ingest-progress .nvtrag-bar__fill { background: #2271b1; }

/* Job Progress States */
.nvtrag-bar__fill.is-warning { background-color: #f59e0b !important; }
.nvtrag-bar__fill.is-error { background-color: #d63638 !important; }

/* ==========================================================================
   4. BADGES & ADMIN BAR
   ========================================================================== */
/* Badge LIVE Tab */
.nav-tab .nvtrag-live-badge {
  display: inline-block; margin-left: 6px; padding: 2px 7px; font-size: 9px; font-weight: 700; line-height: 1.2;
  color: #fff; background-color: #d63638; border-radius: 3px; vertical-align: middle; text-transform: uppercase;
  animation: nvtrag-pulse-red 1.5s infinite;
}
@keyframes nvtrag-pulse-red {
  0% { opacity: 1; box-shadow: 0 0 3px rgba(214, 54, 56, 0.5); }
  50% { opacity: 0.8; box-shadow: none; }
  100% { opacity: 1; box-shadow: 0 0 3px rgba(214, 54, 56, 0.5); }
}

/* Badge Live Request Sidebar */
.nvtrag-req-live {
    display: inline-block; background-color: #d63638; color: #fff; font-size: 10px; font-weight: 800;
    padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
    animation: nvtrag-pulse-red 1.5s infinite;
}

/* Top Admin Bar Badge */
#wp-admin-bar-nvtrag-admin-bar-unread .ab-item { display: flex !important; align-items: center !important; gap: 4px; }
#wp-admin-bar-nvtrag-admin-bar-unread .ab-icon { font-family: 'dashicons' !important; margin-right: 0 !important; line-height: 1.3 !important; }
#wp-admin-bar-nvtrag-admin-bar-unread .nvtrag-unread-count-bubble {
  display: inline-block; background-color: #d63638; color: #fff; font-size: 11px;
  line-height: 1.6; font-weight: 600; padding: 0 7px; border-radius: 10px; margin-left: 2px; vertical-align: middle;
}

/* ==========================================================================
   5. ACCOUNT TAB
   ========================================================================== */
.nvtrag-tab-account .nvtrag-card { padding: 20px 24px; margin-top: 20px; border: 1px solid #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.nvtrag-tab-account h2 { font-size: 20px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.nvtrag-tab-account .nvtrag-grid { gap: 24px; }
.nvtrag-tab-account .nvtrag-kv { border-bottom: 1px solid #f0f0f0; padding: 12px 0; margin: 0; transition: background-color 0.2s ease; }
.nvtrag-tab-account .nvtrag-kv:hover { background-color: #fcfcfc; }
.nvtrag-tab-account .nvtrag-kv span:first-child { color: #555; font-weight: 500; }
.nvtrag-tab-account .nvtrag-kv strong { color: #111; font-weight: 600; }
.nvtrag-tab-account .badge { background: #e0e7ff; color: #3730a3; font-size: 12px; }

/* Payment Plans */
.nvtrag-tab-account input[name="currency_switcher"] { display: none; }
.nvtrag-tab-account input[name="currency_switcher"] + label {
    font-size: 14px; font-weight: 600; padding: 10px 16px; border: 1px solid #ccc; border-radius: 8px;
    cursor: pointer; transition: all 0.2s ease; background: #f9fafb; color: #555; margin: 0; line-height: 1.5;
}
.nvtrag-tab-account input[name="currency_switcher"]:checked + label {
    background: #e0e7ff; border-color: #3b82f6; color: #1e3a8a; box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
}

#paypal-plans > div, #payos-plans > div { border: 1px solid #e0e0e0; border-radius: 12px; padding: 20px; background: #fff; transition: all 0.3s ease; position: relative; }
#paypal-plans > div:hover, #payos-plans > div:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }

/* Pro Plan */
#paypal-plans > div:first-child, #payos-plans > div:first-child { border-top: 4px solid #3b82f6; }
#paypal-plans > div:first-child h4, #payos-plans > div:first-child h4 { color: #1d4ed8; }

/* Business Plan */
#paypal-plans > div:last-child, #payos-plans > div:last-child { border: 1px solid #fcd34d; border-top: 4px solid #f59e0b; background: #fffbeb; }
#paypal-plans > div:last-child h4, #payos-plans > div:last-child h4 { color: #b45309; font-size: 18px; }
#paypal-plans > div:last-child::before, #payos-plans > div:last-child::before {
    content: "BEST VALUE"; position: absolute; right: 20px;
    background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff; padding: 4px 12px;
    border-radius: 20px; font-size: 11px; font-weight: 800; box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.payos-btn { display: block; width: 100%; text-align: center; font-weight: 600 !important; padding: 12px 16px !important; height: auto !important; margin-bottom: 12px !important; border-radius: 8px !important; }
.payos-btn.button-primary { background: #2563eb !important; border-color: #2563eb !important; }
.payos-btn.button-primary:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; }

/* ==========================================================================
   6. SETTINGS TAB
   ========================================================================== */
.nvtrag-settings-wrapper { display: flex; gap: 20px; margin-top: 20px; align-items: flex-start; }
.nvtrag-settings-sidebar { width: 240px; flex-shrink: 0; background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; overflow: hidden; }
.nvtrag-settings-nav { list-style: none; margin: 0; padding: 0; }
.nvtrag-settings-nav li { margin: 0; border-bottom: 1px solid #f0f0f1; }
.nvtrag-settings-nav a { display: block; padding: 12px 16px; text-decoration: none; color: #3c434a; font-weight: 500; font-size: 14px; border-left: 3px solid transparent; }
.nvtrag-settings-nav a:hover { background-color: #f6f7f7; color: #2271b1; }
.nvtrag-settings-nav a.active { background-color: #f0f6fc; color: #2271b1; border-left-color: #2271b1; font-weight: 600; }
.nvtrag-settings-content { flex-grow: 1; min-width: 0; }
.nvtrag-settings-panel { display: none; }
.nvtrag-settings-panel.active { display: block; animation: fadeIn 0.3s ease; }
.nvtrag-settings-panel .nvtrag-card { margin-top: 0; border-top: 1px solid #c3c4c7; padding: 20px 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }

/* Form Table Refined */
.nvtrag-tab-settings .form-table th { padding: 20px 10px 20px 0; width: 240px; }
.nvtrag-tab-settings .form-table td { padding: 20px 10px 20px 0; }
.nvtrag-tab-settings .form-table td input[type="text"],
.nvtrag-tab-settings .form-table td input[type="url"],
.nvtrag-tab-settings .form-table td input[type="password"] { width: 100%; max-width: 450px; padding: 8px 12px; height: 36px; border-radius: 6px; }
.nvtrag-tab-settings .form-table td input.small-text { max-width: 100px; display: inline-block; margin-left: 5px; }

/* Custom Channels Repeater */

/* Button Options Grid */
.nvtrag-tab-settings .nvtrag-button-type-options-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; width: 100%; }
.nvtrag-tab-settings .nvtrag-button-type-option { border: 2px solid #ddd; border-radius: 8px; padding: 0; background: #fdfdfd; transition: all 0.2s ease; }
.nvtrag-tab-settings .nvtrag-button-type-label { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 16px 20px; border-bottom: 1px solid #eee; background: #f9f9f9; border-radius: 6px 6px 0 0; cursor: pointer; }
.nvtrag-tab-settings .nvtrag-button-option-content { padding: 16px 20px; display: none; }
.nvtrag-tab-settings .nvtrag-button-type-option:has(input:checked) { border-color: #2563eb; background: #fff; }
.nvtrag-tab-settings .nvtrag-button-type-option:has(input:checked) .nvtrag-button-option-content { display: block; }

/* Switch Toggle */
.nvtrag-switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; margin-right: 10px; }
.nvtrag-switch input { opacity: 0; width: 0; height: 0; }
.nvtrag-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.nvtrag-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.nvtrag-switch input:checked + .nvtrag-slider { background-color: #2563eb; }
.nvtrag-switch input:checked + .nvtrag-slider:before { transform: translateX(20px); }
.nvtrag-switch-label { font-weight: 600; vertical-align: middle; }
.nvtrag-switch-row { display: flex; align-items: center; margin-bottom: 12px; }

/* Color Picker Fix */
.wp-picker-container .wp-color-result { height: 34px; border-radius: 4px; border: 1px solid #ccc; }
.wp-picker-input-wrap input[type="text"].wp-color-picker { height: 34px !important; padding: 4px 8px !important; font-family: monospace; }

@media (max-width: 782px) { .nvtrag-settings-wrapper { flex-direction: column; } .nvtrag-settings-sidebar { width: 100%; } }

/* ==========================================================================
   7. INGEST TAB
   ========================================================================== */
.nvtrag-tab-ingest .nvtrag-card { padding: 20px 24px; margin-top: 20px; border: 1px solid #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.nvtrag-tab-ingest h3 { font-size: 20px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.nvtrag-manual-sitemap-box { margin-bottom: 15px; padding: 15px; background: #f0f6fc; border: 1px solid #cce5ff; border-radius: 6px; }
.nvtrag-tab-ingest fieldset { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.nvtrag-tab-ingest #nvtrag-upload-result { margin-top: 16px; background: #f8f9fa; border: 1px solid #e0e0e0; padding: 12px; border-radius: 6px; max-height: 200px; overflow-y: auto; }

/* Filters Toolbar */
.nvtrag-tab-ingest .nvtrag-filters-group { gap: 20px !important; align-items: center; }
.nvtrag-tab-ingest #nvtrag-src-q { padding: 8px 12px; border-radius: 6px; border: 1px solid #ddd; height: 36px; }
.nvtrag-tab-ingest .nvtrag-filters .button { background: #f4f4f5; border: 1px solid #d4d4d8; color: #3f3f46; padding: 4px 12px; border-radius: 6px; font-weight: 500; }
.nvtrag-tab-ingest .nvtrag-filters .button.active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* Table */
.nvtrag-tab-ingest table.widefat { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; box-shadow: none; border-spacing: 0; }
.nvtrag-tab-ingest table.widefat th { background: #f8f9fa; padding: 14px 12px; border-bottom: 1px solid #e0e0e0; }
.nvtrag-tab-ingest table.widefat td { padding: 14px 12px; border-bottom: 1px solid #f0f0f0; }
.nvtrag-badge-status { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; display: inline-block; }
.nvtrag-badge-status.is-ok { background: #eaffea; border-color: #46b450; color: #15803d; }
.nvtrag-badge-status.is-err { background: #ffeaea; border-color: #d63638; color: #b91c1c; }
.nvtrag-btn-delete { border-color: #d63638 !important; color: #d63638 !important; }
.nvtrag-btn-delete:hover { background: #d63638 !important; color: #fff !important; }

/* Job Errors */
#nvtrag-job-errors { margin-top: 15px; padding: 10px 15px; background: #fff; border: 1px solid #c3c4c7; border-left-width: 4px; display: none; white-space: pre-wrap; }
#nvtrag-job-errors.is-warning { border-left-color: #f59e0b; }
#nvtrag-job-errors.is-error { border-left-color: #d63638; }

/* ==========================================================================
   11. INBOX / AGENT CONSOLE (MODERN SAAS)
   ========================================================================== */
/* Container chính: Bắt buộc xếp ngang (Row) */
.nvtrag-inbox-wrapper {
    display: flex !important;           /* Kích hoạt Flexbox */
    flex-direction: row !important;     /* Xếp ngang */
    align-items: stretch;               /* Kéo dãn chiều cao bằng nhau */
    width: 100%;
    height: calc(100vh - 160px);        /* Chiều cao cố định để có thanh cuộn */
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;                   /* Ẩn phần thừa */
    margin-top: 20px;
}

/* Sidebar: Cố định chiều rộng */
.nvtrag-inbox-sidebar {
    width: 320px;
    min-width: 320px;       /* Không cho co nhỏ hơn 320px */
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;         /* Quan trọng: Ngăn sidebar bị bóp méo */
}

/* Main Chat: Chiếm hết phần còn lại */
.nvtrag-inbox-main {
    flex-grow: 1;           /* Tự động lấp đầy khoảng trống còn lại */
    min-width: 0;           /* Quan trọng: Ngăn nội dung chat dài làm vỡ khung */
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* 1. Header Sidebar: Xếp dọc (Search ở trên, Tools ở dưới) */
.nvtrag-sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

/* 2. Hàng công cụ: Lọc ngày & Nút bấm */
.nvtrag-sidebar-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* 3. Nhóm ô chọn ngày (Compact style) */
.date-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    flex-grow: 1; /* Chiếm phần lớn diện tích */
}

.nvtrag-mini-date {
    border: none;
    background: transparent;
    font-size: 11px;
    color: #4b5563;
    padding: 0;
    height: 20px;
    width: 100%; /* Để input co giãn */
    min-width: 0;
}
.nvtrag-mini-date:focus {
    box-shadow: none;
    outline: none;
    color: #2563eb;
    font-weight: 500;
}

.date-group .sep {
    color: #9ca3af;
    font-size: 10px;
    padding: 0 2px;
}

/* 4. Nhóm nút bấm (Filter, Export) */
.tool-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.tool-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* Nút Export có màu xanh lá khi hover cho nổi bật */
.tool-btn.export-btn:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
}

.tool-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: flex; /* Căn giữa icon */
    align-items: center;
    justify-content: center;
}

.nvtrag-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    background: #fff;
}

.nvtrag-search-box {
    position: relative;
    flex-grow: 1;
}
.nvtrag-search-box .dashicons {
    position: absolute;
    left: 8px; top: 50%; transform: translateY(-50%);
    color: #9ca3af;
}
.nvtrag-search-box input {
    width: 100%;
    padding: 8px 8px 8px 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #f3f4f6;
    transition: all 0.2s;
}
.nvtrag-search-box input:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: none;
    outline: none;
}
.nvtrag-filter-actions .filter-btn {
    background: none; border: 1px solid #d1d5db;
    border-radius: 6px; padding: 6px; cursor: pointer; color: #6b7280;
}
.nvtrag-filter-actions .filter-btn:hover,
.nvtrag-filter-actions .filter-btn.active {
    background: #eff6ff; color: #2563eb; border-color: #2563eb;
}

/* Session List Items */
.nvtrag-session-list {
    flex: 1;
    overflow-y: auto;
}
.nvtrag-session-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.1s;
}
.nvtrag-session-item:hover { background: #f3f4f6; }
.nvtrag-session-item.active { background: #eff6ff; border-left: 3px solid #2563eb; }

.session-avatar {
    width: 40px; height: 40px;
    background: #e5e7eb; color: #6b7280;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.nvtrag-session-item.active .session-avatar { background: #bfdbfe; color: #1e40af; }

.session-info {
    flex: 1; min-width: 0; /* Fix truncate text */
}
.session-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.session-name { font-weight: 600; font-size: 14px; color: #111827; truncate: hidden; }
.session-time { font-size: 11px; color: #9ca3af; }
.session-preview {
    font-size: 13px; color: #6b7280;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nvtrag-session-item.unread .session-preview { color: #111827; font-weight: 500; }
.unread-badge {
    width: 8px; height: 8px; background: #ef4444; border-radius: 50%;
    display: inline-block; margin-left: 5px;
}

/* Header */
.nvtrag-chat-header {
    height: 65px;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between;
    background: #fff;
}
.chat-user-info { display: flex; align-items: center; gap: 12px; }
.chat-user-info .avatar-placeholder {
    width: 36px; height: 36px; background: #dbeafe; color: #1e40af;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.chat-user-info h3 { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.status-text { font-size: 12px; color: #10b981; display: flex; align-items: center; gap: 4px; }
.status-text::before { content: ''; width: 6px; height: 6px; background: #10b981; border-radius: 50%; }

.action-btn {
    background: none; border: none; cursor: pointer; color: #9ca3af;
    padding: 8px; border-radius: 6px; transition: 0.2s;
}
.action-btn:hover { background: #f3f4f6; color: #4b5563; }

.nvtrag-empty-state {
    margin: auto; text-align: center; color: #9ca3af;
}
.nvtrag-empty-state .dashicons { font-size: 48px; width: 48px; height: 48px; margin-bottom: 10px; }

/* 5. Fix hiển thị Ảnh/File trong chat */
.nvtrag-chat-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
    margin-top: 4px;
}

.nvtrag-chat-file a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}
.nvtrag-chat-file a:hover {
    text-decoration: underline;
}

/* 6. Empty State (Khi chưa chọn chat) */
.nvtrag-empty-state {
    margin: auto;
    text-align: center;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.nvtrag-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* Composer */
.nvtrag-chat-composer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    position: relative;
}
.composer-toolbar {
    display: flex; gap: 10px; margin-bottom: 8px; color: #9ca3af;
}
.composer-toolbar .dashicons { cursor: pointer; font-size: 18px; }
.composer-toolbar .dashicons:hover { color: #4b5563; }

.nvtrag-chat-composer textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 14px;
    background: transparent;
    padding-right: 40px; /* Space for button */
}
.nvtrag-chat-composer textarea:focus { outline: none; box-shadow: none; }

.send-btn {
    position: absolute;
    bottom: 15px; right: 20px;
    background: #2563eb; color: #fff;
    border: none; border-radius: 8px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s;
}
.send-btn:hover { background: #1d4ed8; }
/* --- BỔ SUNG: Sidebar Tools (Date & Export) --- */
.nvtrag-sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Khoảng cách giữa ô tìm kiếm và dòng công cụ */
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.nvtrag-sidebar-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.date-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.nvtrag-mini-date {
    border: none;
    background: transparent;
    font-size: 11px;
    padding: 0;
    color: #4b5563;
    width: 85px; /* Độ rộng vừa đủ cho date input */
    height: 24px;
    line-height: 24px;
}
.nvtrag-mini-date:focus {
    box-shadow: none;
    outline: none;
    color: #111827;
}

.sep { color: #9ca3af; font-size: 10px; }

.tool-actions {
    display: flex;
    gap: 4px;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}
.tool-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}
.tool-btn.export-btn:hover {
    border-color: #059669; /* Màu xanh lá cho export */
    color: #059669;
    background: #ecfdf5;
}
.tool-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
/* User context panel (User Info) */
.nvtrag-userpanel{
  display:none;
  flex-direction:column;
  border-top:1px solid #e5e7eb;
  background:#fff;
  max-height:260px;
}
.nvtrag-userpanel[aria-hidden="false"]{ display:flex; }

.nvtrag-userpanel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid #f1f5f9;
}
.nvtrag-userpanel-close{
  background:transparent;
  border:0;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  color:#6b7280;
}
.nvtrag-userpanel-close:hover{ color:#111827; }
.nvtrag-userpanel-body{ overflow:auto; padding:12px; }
.nvtrag-userpanel-empty{ color:#6b7280; }

/* Helper classes for JS strings (avoid inline styles) */
.nvtrag-inline-ok{ color:#46b450; font-weight:700; }
.nvtrag-inline-err{ color:#d63638; font-weight:700; }
.nvtrag-ws-status-ok{ font-size:10px; color:#46b450; padding:5px; }

/* ==========================================================================
   10. FEEDBACK TAB (MODERN SAAS STYLE)
   ========================================================================== */
.nvtrag-feedback-wrapper {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    max-width: 1000px;
}

/* Sidebar Left */
.nvtrag-feedback-sidebar {
    width: 300px;
    flex-shrink: 0;
}
.nvtrag-feedback-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.2;
}
.nvtrag-feedback-subtitle {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 30px;
}
.nvtrag-support-links h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-bottom: 15px;
}
.nvtrag-support-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nvtrag-support-links li {
    margin-bottom: 12px;
}
.nvtrag-support-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.nvtrag-support-links a:hover {
    color: #2563eb;
    border-color: #2563eb;
    background: #f0f9ff;
}

/* Main Form Right */
.nvtrag-feedback-main {
    flex-grow: 1;
}
.nvtrag-modern-form-card.nvtrag-card {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    padding: 30px;
    border-radius: 16px;
    background: #fff;
}

/* Form Elements */
.nvtrag-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.nvtrag-form-group {
    margin-bottom: 24px;
}
.nvtrag-form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Modern Input Styling */
.nvtrag-modern-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.nvtrag-modern-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}
textarea.nvtrag-modern-input {
    resize: vertical;
    line-height: 1.6;
}

/* Custom Dropzone */
.nvtrag-file-dropzone {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
    background: #f9fafb;
    cursor: pointer;
}
.nvtrag-file-dropzone:hover {
    border-color: #2563eb;
    background: #f0f9ff;
}
.nvtrag-file-dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.nvtrag-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #6b7280;
}
.nvtrag-dropzone-content .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #9ca3af;
    margin-bottom: 5px;
}
.dropzone-text { font-weight: 500; color: #374151; }
.dropzone-meta { font-size: 12px; color: #9ca3af; }

/* File Selected State */
.nvtrag-file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}
.remove-file {
    background: none; border: none; font-size: 18px; color: #0369a1; cursor: pointer;
    line-height: 1; padding: 0 4px;
}

/* Custom Checkbox */
.nvtrag-modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #4b5563;
}
.nvtrag-modern-checkbox input { display: none; }
.checkmark {
    width: 18px; height: 18px; border: 1px solid #d1d5db; border-radius: 4px;
    margin-right: 8px; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; background: #fff;
}
.nvtrag-modern-checkbox input:checked + .checkmark {
    background: #2563eb; border-color: #2563eb;
}
.nvtrag-modern-checkbox input:checked + .checkmark:after {
    content: '✔'; font-size: 11px; color: #fff;
}

/* Footer */
.nvtrag-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}
.nvtrag-btn-send {
    padding: 10px 24px !important;
    height: auto !important;
    font-size: 15px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}
#fb-response { font-weight: 600; font-size: 14px; }

/* Responsive */
@media (max-width: 850px) {
    .nvtrag-feedback-wrapper { flex-direction: column; }
    .nvtrag-feedback-sidebar { width: 100%; margin-bottom: 20px; }
    .nvtrag-form-row { grid-template-columns: 1fr; gap: 0; }
}
/* ==========================================================================
   9. MISC (Dashboard, Wizard, Playground, Feedback)
   ========================================================================== */
.nvtrag-dashboard-grid { margin-top: 20px; }
.nvtrag-chart-wrapper { position: relative; height: 120px; display: flex; align-items: center; justify-content: center; }
.nvtrag-chart-text { position: absolute; font-weight: bold; font-size: 18px; }
.nvtrag-total-docs { font-size: 36px; font-weight: bold; color: #2563eb; text-align: center; margin: 20px 0; }

/* Wizard */
.nvtrag-wizard-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #f0f2f5; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.nvtrag-wizard-container { background: #fff; width: 600px; max-width: 90%; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.nvtrag-wizard-header { background: #fff; padding: 30px 30px 10px; text-align: center; }
.nvtrag-wizard-steps { display: flex; border-bottom: 1px solid #eee; margin-top: 20px; }
.nvtrag-wizard-steps .step { flex: 1; text-align: center; padding: 12px; font-weight: 600; font-size: 13px; color: #bbb; border-bottom: 2px solid transparent; }
.nvtrag-wizard-steps .step.active { color: #2563eb; border-bottom-color: #2563eb; }
.nvtrag-wizard-content { padding: 30px; min-height: 300px; }
.wizard-step-content { display: none; animation: fadeIn 0.3s ease; }
.wizard-step-content.active { display: block; }
.wizard-color-swatch { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s; }
.wizard-color-swatch.selected { border-color: #333; transform: scale(1.15); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
#nvtrag-wizard-skip { position: absolute; top: 10px; right: 15px; background: transparent; border: none; font-size: 28px; color: #999; cursor: pointer; z-index: 10; padding: 0; }
#nvtrag-wizard-skip:hover { color: #d63638; transform: scale(1.1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.nvtrag-wizard-feedback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.nvtrag-wizard-feedback.is-success {
  background: #dcfce7;
  color: #166534;
}
.nvtrag-wizard-feedback.is-error {
  background: #fee2e2;
  color: #b91c1c;
}
.nvtrag-wizard-summary {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}
.nvtrag-wizard-summary-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.nvtrag-wizard-summary-item + .nvtrag-wizard-summary-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.nvtrag-wizard-summary-item .dashicons {
  width: 22px;
  height: 22px;
  font-size: 22px;
  color: #2563eb;
  flex-shrink: 0;
}
.nvtrag-wizard-summary-item strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}
.nvtrag-wizard-summary-item p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}
.nvtrag-wizard-note {
  margin-top: 16px;
  color: #6b7280;
  text-align: center;
}
.nvtrag-wizard-actions {
  margin-top: 22px;
  text-align: center;
}

/* Playground */
.nvtrag-pg-card { max-width: 600px; margin: 20px auto; display: flex; flex-direction: column; height: 600px; padding: 0; overflow: hidden; border-radius: 12px; border: 1px solid #ddd; background: #fff; }
.nvtrag-pg-header { background: #2563eb; color: #fff; padding: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.nvtrag-pg-body { flex: 1; padding: 20px; background: #f9fafb; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.nvtrag-pg-footer { padding: 15px; background: #fff; border-top: 1px solid #eee; display: flex; gap: 10px; align-items: center; }
#pg-chat-body .pg-row { display: flex; flex-direction: column; max-width: 85%; }
#pg-chat-body .pg-row.user { align-self: flex-end; align-items: flex-end; }
#pg-chat-body .pg-row.bot { align-self: flex-start; align-items: flex-start; }
#pg-chat-body .pg-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
#pg-chat-body .pg-row.user .pg-bubble { background: #2563eb; color: #fff; border-bottom-right-radius: 2px; }
#pg-chat-body .pg-row.bot .pg-bubble { background: #fff; border: 1px solid #e5e7eb; color: #1f2937; border-bottom-left-radius: 2px; }
.pg-typing { display: flex; gap: 4px; padding: 8px 12px; background: #fff; border-radius: 12px; border: 1px solid #eee; width: fit-content; }
.pg-typing .dot { width: 6px; height: 6px; background: #bbb; border-radius: 50%; animation: pg-bounce 1.4s infinite ease-in-out both; }
.pg-typing .dot:nth-child(1) { animation-delay: -0.32s; }
.pg-typing .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes pg-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ==========================================================================
   CHAT BUBBLES (INBOX & PLAYGROUND STYLE)
   ========================================================================== */

/* 1. Khung chứa tin nhắn (Body) */
.nvtrag-chat-body,
.nvtrag-pg-body {
    flex: 1;
    padding: 20px;
    background: #f9fafb; /* Màu nền xám nhẹ */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Khoảng cách giữa các tin nhắn */
}

/* 2. Dòng tin nhắn (Row) - Bao quanh bong bóng */
.nvtrag-chat-body .pg-row,
.nvtrag-pg-body .pg-row,
#pg-chat-body .pg-row { /* Hỗ trợ cả ID cũ của Playground */
    display: flex;
    flex-direction: column;
    max-width: 80%; /* Giới hạn chiều rộng tin nhắn */
    position: relative;
    width: fit-content; /* Co giãn theo nội dung */
}

/* --- Khách hàng / Bot (Bên Trái) --- */
.nvtrag-chat-body .pg-row.bot,
.nvtrag-pg-body .pg-row.bot,
#pg-chat-body .pg-row.bot {
    align-self: flex-start; /* Căn trái */
    align-items: flex-start;
    margin-right: auto;
}

.nvtrag-chat-body .pg-row.bot .pg-bubble,
.nvtrag-pg-body .pg-row.bot .pg-bubble,
#pg-chat-body .pg-row.bot .pg-bubble {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 2px; /* Góc nhọn bên trái */
}

/* --- Admin / User (Bên Phải) --- */
.nvtrag-chat-body .pg-row.user,
.nvtrag-pg-body .pg-row.user,
#pg-chat-body .pg-row.user {
    align-self: flex-end; /* Căn phải */
    align-items: flex-end;
    margin-left: auto;
}

.nvtrag-chat-body .pg-row.user .pg-bubble,
.nvtrag-pg-body .pg-row.user .pg-bubble,
#pg-chat-body .pg-row.user .pg-bubble {
    background: #2563eb; /* Màu xanh admin */
    color: #ffffff;
    border: 1px solid #2563eb;
    border-bottom-right-radius: 2px; /* Góc nhọn bên phải */
}

/* 3. Bong bóng tin nhắn (Bubble Style chung) */
.pg-bubble {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    word-break: break-word; /* Xuống dòng nếu link quá dài */
}

/* 4. Thời gian & Meta */
.pg-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    margin-left: 2px;
}
.pg-row.user .pg-meta {
    text-align: right;
    margin-right: 2px;
}

/* 5. Ảnh & File trong chat */
.nvtrag-chat-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 5px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
}

.nvtrag-chat-file a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 4px;
}
.pg-row.bot .nvtrag-chat-file a { color: #1f2937; }
.pg-row.user .nvtrag-chat-file a { color: #fff; text-decoration: underline; }

/* 6. Empty State (Khi chưa chọn hội thoại) */
.nvtrag-empty-state {
    margin: auto;
    text-align: center;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.nvtrag-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    color: #d1d5db;
}

/* ======================================================================
   ACCOUNT TAB – MODERN SAAS / AI TECH (override)
   Paste at END of admin-styles.css
   ====================================================================== */

.nvtrag-tab-account {
  max-width: 1100px;
}

/* Card: glassy + soft shadow */
.nvtrag-tab-account .nvtrag-card{
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
  background: linear-gradient(180deg,#ffffff,#f8fafc);
}

/* Section titles */
.nvtrag-tab-account h2{
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  letter-spacing: .2px;
}

/* Key-Value rows -> compact SaaS list */
.nvtrag-tab-account .nvtrag-kv{
  border-bottom: 1px dashed #eef2f7;
  padding: 10px 0;
  border-radius: 10px;
}
.nvtrag-tab-account .nvtrag-kv:hover{
  background: #fbfdff;
}
.nvtrag-tab-account .nvtrag-kv span:first-child{
  color: #6b7280;
  font-weight: 600;
}
.nvtrag-tab-account .nvtrag-kv strong{
  color: #111827;
  font-weight: 800;
}

/* Badge */
.nvtrag-tab-account .badge{
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  font-weight: 800;
}

/* Usage: label text + bars */
.nvtrag-tab-account p{
  margin: 10px 0;
  color: #374151;
}
.nvtrag-tab-account .muted code{
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 3px 8px;
}

/* Progress bars feel more “product” */
.nvtrag-tab-account .nvtrag-bar{
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
}
.nvtrag-tab-account .nvtrag-bar__fill{
  border-radius: 999px;
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
}

/* Action buttons spacing */
.nvtrag-tab-account .button{
  border-radius: 10px;
}
.nvtrag-tab-account .button.button-primary{
  box-shadow: 0 8px 18px rgba(37,99,235,.18);
}

/* =======================
   Payment switcher: segmented control
   ======================= */
.nvtrag-tab-account .nvtrag-payment-switcher{
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

/* Override inline margin-left on label (PHP has style="margin-left:10px") */
.nvtrag-tab-account .nvtrag-payment-switcher label{
  margin-left: 0 !important;
}

/* Keep radios hidden (you already do this) but enhance labels */
.nvtrag-tab-account input[name="currency_switcher"] + label{
  border: 0;
  background: transparent;
  color: #4b5563;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.4;
}
.nvtrag-tab-account input[name="currency_switcher"]:checked + label{
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}

/* =======================
   Plan cards (PayPal / PayOS)
   ======================= */
.nvtrag-tab-account #paypal-plans,
.nvtrag-tab-account #payos-plans{
  gap: 16px;
}

.nvtrag-tab-account #paypal-plans > div,
.nvtrag-tab-account #payos-plans > div{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}

.nvtrag-tab-account #paypal-plans > div:hover,
.nvtrag-tab-account #payos-plans > div:hover{
  transform: translateY(-3px);
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 18px 40px rgba(0,0,0,.10);
}

.nvtrag-tab-account #paypal-plans h4,
.nvtrag-tab-account #payos-plans h4{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

/* Feature list with “check” bullets */
.nvtrag-tab-account .nvtrag-plan-features{
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.nvtrag-tab-account .nvtrag-plan-features li{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
  color: #374151;
  font-weight: 600;
}
.nvtrag-tab-account .nvtrag-plan-features li::before{
  content: "✓";
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ecfdf5;
  color: #059669;
  font-weight: 900;
  margin-top: 1px;
}

/* Small price text look */
.nvtrag-tab-account #paypal-plans p small{
  color: #6b7280;
  font-weight: 700;
}

/* PayPal button container spacing */
.nvtrag-tab-account .paypal-button-container{
  padding: 8px 10px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fbfdff;
}

/* Highlight Business as “best value” (you already add ::before) */
.nvtrag-tab-account #paypal-plans > div:last-child,
.nvtrag-tab-account #payos-plans > div:last-child{
  border-color: #fde68a;
  background: linear-gradient(180deg,#fff7ed,#ffffff);
}

/* =======================
   Register form (no account)
   ======================= */
.nvtrag-tab-account input[type="email"].regular-text,
.nvtrag-tab-account input[type="password"].regular-text{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.nvtrag-tab-account input[type="email"].regular-text:focus,
.nvtrag-tab-account input[type="password"].regular-text:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  outline: none;
}

/* Responsive */
@media (max-width: 900px){
  .nvtrag-tab-account{ max-width: 100%; }
  .nvtrag-tab-account .nvtrag-card{ padding: 18px 16px; }
}
/* ======================================================================
   DATA SOURCES TAB (ingest) – MODERN SAAS / AI TECH (override)
   Paste at END of admin-styles.css
   ====================================================================== */

.nvtrag-tab-ingest{
  max-width: 1150px;
}

/* ---------- Cards ---------- */
.nvtrag-tab-ingest .nvtrag-card{
  padding: 22px 24px;
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.nvtrag-tab-ingest h3{
  font-size: 16px;
  font-weight: 900;
  color: #111827;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  letter-spacing: .2px;
}

.nvtrag-tab-ingest h4{
  font-size: 14px;
  font-weight: 900;
  color: #111827;
  margin: 0 0 8px;
}

.nvtrag-tab-ingest p,
.nvtrag-tab-ingest .description{
  color: #374151;
}

/* ---------- KV + Bars (quota/progress) ---------- */
.nvtrag-tab-ingest .nvtrag-kv{
  border-bottom: 1px dashed #eef2f7;
  padding: 10px 0;
}
.nvtrag-tab-ingest .nvtrag-kv strong{
  color: #111827;
  font-weight: 900;
}
.nvtrag-tab-ingest .nvtrag-kv small{
  color: #6b7280;
  font-weight: 700;
}

.nvtrag-tab-ingest .nvtrag-bar{
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.nvtrag-tab-ingest .nvtrag-bar__fill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
}
.nvtrag-tab-ingest .nvtrag-bar__fill.is-warning{
  background: linear-gradient(90deg,#f59e0b,#fb7185) !important;
}
.nvtrag-tab-ingest .nvtrag-bar__fill.is-error{
  background: linear-gradient(90deg,#ef4444,#f97316) !important;
}

/* Ingest progress zone spacing */
#nvtrag-ingest-progress{
  margin-top: 10px;
}
#nvtrag-job-status-text{
  color: #111827;
}

/* ---------- Website Crawl: sitemap box ---------- */
.nvtrag-tab-ingest .nvtrag-manual-sitemap-box{
  border-radius: 14px;
  border: 1px solid #e0e7ff;
  background: linear-gradient(180deg,#eef2ff,#ffffff);
  padding: 14px 14px;
}
.nvtrag-tab-ingest .nvtrag-manual-sitemap-label{
  font-weight: 900;
  color: #111827;
}
.nvtrag-tab-ingest #nvtrag-manual-sitemap.large-text{
  border-radius: 12px;
  border: 1px solid #d1d5db;
  height: 40px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.nvtrag-tab-ingest #nvtrag-manual-sitemap.large-text:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  outline: none;
}
.nvtrag-tab-ingest .nvtrag-manual-sitemap-desc{
  margin: 8px 0 0;
  color: #6b7280;
  font-weight: 600;
}

/* ---------- Schedule box: make it feel like a nested SaaS panel ---------- */
.nvtrag-tab-ingest .nvtrag-schedule-box{
  border-radius: 14px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

.nvtrag-tab-ingest .nvtrag-switch-row{
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.nvtrag-tab-ingest .nvtrag-switch-label{
  font-weight: 900;
  color: #111827;
}

/* Switch polish (tab-only) */
.nvtrag-tab-ingest .nvtrag-slider{
  background-color: #d1d5db;
}
.nvtrag-tab-ingest .nvtrag-switch input:checked + .nvtrag-slider{
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
}

/* Select / input look */
.nvtrag-tab-ingest select.regular-text,
.nvtrag-tab-ingest input.regular-text{
  border-radius: 12px;
  border: 1px solid #d1d5db;
  height: 40px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.nvtrag-tab-ingest select.regular-text:focus,
.nvtrag-tab-ingest input.regular-text:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  outline: none;
}

/* ---------- Upload Files: “mini dropzone” feel ---------- */
.nvtrag-tab-ingest #nvtrag-file{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #fbfdff;
}
.nvtrag-tab-ingest #nvtrag-file:hover{
  border-color: #2563eb;
}

/* Category radios -> pill chips */
.nvtrag-tab-ingest fieldset label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-weight: 800;
  color: #374151;
}
.nvtrag-tab-ingest fieldset label:hover{
  border-color: #c7d2fe;
  background: #f8fafc;
}

/* Upload result pre */
.nvtrag-tab-ingest #nvtrag-upload-result{
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: #0b1220;
  color: #e5e7eb;
  padding: 12px 14px;
}

/* ---------- Buttons ---------- */
.nvtrag-tab-ingest .button{
  border-radius: 12px;
}

/* Make key actions look primary (Start Crawl, Upload & Index) */
.nvtrag-tab-ingest #nvtrag-start-ingest.button,
.nvtrag-tab-ingest #nvtrag-upload.button{
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
  border-color: transparent;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
}
.nvtrag-tab-ingest #nvtrag-start-ingest.button:hover,
.nvtrag-tab-ingest #nvtrag-upload.button:hover{
  filter: brightness(0.98);
}

/* Refresh list as “ghost” */
.nvtrag-tab-ingest #nvtrag-refresh-sources.button{
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-weight: 900;
}
.nvtrag-tab-ingest #nvtrag-refresh-sources.button:hover{
  border-color: #c7d2fe;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

/* ---------- Filters toolbar (search + pills) ---------- */
.nvtrag-tab-ingest #nvtrag-src-q{
  border-radius: 999px !important;
  height: 40px;
  padding: 0 14px;
}

.nvtrag-tab-ingest .nvtrag-filters-group{
  gap: 10px !important;
}

/* Filter blocks as pill bar */
.nvtrag-tab-ingest .nvtrag-filters{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

/* Label inside filter block */
.nvtrag-tab-ingest .nvtrag-filters .filter-label{
  font-weight: 900;
  color: #6b7280;
  padding: 0 6px;
}

/* Buttons in pill bar */
.nvtrag-tab-ingest .nvtrag-filters .button{
  background: transparent;
  border: 0;
  color: #4b5563;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 999px;
}
.nvtrag-tab-ingest .nvtrag-filters .button:hover{
  background: rgba(255,255,255,.8);
}
.nvtrag-tab-ingest .nvtrag-filters .button.active{
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
}

/* ---------- Sources table ---------- */
.nvtrag-tab-ingest table.widefat{
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  border-spacing: 0;
  background: #ffffff;
}
.nvtrag-tab-ingest table.widefat thead th{
  background: #f8fafc;
  color: #111827;
  font-weight: 900;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 12px;
}
.nvtrag-tab-ingest table.widefat tbody td{
  padding: 14px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.nvtrag-tab-ingest table.widefat tbody tr:hover{
  background: #fbfdff;
}

/* Status badge (already have class, refine a bit) */
.nvtrag-badge-status{
  border: 1px solid transparent;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.nvtrag-badge-status.is-ok{
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}
.nvtrag-badge-status.is-err{
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Delete button keep “danger” but modern */
.nvtrag-btn-delete{
  border-radius: 12px !important;
  font-weight: 900 !important;
}
.nvtrag-btn-delete:hover{
  filter: brightness(0.98);
}

/* ---------- Pagination ---------- */
#nvtrag-pagination{
  margin-top: 10px;
}
.nvtrag-pagination a.page-numbers{
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 6px 10px;
  background: #ffffff;
}
.nvtrag-pagination a.page-numbers.current{
  border-color: transparent;
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
}

/* ---------- Notices / Toast area ---------- */
#nvtrag-source-notices{
  margin: 10px 0 12px;
}
#nvtrag-source-notices .notice{
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
  padding: 12px 14px;
}

/* Job errors panel */
#nvtrag-job-errors{
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}

/* ---------- Peek Modal (override inline styles) ---------- */
#nvtrag-peek-modal{
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 18px;
}

/* inner modal container (direct child div has inline style) */
#nvtrag-peek-modal > div{
  border-radius: 18px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.28) !important;
  overflow: hidden;
}

/* modal header (first inner div) */
#nvtrag-peek-modal > div > div:first-child{
  background: linear-gradient(180deg,#ffffff,#f8fafc) !important;
  border-bottom: 1px solid #eef2f7 !important;
}
#nvtrag-peek-title{
  font-weight: 900 !important;
  color: #111827 !important;
  font-size: 15px !important;
}
#nvtrag-peek-close{
  border-radius: 12px !important;
  font-weight: 900 !important;
}

/* modal body */
#nvtrag-peek-body{
  background: #ffffff;
}
#nvtrag-peek-body pre{
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: #0b1220;
  color: #e5e7eb;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .nvtrag-tab-ingest{ max-width: 100%; }
  .nvtrag-tab-ingest .nvtrag-card{ padding: 18px 16px; }
  .nvtrag-tab-ingest .nvtrag-filters{ flex-wrap: wrap; border-radius: 14px; }
}
/* ======================================================================
   SETTINGS TAB – MODERN SAAS / AI TECH (override)
   Paste at END of admin-styles.css
   ====================================================================== */

/* Scope */
.nvtrag-tab-settings{
  max-width: 1180px;
}

/* --- Layout wrapper (sidebar + content) --- */
.nvtrag-tab-settings .nvtrag-settings-wrapper{
  gap: 18px;
  margin-top: 18px;
}

/* Sidebar: glassy + sticky */
.nvtrag-tab-settings .nvtrag-settings-sidebar{
  width: 260px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
  position: sticky;
  top: 46px; /* phù hợp WP admin bar */
}

/* Nav list */
.nvtrag-tab-settings .nvtrag-settings-nav li{
  border-bottom: 1px solid #eef2f7;
}

/* Nav links: pill + icon alignment */
.nvtrag-tab-settings .nvtrag-settings-nav a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 900;
  color: #374151;
  border-left: 0;
  position: relative;
}

.nvtrag-tab-settings .nvtrag-settings-nav a .dashicons{
  color: #6b7280;
}

.nvtrag-tab-settings .nvtrag-settings-nav a:hover{
  background: #fbfdff;
  color: #111827;
}

.nvtrag-tab-settings .nvtrag-settings-nav a.active{
  background: linear-gradient(90deg,#eef2ff,#ffffff);
  color: #111827;
  font-weight: 900;
}

.nvtrag-tab-settings .nvtrag-settings-nav a.active .dashicons{
  color: #3730a3;
}

/* left indicator bar */
.nvtrag-tab-settings .nvtrag-settings-nav a.active::before{
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg,#2563eb,#8b5cf6);
}

/* Content panels */
.nvtrag-tab-settings .nvtrag-settings-content{
  min-width: 0;
}

.nvtrag-tab-settings .nvtrag-settings-panel{
  display: none;
}
.nvtrag-tab-settings .nvtrag-settings-panel.active{
  display: block;
  animation: fadeIn .22s ease;
}

/* --- Card style inside panels --- */
.nvtrag-tab-settings .nvtrag-settings-panel .nvtrag-card{
  margin-top: 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px 24px;
  background: linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

/* Headings */
.nvtrag-tab-settings .nvtrag-card h2{
  font-size: 16px;
  font-weight: 900;
  color: #111827;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  letter-spacing: .2px;
}

.nvtrag-tab-settings .nvtrag-card h4{
  font-size: 14px;
  font-weight: 900;
  color: #111827;
  margin: 14px 0 8px;
}

/* --- Form-table refinement (SaaS style) --- */
.nvtrag-tab-settings .form-table{
  border-collapse: separate;
  border-spacing: 0 10px; /* tạo “row card” nhẹ */
}

.nvtrag-tab-settings .form-table th{
  width: 260px;
  padding: 10px 12px 10px 0;
  color: #111827;
  font-weight: 900;
  vertical-align: top;
}

.nvtrag-tab-settings .form-table td{
  padding: 10px 0;
  color: #374151;
}

/* Inputs */
.nvtrag-tab-settings input[type="text"].regular-text,
.nvtrag-tab-settings input[type="url"].regular-text,
.nvtrag-tab-settings input[type="password"].regular-text{
  width: 100%;
  max-width: 520px;
  height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.nvtrag-tab-settings input[type="text"].regular-text:focus,
.nvtrag-tab-settings input[type="url"].regular-text:focus,
.nvtrag-tab-settings input[type="password"].regular-text:focus{
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  outline: none;
}

.nvtrag-tab-settings input.small-text{
  height: 36px !important;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 6px 10px;
}

/* Description text */
.nvtrag-tab-settings .description{
  color: #6b7280;
  font-weight: 600;
}

/* Buttons */
.nvtrag-tab-settings .button{
  border-radius: 12px;
}
.nvtrag-tab-settings .button.button-primary{
  box-shadow: 0 10px 22px rgba(37,99,235,.18);
}

/* --- Advanced endpoints (details/summary) --- */
.nvtrag-tab-settings details{
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
.nvtrag-tab-settings details > summary{
  list-style: none;
  cursor: pointer;
  font-weight: 900;
  color: #2563eb !important; /* override inline color */
}
.nvtrag-tab-settings details > summary::-webkit-details-marker{
  display:none;
}
.nvtrag-tab-settings details[open]{
  border-color: #c7d2fe;
}
.nvtrag-tab-settings details > div{
  margin-top: 10px !important; /* override inline */
  padding: 12px !important;
  border-radius: 12px;
  background: #f8fafc !important;
  border: 1px solid #eef2f7 !important;
}

/* --- Switch rows (Widget Behavior) --- */
.nvtrag-tab-settings .nvtrag-switch-row{
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  margin-bottom: 10px;
}
.nvtrag-tab-settings .nvtrag-switch-label{
  font-weight: 900;
  color: #111827;
}
.nvtrag-tab-settings .nvtrag-slider{
  background-color: #d1d5db;
}
.nvtrag-tab-settings .nvtrag-switch input:checked + .nvtrag-slider{
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
}

/* --- Schedule rows (những tr có inline style) --- */
.nvtrag-tab-settings .tr-schedule-setting th,
.nvtrag-tab-settings .tr-schedule-setting td{
  background: #fbfdff !important;
}
.nvtrag-tab-settings .tr-schedule-setting th{
  border-left: 4px solid #c7d2fe !important;
  border-radius: 12px 0 0 12px;
}
.nvtrag-tab-settings .tr-schedule-setting td{
  border-radius: 0 12px 12px 0;
}

/* Make checkbox labels in schedule look like chips */
.nvtrag-tab-settings .tr-schedule-setting fieldset label{
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-weight: 800;
  color: #374151;
  margin: 6px 8px 0 0 !important;
}

/* --- Appearance: Theme radios as chips --- */
.nvtrag-tab-settings #tab-appearance fieldset label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-weight: 900;
  color: #374151;
}
.nvtrag-tab-settings #tab-appearance fieldset label:hover{
  border-color: #c7d2fe;
  background: #f8fafc;
}

/* --- Chat button type cards (Default/Custom image) --- */
.nvtrag-tab-settings .nvtrag-button-type-option{
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(0,0,0,.06);
  overflow: hidden;
}
.nvtrag-tab-settings .nvtrag-button-type-label{
  background: linear-gradient(180deg,#ffffff,#f8fafc);
  border-bottom: 1px solid #eef2f7;
  font-weight: 900;
  color: #111827;
}
.nvtrag-tab-settings .nvtrag-button-type-option:has(input:checked){
  border-color: #c7d2fe;
  box-shadow: 0 18px 40px rgba(0,0,0,.10);
}
.nvtrag-tab-settings .nvtrag-button-type-option:has(input:checked) .nvtrag-button-type-label{
  background: linear-gradient(90deg,#eef2ff,#ffffff);
}

/* Upload preview boxes */
.nvtrag-tab-settings #nvtrag-custom-icon-preview{
  border-radius: 12px !important;
  border: 1px solid #eef2f7;
  background: #f8fafc !important;
  overflow: hidden;
}

/* Avatar fields: make upload buttons align nicer */
.nvtrag-tab-settings .nvtrag-img-field{
  max-width: 520px;
}
.nvtrag-tab-settings .nvtrag-upload-btn{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
}

/* WP color picker polish */
.nvtrag-tab-settings .wp-picker-container .wp-color-result{
  height: 40px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.nvtrag-tab-settings .wp-picker-input-wrap input[type="text"].wp-color-picker{
  height: 40px !important;
  border-radius: 12px;
  padding: 8px 12px !important;
  border: 1px solid #d1d5db;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* --- Sticky Save Bar (inline style div) --- */
.nvtrag-tab-settings form > div[style*="position: sticky"]{
  border-radius: 16px !important;
  border: 1px solid #e5e7eb !important;
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 55px rgba(0,0,0,.14) !important;
  padding: 12px 14px !important;
  gap: 10px;
}

/* Make submit button look “product” */
.nvtrag-tab-settings form > div[style*="position: sticky"] .button-primary{
  background: linear-gradient(90deg,#2563eb,#8b5cf6);
  border-color: transparent !important;
  font-weight: 900;
}

/* Responsive */
@media (max-width: 900px){
  .nvtrag-tab-settings .nvtrag-settings-wrapper{
    flex-direction: column;
  }
  .nvtrag-tab-settings .nvtrag-settings-sidebar{
    width: 100%;
    position: relative;
    top: 0;
  }
}
/* ======================================================================
   TOP TABS MENU (nav-tab-wrapper) – MODERN SAAS / AI TECH
   Paste at END of admin-styles.css
   ====================================================================== */

/* Scope theo page slug để không ảnh hưởng các trang admin khác */
.toplevel_page_nvtrag-saas .nav-tab-wrapper{
  /* bỏ style WP mặc định */
  border-bottom: 0 !important;
  padding: 10px 10px 0 !important;
  margin: 18px 0 10px !important;

  /* container kiểu SaaS */
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;

  background: linear-gradient(180deg,#ffffff,#f8fafc);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

/* Tab base */
.toplevel_page_nvtrag-saas .nav-tab-wrapper .nav-tab{
  float: none !important; /* WP thường float */
  margin: 0 0 10px 0 !important;

  border: 1px solid transparent !important;
  background: #f3f4f6 !important;
  color: #374151 !important;

  padding: 10px 14px !important;
  border-radius: 999px !important;

  font-weight: 900;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none !important;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}

/* Hover */
.toplevel_page_nvtrag-saas .nav-tab-wrapper .nav-tab:hover{
  background: #ffffff !important;
  border-color: #e5e7eb !important;
  color: #111827 !important;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

/* Active */
.toplevel_page_nvtrag-saas .nav-tab-wrapper .nav-tab.nav-tab-active{
  background: linear-gradient(90deg,#2563eb,#8b5cf6) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 16px 35px rgba(37,99,235,.22);
}

/* Active hover giữ “đầm” */
.toplevel_page_nvtrag-saas .nav-tab-wrapper .nav-tab.nav-tab-active:hover{
  transform: translateY(-1px);
  filter: brightness(.98);
}

/* LIVE badge chỉnh cho hợp pill tab */
.toplevel_page_nvtrag-saas .nav-tab .nvtrag-live-badge{
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .6px;
  line-height: 1.4;

  background: #ef4444;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 20px rgba(239,68,68,.18);
}

/* Khi tab đang active mà có LIVE badge, làm badge nổi nhẹ hơn */
.toplevel_page_nvtrag-saas .nav-tab.nav-tab-active .nvtrag-live-badge{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
  box-shadow: none;
}

/* Responsive: khi màn nhỏ, tabs full-width đẹp hơn */
@media (max-width: 900px){
  .toplevel_page_nvtrag-saas .nav-tab-wrapper{
    padding: 10px !important;
  }
  .toplevel_page_nvtrag-saas .nav-tab-wrapper .nav-tab{
    margin: 0 !important;
  }
}
/* ==========================================================================
   Inbox: remove inline styles (presence dot, LIVE badge, context panel, avatar colors)
   ========================================================================== */

/* Empty note */
.nvtrag-empty-note{
  padding:20px;
  text-align:center;
  color:#999;
}

/* Avatar color classes (match getAvatar idx 0..4) */
.session-avatar.nvtrag-av-0{ background:#eff6ff; color:#1d4ed8; }
.session-avatar.nvtrag-av-1{ background:#fef2f2; color:#dc2626; }
.session-avatar.nvtrag-av-2{ background:#ecfdf5; color:#059669; }
.session-avatar.nvtrag-av-3{ background:#fffbeb; color:#d97706; }
.session-avatar.nvtrag-av-4{ background:#f5f3ff; color:#7c3aed; }

/* Presence */
.nvtrag-pres-wrap{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.nvtrag-pres-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  display:inline-block;
}
.nvtrag-pres-online{ background:#22c55e; }
.nvtrag-pres-away{ background:#f59e0b; }
.nvtrag-pres-offline{ background:#9ca3af; }

/* LIVE badge */
.nvtrag-live-badge{
  color:#dc2626;
  font-weight:700;
  font-size:10px;
}

/* Parse content: audio + file icon */
.nvtrag-audio-wrap{ margin-top:5px; }
.nvtrag-audio{
  max-width:100%;
  height:32px;
  vertical-align:middle;
}
.nvtrag-file-icon{ font-size:20px; }

/* User context panel states */
.nvtrag-userctx-state{ padding:12px; }
.nvtrag-userctx-error{ color:#b91c1c; }

/* Simple spacing utilities used by renderSessionContext() */
.nvtrag-mb-8{ margin-bottom:8px; }
.nvtrag-mb-6{ margin-bottom:6px; }
.nvtrag-mt-4{ margin-top:4px; }
.nvtrag-mt-6{ margin-top:6px; }
.nvtrag-mt-8{ margin-top:8px; }

/* Orders list */
.nvtrag-orders{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nvtrag-order-card{
  border:1px solid #eee;
  border-radius:8px;
  padding:10px;
}
.nvtrag-order-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
/* ================================
   INBOX 3 CỘT: Sidebar | Chat | User Info
   ================================ */

.nvtrag-inbox-wrapper{
  display: flex;
  gap: 0;
  align-items: stretch;
}

/* Cột giữa (chat) co giãn */
.nvtrag-inbox-main{
  flex: 1 1 auto;
  min-width: 0; /* quan trọng để tránh tràn */
}

/* Cột phải (User Info) */
#ag-userpanel.nvtrag-inbox-userinfo{
  flex: 0 0 360px;
  width: 360px;
  max-width: 360px;

  display: flex !important;
  flex-direction: column;

  border-left: 1px solid #e5e7eb;
  background: #fff;

  /* bỏ giới hạn max-height kiểu panel dropdown */
  max-height: none !important;
}

/* Body scroll độc lập */
#ag-userpanel.nvtrag-inbox-userinfo #ag-userpanel-body{
  flex: 1 1 auto;
  overflow: auto;
  max-height: none !important;
}

/* Không cần nút close & icon toggle nữa */
#ag-btn-userinfo{
  display: none !important;
}
#ag-userpanel-close{
  display: none !important;
}
.session-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.session-time{
  white-space:nowrap;
  font-size:12px;
  color:#9ca3af;
}

/* =========================================================
   Dashboard v3
   ========================================================= */
.nvtrag-dashboard-v3 {
    display: grid;
    gap: 20px;
    margin-top: 16px;
}

.nvtrag-dash-hero {
    padding: 20px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.nvtrag-dash-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.nvtrag-dash-title,
.nvtrag-account-title {
    margin: 0 0 6px;
}

.nvtrag-dash-subtitle,
.nvtrag-account-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.nvtrag-dash-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.nvtrag-dash-status.is-ok {
    background: #ecfdf3;
    color: #166534;
}

.nvtrag-dash-status.is-bad {
    background: #fef2f2;
    color: #b91c1c;
}

.nvtrag-dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.nvtrag-dash-metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.nvtrag-dash-metric-card.is-warning {
    border-color: #fde68a;
    background: #fffdf5;
}

.nvtrag-dash-metric-card.is-ai {
    border-color: #c7d2fe;
    background: #f8faff;
}

.nvtrag-dash-metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    margin-bottom: 8px;
}

.nvtrag-dash-metric-value {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #111827;
}

.nvtrag-dash-metric-note {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.nvtrag-dash-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 16px;
}

.nvtrag-dash-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.nvtrag-dash-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.nvtrag-dash-card-head h3,
.nvtrag-account-card-head h3,
.nvtrag-upgrade-plan-card h4 {
    margin-top: 0;
    margin-bottom: 6px;
}

.nvtrag-dash-card-head p,
.nvtrag-account-card-head p,
.nvtrag-account-upgrade-head p {
    margin: 0;
    color: #6b7280;
}

.nvtrag-dash-chart-wrap {
    position: relative;
    height: 320px;
    margin-top: 14px;
}

.nvtrag-dash-kv-list,
.nvtrag-account-kv-list {
    margin-top: 8px;
}

.nvtrag-dash-kv-row,
.nvtrag-account-kv-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}

.nvtrag-dash-kv-row:last-child,
.nvtrag-account-kv-row:last-child {
    border-bottom: 0;
}

.nvtrag-dash-kv-key,
.nvtrag-account-kv-key {
    color: #6b7280;
}

.nvtrag-dash-pill,
.nvtrag-account-plan-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
}

.nvtrag-dash-activity-list {
    margin: 0;
    padding-left: 18px;
}

.nvtrag-dash-activity-list li {
    margin: 0 0 12px;
}

.nvtrag-dash-activity-time {
    margin-top: 2px;
    color: #6b7280;
    font-size: 13px;
}

/* =========================================================
   Account v3
   ========================================================= */
.nvtrag-account-v3 {
    display: grid;
    gap: 20px;
    margin-top: 16px;
}

.nvtrag-account-hero {
    padding: 20px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #faf7ff 100%);
}

.nvtrag-account-hero-top,
.nvtrag-account-upgrade-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.nvtrag-account-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

.nvtrag-account-main-grid.is-single {
    grid-template-columns: 1fr;
}

.nvtrag-account-card,
.nvtrag-upgrade-plan-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.nvtrag-account-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.nvtrag-account-note {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
}

.nvtrag-account-form-grid {
    display: grid;
    gap: 14px;
    margin-top: 8px;
}

.nvtrag-field-group {
    display: grid;
    gap: 6px;
}

.nvtrag-field-group label {
    font-weight: 600;
}

.nvtrag-usage-block + .nvtrag-usage-block {
    margin-top: 14px;
}

.nvtrag-usage-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.nvtrag-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.nvtrag-bar__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    transition: width .25s ease;
}

.nvtrag-upgrade-gate {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.nvtrag-payment-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.nvtrag-payment-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.nvtrag-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.nvtrag-upgrade-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 8px;
}

.nvtrag-upgrade-price-row.is-spaced {
    margin-top: 20px;
}

.nvtrag-upgrade-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.nvtrag-hidden {
    display: none;
}

.nvtrag-pay-error,
.nvtrag-inline-error {
    color: #b91c1c;
}

.nvtrag-inline-success {
    color: #15803d;
}

@media (max-width: 960px) {
    .nvtrag-dash-main-grid,
    .nvtrag-dash-bottom-grid,
    .nvtrag-account-main-grid,
    .nvtrag-upgrade-grid {
        grid-template-columns: 1fr;
    }

    .nvtrag-dash-kv-row,
    .nvtrag-account-kv-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
/* =========================================================
   DATA SOURCES — COMPACT / OPTIMIZED LAYOUT
   ========================================================= */

.nvtrag-modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  z-index:99999;
  justify-content:center;
  align-items:center;
}
.nvtrag-modal-card{
  background:#fff;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
}
.nvtrag-modal-card--peek{
  width:min(760px,92vw);
  max-height:82vh;
}
.nvtrag-modal-card__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #e5e7eb;
}
.nvtrag-modal-card__head h2{
  margin:0;
  font-size:16px;
}
.nvtrag-modal-card__body{
  padding:16px;
  overflow:auto;
}

.nvtrag-ingest-shell__head h2{
  margin:0 0 6px;
}
.nvtrag-ingest-shell__quota{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:16px;
}
.nvtrag-ingest-quota-card{
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  background:#fafafa;
}
.nvtrag-ingest-quota-card__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
}
.nvtrag-ingest-quota-card__head span{
  font-size:13px;
  color:#6b7280;
}
.nvtrag-ingest-quota-card__head strong{
  font-size:14px;
  color:#111827;
}

.nvtrag-ingest-grid{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
  gap:18px;
  margin-top:18px;
}
.nvtrag-ingest-panel{
  min-width:0;
}
.nvtrag-ingest-meta-list{
  margin-bottom:14px;
}
.nvtrag-form-stack{
  display:grid;
  gap:14px;
}
.nvtrag-form-row > label{
  display:block;
  font-weight:600;
  margin-bottom:6px;
}
.nvtrag-form-row .description{
  margin:6px 0 0;
}
.nvtrag-form-row input[type="url"],
.nvtrag-form-row input[type="time"],
.nvtrag-form-row select{
  width:100%;
  max-width:100%;
}
.nvtrag-ingest-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.nvtrag-ingest-progress{
  margin-top:14px;
  padding:14px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fafafa;
}
.nvtrag-ingest-progress__status{
  font-weight:600;
  margin-bottom:8px;
}
.nvtrag-ingest-progress__meta{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 16px;
  font-size:13px;
  color:#4b5563;
  margin-top:8px;
}
.nvtrag-ingest-progress__errors{
  color:#b42318;
  background:#fff3f2;
  border:1px solid #fecdca;
  padding:10px;
  border-radius:8px;
  margin-top:10px;
  display:none;
  white-space:pre-wrap;
  word-break:break-word;
}
.nvtrag-ingest-progress__errors.is-warning{
  color:#9a6700;
  background:#fffbeb;
  border-color:#fde68a;
}
.nvtrag-ingest-progress__errors.is-error{
  display:block;
}

.nvtrag-crawl-schedule{
  margin-top:16px;
  border-top:1px solid #e5e7eb;
  padding-top:14px;
}
.nvtrag-crawl-schedule summary{
  cursor:pointer;
  font-weight:600;
  list-style:none;
}
.nvtrag-crawl-schedule summary::-webkit-details-marker{
  display:none;
}
.nvtrag-crawl-schedule__body{
  margin-top:14px;
}
.nvtrag-crawl-schedule__options{
  margin-top:12px;
}
.nvtrag-crawl-schedule__grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  align-items:end;
}
.nvtrag-crawl-schedule__grid label{
  display:block;
  font-weight:600;
  margin-bottom:6px;
}
.nvtrag-crawl-schedule__grid select,
.nvtrag-crawl-schedule__grid input[type="time"]{
  width:100%;
  max-width:100%;
}
.nvtrag-crawl-schedule__save{
  display:flex;
  align-items:flex-end;
}
.nvtrag-crawl-schedule__next{
  margin-top:10px;
}

.nvtrag-radio-pill-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0;
  padding:0;
  border:0;
}
.nvtrag-radio-pill{
  position:relative;
}
.nvtrag-radio-pill input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.nvtrag-radio-pill span{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border:1px solid #d0d5dd;
  border-radius:999px;
  background:#fff;
  font-size:13px;
  color:#344054;
  transition:.15s ease;
}
.nvtrag-radio-pill input:checked + span{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:600;
}

.nvtrag-upload-log{
  display:none;
  margin-top:14px;
  padding:12px;
  min-height:100px;
  max-height:240px;
  overflow:auto;
  background:#0f172a;
  color:#e2e8f0;
  border-radius:12px;
  white-space:pre-wrap;
  word-break:break-word;
}

.nvtrag-source-notices{
  margin-bottom:14px;
}
.nvtrag-sources-panel{
  margin-top:18px;
}
.nvtrag-sources-toolbar{
  display:grid;
  gap:12px;
  margin-bottom:14px;
}
.nvtrag-sources-toolbar__search{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.nvtrag-sources-toolbar__search #nvtrag-src-q{
  min-width:260px;
  max-width:420px;
  flex:1 1 320px;
}
.nvtrag-sources-toolbar__filters{
  display:grid;
  gap:10px;
}
.nvtrag-filters{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.nvtrag-filters .filter-label{
  font-weight:600;
  color:#475467;
}
.nvtrag-filters .button.active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}
.nvtrag-sources-summary{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.nvtrag-mini-stat{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:10px 12px;
  background:#fafafa;
}
.nvtrag-mini-stat span{
  display:block;
  font-size:12px;
  color:#6b7280;
  margin-bottom:4px;
}
.nvtrag-mini-stat strong{
  font-size:18px;
  color:#111827;
}
.nvtrag-sources-table-wrap{
  overflow:auto;
}
#nvtrag-sources td,
#nvtrag-sources th{
  vertical-align:top;
}
.nvtrag-source-main{
  min-width:280px;
}
.nvtrag-source-main__title{
  margin-bottom:4px;
}
.nvtrag-source-main__meta{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:6px;
}
.nvtrag-source-main__uri{
  font-size:12px;
  color:#6b7280;
  word-break:break-word;
}
.nvtrag-source-main__uri a{
  color:#475467;
  text-decoration:none;
}
.nvtrag-source-main__uri a:hover{
  color:#1d4ed8;
  text-decoration:underline;
}
.nvtrag-pagination-compact{
  margin-top:14px;
  text-align:center;
}
.nvtrag-pagination-compact .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 10px;
  margin:0 3px;
  border:1px solid #d0d5dd;
  border-radius:8px;
  background:#fff;
  text-decoration:none;
}
.nvtrag-pagination-compact .page-numbers.current{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}
.nvtrag-actions-wrap{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

@media (max-width: 1080px){
  .nvtrag-ingest-grid{
    grid-template-columns:1fr;
  }
  .nvtrag-crawl-schedule__grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .nvtrag-sources-summary{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media (max-width: 782px){
  .nvtrag-ingest-shell__quota{
    grid-template-columns:1fr;
  }
  .nvtrag-ingest-progress__meta{
    grid-template-columns:1fr;
  }
  .nvtrag-crawl-schedule__grid{
    grid-template-columns:1fr;
  }
  .nvtrag-sources-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .nvtrag-sources-toolbar__search{
    align-items:stretch;
  }
  .nvtrag-sources-toolbar__search #nvtrag-src-q{
    max-width:none;
    min-width:0;
  }
}
.nvtrag-upload-compact {
  display: grid;
  gap: 14px;
}

.nvtrag-upload-compact__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  align-items: end;
}

.nvtrag-upload-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.nvtrag-upload-picker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nvtrag-upload-picker__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nvtrag-upload-picker__hint {
  font-size: 12px;
  color: #6b7280;
}

.nvtrag-upload-picker__summary {
  min-height: 62px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #fbfdff;
  display: grid;
  align-content: center;
  gap: 4px;
}

.nvtrag-upload-picker__summary strong {
  display: block;
  font-size: 14px;
  color: #111827;
}

.nvtrag-upload-picker__summary span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  word-break: break-word;
}

.nvtrag-upload-picker__summary.is-selected {
  border-style: solid;
  border-color: #2563eb;
  background: #eff6ff;
}

.nvtrag-upload-compact__controls {
  display: grid;
  gap: 10px;
  align-self: stretch;
}

.nvtrag-upload-compact__controls .nvtrag-form-row {
  display: grid;
  gap: 6px;
}

.nvtrag-upload-compact__controls .nvtrag-form-row label {
  font-weight: 600;
  color: #374151;
}

.nvtrag-upload-compact__controls select {
  width: 100%;
  max-width: 100%;
}

.nvtrag-upload-compact__controls #nvtrag-upload {
  width: 100%;
  justify-content: center;
}

@media (max-width: 900px) {
  .nvtrag-upload-compact__row {
    grid-template-columns: 1fr;
  }
}
/* ========================================================
   NVTRAG - CSS làm nổi bật badge unread trong Inbox
   ======================================================== */

/* ----- Badge unread ở từng cuộc hội thoại ----- */
.nvtrag-session-item {
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nvtrag-session-item.unread {
  background: linear-gradient(90deg, rgba(214,54,56,.08) 0%, rgba(214,54,56,.03) 55%, rgba(255,255,255,0) 100%);
  border-left-color: #d63638;
  box-shadow: inset 0 0 0 1px rgba(214,54,56,.08);
}

.nvtrag-session-item.unread:hover {
  background: linear-gradient(90deg, rgba(214,54,56,.12) 0%, rgba(214,54,56,.04) 60%, rgba(255,255,255,0) 100%);
}

.nvtrag-session-item.unread .session-name {
  color: #111827;
  font-weight: 700;
}

.nvtrag-session-item.unread .session-preview {
  color: #111827;
  font-weight: 600;
}

.nvtrag-session-item.unread .session-time {
  color: #b42318;
  font-weight: 700;
}

/* Badge số unread cạnh tên user */
.nvtrag-session-unread-count,
#nvtrag-inbox-tab-badge,
#nvtrag-admin-bar-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #d63638;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(214,54,56,.28);
  vertical-align: middle;
}

.nvtrag-session-unread-count .pending-count,
#nvtrag-inbox-tab-badge .pending-count,
#nvtrag-admin-bar-bubble .pending-count {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.nvtrag-session-unread-count {
  margin-left: 8px;
  transform: translateY(-1px);
}

/* Badge lớn hơn khi unread nhiều */
.nvtrag-session-unread-count.count-10,
.nvtrag-session-unread-count.count-11,
.nvtrag-session-unread-count.count-12,
.nvtrag-session-unread-count.count-99,
#nvtrag-inbox-tab-badge.count-10,
#nvtrag-admin-bar-bubble.count-10 {
  min-width: 28px;
  padding: 0 8px;
}

/* ----- Badge ở tab Inbox ----- */
.nav-tab .nvtrag-live-badge {
  margin-left: 6px;
}

#nvtrag-inbox-tab-badge {
  margin-left: 8px;
  position: relative;
  top: -1px;
}

.nav-tab-active #nvtrag-inbox-tab-badge {
  box-shadow: 0 0 0 2px #f0f6fc, 0 4px 10px rgba(214,54,56,.25);
}

/* ----- Làm gọn layout phần tên + badge ----- */
.session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.session-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.session-info {
  min-width: 0;
}

.session-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- Badge admin bar ----- */
#wpadminbar #nvtrag-admin-bar-bubble {
  margin-left: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-shadow: none;
}

/* Nhấp nháy nhẹ cho unread mới */
@keyframes nvtragUnreadPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.nvtrag-session-item.unread .nvtrag-session-unread-count,
#nvtrag-inbox-tab-badge,
#nvtrag-admin-bar-bubble {
  animation: nvtragUnreadPulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .nvtrag-session-item,
  .nvtrag-session-unread-count,
  #nvtrag-inbox-tab-badge,
  #nvtrag-admin-bar-bubble {
    transition: none;
    animation: none;
  }
}