/* ==========================================================================
   GENZSALE ADMIN PORTAL - CLEAN FLAT WHITE SAAS THEME (SHOPEE AFFILIATE STYLE)
   - Font chữ chuẩn: Inter / Segoe UI / System Sans-serif
   - Nền trắng tinh tế, phẳng 100%, viền mảnh sắc nét, loại bỏ bóng đổ & hiệu ứng rườm rà
   - Bảng dữ liệu có đường viền phân tách rõ ràng, icon sắp xếp chuẩn e-commerce
   - Tag trạng thái sắc nét, màu sắc tối giản (Đã hủy: đỏ, Đang chờ: vàng, Thành công: xanh)
   ========================================================================== */

:root {
  /* Standardized Typography Scale */
  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base: 14px;
  --text-md:  15px;
  --text-lg:  16px;
  --text-xl:  18px;
  --text-2xl: 22px;
  --text-3xl: 26px;

  /* Typography */
  --font-sans: 'Inter', 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Inter', 'Plus Jakarta Sans', sans-serif;

  /* Clean White Palette (Phong cách Shopee Affiliate Admin) */
  --bg: #F5F6F8;                 /* Nền toàn trang xám nhạt sạch sẽ */
  --surface: #FFFFFF;            /* Nền thẻ card, bảng biểu, modal trắng tinh */
  --card-bg: var(--surface);     /* Biến nền card đồng bộ hệ thống */
  --border: #E8E8E8;             /* Đường viền khung, bảng sắc nét */
  --border-hover: #CBD5E1;       /* Viền khi rê chuột */

  --text: #1F2937;               /* Chữ tiêu đề, nội dung chính xám đen */
  --text-muted: #6B7280;         /* Chữ phụ, mô tả */
  --text-dim: #9CA3AF;           /* Chữ mờ, placeholder */

  --accent: #EE4D2D;             /* Màu nhấn chính: Shopee Coral Red */
  --accent-hover: #D73211;       /* Hover cam đỏ */
  --accent-soft: #FFF2EE;        /* Nền pastel nhấn */
  --accent-border: #FFD2C4;      /* Viền pastel nhấn */

  --sidebar-bg: #FFFFFF;         /* Nền Sidebar trắng tinh khiết */
  --sidebar-border: #E8E8E8;     /* Đường viền Sidebar xám nhạt */
  --sidebar-text: #4B5563;       /* Chữ mục menu */
  --sidebar-text-active: #EE4D2D;/* Chữ mục menu đang chọn */
  --sidebar-active-bg: #FFF5F2;  /* Nền mục menu active */

  --green: #10B981;              /* Thành công, Hoàn thành */
  --green-hover: #059669;
  --green-soft: #F0FDF4;
  --green-border: #86EFAC;

  --red: #B91C1C;                /* Lỗi, Đã hủy */
  --red-hover: #991B1B;
  --red-soft: #FEF2F2;
  --red-border: #FCA5A5;

  --amber: #EAB308;              /* Chờ xử lý, Cảnh báo */
  --amber-hover: #CA8A04;
  --amber-soft: #FFFBEB;
  --amber-border: #FDE68A;

  --blue: #0284C7;               /* Thông tin */
  --blue-hover: #0369A1;
  --blue-soft: #EFF6FF;
  --blue-border: #BAE6FD;

  --purple: #7E22CE;
  --purple-hover: #6B21A8;
  --purple-soft: #FAF5FF;
  --purple-border: #D8B4FE;

  /* Aliases */
  --bg-primary: var(--bg);
  --bg-surface: var(--surface);
  --text-main: var(--text);

  /* Shadows & Radius (Phẳng 100%, góc bo nhẹ 4-6px) */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;

  --bg-secondary: var(--surface);
  --bg-card: var(--surface);
  --bg-card-hover: #FAFAFA;
  --border-color: var(--border);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --primary-light: var(--accent-soft);
  --success: var(--green);
  --success-light: var(--green-soft);
  --warning: var(--amber);
  --warning-light: var(--amber-soft);
  --danger: var(--red);
  --danger-light: var(--red-soft);
  --info: var(--blue);
  --info-light: var(--blue-soft);

  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 68px;
  --radius-full: 9999px;
}

/* ==========================================================================
   BASE STYLES - CHỮ RÕ RÀNG, PHẲNG & TINH GỌN
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Lucide Icons - Cố định kích thước, không giật */
i[data-lucide],
svg.lucide,
.lucide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1.15em;
  height: 1.15em;
  stroke-width: 1.8px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  box-sizing: content-box;
}

i[data-lucide] {
  line-height: 1;
}

.brand-logo i, .brand-logo svg { width: 18px; height: 18px; }
.sidebar-collapse-btn i, .sidebar-collapse-btn svg { width: 17px; height: 17px; }
.btn-sm i, .btn-sm svg { width: 12px; height: 12px; }
.btn-table-action i, .btn-table-action svg { width: 14px; height: 14px; }
.search-input-wrapper i, .search-input-wrapper svg { width: 14px; height: 14px; }
.icon-btn i, .icon-btn svg { width: 16px; height: 16px; }

/* Thanh lọc trang Nhân sự (search + 2 select) — xếp chung 1 hàng, chỉ xuống dòng khi màn quá hẹp */
.staff-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.staff-filter-group .search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.staff-filter-group .search-input-wrapper i,
.staff-filter-group .search-input-wrapper svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.staff-filter-group .search-input-wrapper input {
  width: 100%;
  padding-left: 32px;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  /* Thu nhỏ toàn bộ giao diện Admin còn 90% — dùng zoom (không phải transform: scale) vì zoom
     co giãn ĐÚNG cả các phần tử position: fixed (sidebar, modal...) giống hệt cách trình duyệt
     tự zoom, còn transform sẽ làm lệch vị trí phần tử fixed. Áp dụng ở <html> để co đều mọi đơn
     vị (px lẫn rem) vì phần lớn CSS trong dự án viết cứng bằng px, không phải rem. */
  zoom: 90%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography Phẳng */
h1, .page-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

h3, .card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Layout Wrapper */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ==========================================================================
   SIDEBAR - PHONG CÁCH SHOPEE NỀN TRẮNG TINH KHIẾT (CLEAN WHITE)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  overflow-x: hidden;
}

.admin-wrapper.sidebar-loaded .sidebar {
  transition: width 0.15s ease;
}

.brand {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  overflow: hidden;
  white-space: nowrap;
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.brand-text h2 span {
  color: var(--accent);
}

.brand-text .brand-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 1px;
  font-weight: 500;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-section-title {
  padding: 14px 16px 6px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.nav-menu {
  flex: 1;
  padding: 6px 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 11px 18px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-item i, .nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item:hover i, .nav-item:hover svg {
  color: var(--text);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active i, .nav-item.active svg {
  color: var(--accent);
}

/* Vách cam chuyển sang bên phải chuẩn theo Ảnh mẫu 2 */
.nav-item.active::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3.5px;
  background: var(--accent);
  box-shadow: none !important;
  z-index: 2;
}

.nav-item.active::before {
  display: none !important;
  content: none !important;
}

.nav-item .badge {
  margin-left: auto;
  padding: 1.5px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav-item.active .badge {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-border);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: var(--surface);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 700;
  font-size: 11.5px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: block;
  line-height: 1.2;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

.btn-logout-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #FFF1F2;
  border: 1px solid #FECDD3;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-logout-block:hover {
  background: var(--red);
  color: var(--surface);
  border-color: var(--red);
}

.sidebar-version-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 0;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

.version-tag {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand {
  padding: 10px 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.sidebar.collapsed .brand-text {
  display: none;
}

/* Nút thu nhỏ/mở rộng phải luôn hiện, kể cả khi đã thu nhỏ — nếu không sẽ không còn
   cách nào bấm lại để mở rộng sidebar ra. */
.sidebar.collapsed .sidebar-collapse-btn {
  margin-left: 0;
}

.sidebar.collapsed .nav-section-title {
  height: 1px;
  margin: 6px 8px;
  padding: 0;
  background: var(--border);
  font-size: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 11px 0;
  margin: 2px 0;
  gap: 0;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .badge {
  display: none;
}

.sidebar.collapsed .nav-item.active::after {
  right: 0;
}

.sidebar.collapsed .sidebar-footer {
  padding: 8px 6px;
  align-items: center;
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-logout-block span,
.sidebar.collapsed .sidebar-version-bar {
  display: none;
}

.sidebar.collapsed .user-profile {
  justify-content: center;
  padding: 4px;
  width: 100%;
}

.sidebar.collapsed .btn-logout-block {
  padding: 6px 0;
  justify-content: center;
}

.admin-wrapper.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* ==========================================================================
   MAIN CONTENT & TOPBAR (CLEAN WHITE)
   ========================================================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.admin-wrapper.sidebar-loaded .main-content {
  transition: margin-left 0.15s ease;
}

.top-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.header-breadcrumb-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.breadcrumb {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-page-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-hover);
}

.close-btn {
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: var(--red);
  border-color: transparent;
  background: transparent;
}

.close-btn:hover {
  background: var(--red-soft);
  color: var(--red-hover);
}

.notif-wrapper {
  position: relative;
}

/* ==========================================================================
   CONTENT BODY & STAT CARDS (PHONG CÁCH ẢNH 3 - SHOPEE AFFILIATE DASHBOARD)
   ========================================================================== */
.content-body {
  padding: 20px 24px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* ==========================================================================
   CARDS & DATA TABLES (PHONG CÁCH ẢNH 1 & 2 - CỰC KỲ RÕ RÀNG & TINH GỌN)
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: none;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Bảng Dữ Liệu chuẩn E-Commerce (Ảnh 1 & 2) */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}

.data-table th {
  background: var(--surface);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1.5px solid var(--border);
  border-right: 1px solid var(--bg);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

.data-table th:last-child {
  border-right: none;
}

.data-table th i,
.data-table th .sort-icon {
  color: var(--text-dim);
  width: 12px;
  height: 12px;
  margin-left: 3px;
  vertical-align: middle;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg);
  border-right: 1px solid var(--bg);
  color: var(--text);
  vertical-align: middle;
  font-size: 13px;
  background: var(--surface);
}

.data-table td:last-child {
  border-right: none;
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* STT Column */
.data-table th.col-stt,
.data-table td.col-stt {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   STATUS BADGES - PHONG CÁCH ẢNH 1 & 2 (KHỐI CHỮ NHẬT PHẲNG, KHÔNG CHẤM TRÒN)
   ========================================================================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
  border: none;
}

.badge::before {
  display: none !important;
  content: none !important;
}

/* Đã hủy: Nền đỏ sẫm chữ trắng như Ảnh 1 & 2 */
.badge-danger {
  background: var(--red) !important;
  color: var(--surface) !important;
}

/* Đang chờ xử lý: Nền vàng hổ phách chữ trắng như Ảnh 1 & 2 */
.badge-warning {
  background: var(--amber) !important;
  color: var(--surface) !important;
}

/* Hoàn thành / Đã duyệt: Nền xanh lá chữ trắng */
.badge-success {
  background: var(--green) !important;
  color: var(--surface) !important;
}

.badge-info {
  background: var(--blue) !important;
  color: var(--surface) !important;
}

.badge-primary {
  background: var(--accent) !important;
  color: var(--surface) !important;
}

.badge-outline {
  background: var(--surface) !important;
  color: var(--sidebar-text) !important;
  border: 1px solid var(--border-hover) !important;
}

/* Badge sàn TMĐT ở menu điều hướng — cùng kiểu nền đặc/chữ trắng như badge-danger (Shopee),
   chỉ đổi màu theo thương hiệu từng sàn để đồng bộ trực quan giữa 3 mục Shopee/TikTok/Lazada. */
.badge-tiktok {
  background: #000000 !important;
  color: var(--surface) !important;
}

.badge-lazada {
  background: #0F146D !important;
  color: var(--surface) !important;
}

.id-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 6px;
  display: inline-block;
}

/* Ảnh 4: Top Summary Pills */
.stat-pill-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-pill {
  border-radius: 6px;
  padding: 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-pill-label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-pill-value {
  font-size: 18px;
  font-weight: 700;
}

.stat-pill-soft-orange {
  background: #FFF2E8;
  border: 1.5px solid #FFBB96;
  color: #D4380D;
}

.stat-pill-solid-orange {
  background: #FF5722;
  color: var(--surface);
  border: 1px solid #FF5722;
}

/* Lưới Thống Kê Ô Màu Pastel Viền Sắc Nét */
.stats-pastel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .stats-pastel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-pastel-grid {
    grid-template-columns: 1fr;
  }
}

.metric-box {
  border-radius: 6px;
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-box-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-box-value {
  font-size: 20px;
  font-weight: 700;
}

.metric-box-blue   { border: 1.5px solid #60A5FA; background: var(--blue-soft); color: #1E40AF; }
.metric-box-green  { border: 1.5px solid #4ADE80; background: var(--green-soft); color: #166534; }
.metric-box-orange { border: 1.5px solid #FB923C; background: #FFF7ED; color: #C2410C; }
.metric-box-purple { border: 1.5px solid #C084FC; background: var(--purple-soft); color: var(--purple); }
.metric-box-red    { border: 1.5px solid #F87171; background: var(--red-soft); color: var(--red); }
.metric-box-slate  { border: 1.5px solid #94A3B8; background: #F8FAFC; color: #334155; }

/* Article List Cell (Bài Viết) */
.article-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
}

.article-title-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-summary-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 360px;
}


/* Staff & User Styles */
.staff-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.staff-user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.staff-user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.staff-master-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.staff-user-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.action-buttons-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-table-action:disabled,
.btn-table-action[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Staff Action Popup Dropdown */
.staff-action-popup {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 4px;
  min-width: 175px;
  z-index: 1000;
  display: none;
}

.staff-action-popup.show {
  display: block;
}

.action-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.action-popup-item:hover {
  background: var(--bg);
}

.action-popup-item.text-danger {
  color: var(--text);
}

.action-popup-item.text-danger i,
.action-popup-item.text-danger svg {
  color: var(--red);
}

.action-popup-item.text-danger:hover {
  background: var(--red-soft);
}

.action-popup-item.text-success {
  color: var(--text);
}

.action-popup-item.text-success i,
.action-popup-item.text-success svg {
  color: var(--green);
}

.action-popup-item.text-success:hover {
  background: var(--green-soft);
}

.action-popup-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-popup-item.disabled:hover {
  background: transparent;
}

.action-popup-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Nút tóm tắt mở popup chọn quyền (trong form chính) */
.staff-perms-summary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.staff-perms-summary-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.staff-perms-summary-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.staff-perms-summary-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.staff-perms-summary-edit i,
.staff-perms-summary-edit svg {
  width: 14px;
  height: 14px;
}

/* Staff Permissions Checkbox Grid (trong popup Chọn Quyền riêng) */
.staff-perms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 2px;
}

.perm-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.perm-checkbox-item:hover {
  border-color: var(--border-hover);
  background: var(--bg);
}

.perm-checkbox-item.checked {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.perm-checkbox-item input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.perm-checkbox-text {
  flex: 1;
  min-width: 0;
}

.perm-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.perm-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

@media (max-width: 540px) {
  .staff-perms-grid {
    grid-template-columns: 1fr;
  }
}



/* Staff Role Badges (Bỏ dấu chấm màu ::before, chỉ hiển thị icon và tên vai trò) */
.badge-role-super,
.badge-role-admin,
.badge-role-finance,
.badge-role-support,
.badge-role-operations {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
}

.badge-role-super::before,
.badge-role-admin::before,
.badge-role-finance::before,
.badge-role-support::before,
.badge-role-operations::before {
  display: none !important;
}

.badge-role-super {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.badge-role-admin {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #BFDBFE;
}

.badge-role-finance {
  background: var(--green-soft);
  color: var(--green-hover);
  border: 1px solid #A7F3D0;
}

.badge-role-support {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #BBF7D0;
}

.badge-role-operations {
  background: var(--amber-soft);
  color: #D97706;
  border: 1px solid var(--amber-border);
}

/* Ảnh đại diện nhân sự trong modal Thêm/Sửa — bố cục kiểu trang profile:
   avatar tròn lớn ở giữa, nút máy ảnh nổi ở góc để đổi ảnh */
.staff-avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.staff-avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
}

.staff-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  border: 2.5px solid var(--accent-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.role-desc-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* Modal "Thêm/Chỉnh Sửa Nhân Sự": phóng to & đồng bộ phong cách thẻ pastel
   dùng chung của app (giống .user-kpi-card / .metric-box) */
.modal-staff-card .modal-header {
  padding: 14px 24px;
}

.modal-staff-card .modal-title {
  font-size: 18px;
}

.modal-staff-card .modal-body {
  padding: 18px 24px;
}

.modal-staff-card .form-group {
  margin-bottom: 12px;
}

.modal-staff-card .form-group label {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 3px;
}

.modal-staff-card .form-group input,
.modal-staff-card .form-group select {
  font-size: 14.5px;
  padding: 9px 14px;
  border-radius: 10px;
  height: 42px;
}

.modal-staff-card .form-group textarea {
  font-size: 14.5px;
  padding: 11px 14px;
  border-radius: 10px;
}

.modal-staff-card .role-desc-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-left: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.modal-staff-card .staff-perms-summary-btn {
  padding: 10px 16px;
  border-radius: 10px;
  height: 42px;
}

.modal-staff-card .staff-perms-summary-text {
  font-size: 14px;
}

.modal-staff-card .modal-footer {
  padding: 16px 24px;
}

.modal-staff-card .btn {
  font-size: 14px;
  padding: 10px 20px;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  height: 36px;
  box-sizing: border-box;
  text-decoration: none;
}

.btn i, .btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
  border-radius: 4px;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--green);
  color: var(--surface);
  border-radius: 4px;
}
.btn-success:hover {
  background: var(--green-hover);
}

.btn-danger {
  background: var(--red);
  color: var(--surface);
  border-radius: 4px;
}
.btn-danger:hover {
  background: var(--red-hover);
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  color: #374151;
  border-radius: 4px;
}
.btn-outline:hover {
  background: var(--bg);
  border-color: var(--text-dim);
  color: var(--text);
}

.btn-outline.text-danger:hover {
  background: var(--red) !important;
  color: #FFFFFF !important;
  border-color: var(--red) !important;
}
.btn-outline.text-danger:hover i,
.btn-outline.text-danger:hover svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}

.btn-revoke-session {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid #FECACA;
  color: #DC2626;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-revoke-session i,
.btn-revoke-session svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  transition: stroke 0.2s ease;
}
.btn-revoke-session:hover {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}
.btn-revoke-session:hover i,
.btn-revoke-session:hover svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}
.btn-revoke-session:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-outline-danger {
  background: #FFFFFF;
  border: 1px solid #FECDD3;
  color: #E11D48;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  height: 36px;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-outline-danger i,
.btn-outline-danger svg {
  width: 15px;
  height: 15px;
  stroke: #E11D48;
  transition: stroke 0.2s ease;
}
.btn-outline-danger:hover {
  background: #E11D48 !important;
  border-color: #E11D48 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(225, 29, 72, 0.28);
  transform: translateY(-1px);
}
.btn-outline-danger:hover i,
.btn-outline-danger:hover svg {
  stroke: #FFFFFF !important;
}
.btn-outline-danger:active {
  transform: translateY(0);
  box-shadow: none;
}


.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  height: 28px;
  border-radius: 4px;
}

/* Action buttons in tables */
.btn-table-action {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-table-action:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-table-action.btn-danger-hover:hover {
  background: var(--red-soft);
  border-color: var(--red-border);
  color: var(--red);
}

/* Form Inputs */
.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea,
.filter-group select,
.form-group select,
.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  height: 36px;
}

textarea,
.form-group textarea {
  height: auto;
  min-height: 70px;
}

input:focus,
textarea:focus,
select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

/* ==========================================================================
   MODALS & TOAST
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.modal-sm {
  max-width: 380px;
}

/* Nguyên nhân thật sự khiến popup không cuộn/vuốt được: một số modal bọc
   .modal-body + .modal-footer trong <form>, nhưng <form> không tự thừa
   hưởng flex layout của .modal-card, nên .modal-body{flex:1} vô tác dụng
   và toàn bộ nội dung dư ra bị .modal-card{overflow:hidden} cắt cụt, không
   cách nào cuộn xuống nút Lưu. Ép <form> làm flex container để truyền đúng
   layout xuống bên trong. */
.modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
}

.toast.toast-success { border-left: 4px solid var(--green); }
.toast.toast-danger  { border-left: 4px solid var(--red); }
.toast.toast-info    { border-left: 4px solid var(--accent); }

/* Page Footer */
.admin-page-footer {
  text-align: center;
  padding: 28px 0 16px;
  font-size: 12px;
  color: var(--text-dim);
}

.admin-page-footer strong {
  color: var(--text-muted);
}

.admin-page-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* User Detail Modal - Clean & Comprehensive */
.modal-card.modal-lg {
  max-width: 820px;
}

#modal-user-detail .modal-card.modal-lg {
  max-width: 1220px;
  max-height: 95vh;
}

.user-modal-profile {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.user-modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  object-fit: cover;
}

.user-modal-info {
  flex: 1;
  min-width: 0;
}

.user-modal-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.user-modal-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-modal-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.user-modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 13px;
}

.user-modal-meta-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.user-modal-meta-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-modal-meta-value {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* KPI Cards Grid (6 ô ở trang Chi Tiết Thành Viên) */
.user-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.user-kpi-card {
  border-radius: 12px;
  padding: 12px 14px;
}

/* Đồng bộ với kiểu thẻ số liệu của modal "Sửa Số Dư Ví Thành Viên"
   (nền + viền rgba nhạt cùng tông màu, bo góc 12px) */
.user-kpi-card.kpi-success { background: rgba(16, 185, 129, 0.06); border: 1px solid rgba(16, 185, 129, 0.2); }
.user-kpi-card.kpi-warning { background: rgba(245, 158, 11, 0.06); border: 1px solid rgba(245, 158, 11, 0.2); }
.user-kpi-card.kpi-primary { background: rgba(59, 130, 246, 0.06); border: 1px solid rgba(59, 130, 246, 0.2); }
.user-kpi-card.kpi-accent  { background: rgba(139, 92, 246, 0.06); border: 1px solid rgba(139, 92, 246, 0.2); }
.user-kpi-card.kpi-indigo  { background: rgba(99, 102, 241, 0.06); border: 1px solid rgba(99, 102, 241, 0.2); }
.user-kpi-card.kpi-pink    { background: rgba(236, 72, 153, 0.06); border: 1px solid rgba(236, 72, 153, 0.2); }

.user-kpi-card.kpi-success .user-kpi-val { color: #10b981; }
.user-kpi-card.kpi-warning .user-kpi-val { color: #f59e0b; }
.user-kpi-card.kpi-primary .user-kpi-val { color: #3b82f6; }
.user-kpi-card.kpi-accent  .user-kpi-val { color: #8b5cf6; }
.user-kpi-card.kpi-indigo  .user-kpi-val { color: #6366f1; }
.user-kpi-card.kpi-pink    .user-kpi-val { color: #ec4899; }

.user-kpi-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.user-kpi-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

.user-kpi-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Modal Sub-navigation Tabs */
.modal-subnav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.modal-subnav-btn {
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.modal-subnav-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.modal-subnav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

/* Mini Table inside Modal */
.mini-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.mini-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.mini-table tbody tr:last-child td {
  border-bottom: none;
}

.mini-table tbody tr:hover {
  background: var(--bg);
}

/* Bank Account Card */
.bank-accounts-section {
  margin-bottom: 18px;
}

.section-clean-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.bank-account-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.bank-account-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.bank-account-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}

.bank-account-holder {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Balance adjustment clean form */
.balance-adjust-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.balance-adjust-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .user-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
}

/* ==========================================================================
   VIETQR MODAL STYLING
   ========================================================================== */
.qr-code-box {
  width: 210px;
  height: 210px;
  margin: 0 auto 16px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qr-code-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.vietqr-info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
}

.vietqr-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.vietqr-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.vietqr-info-val {
  color: var(--text);
  font-weight: 600;
}

.vietqr-account-mono {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  letter-spacing: 0.3px;
}

.copy-tiny-btn {
  display: none !important;
}

/* ==========================================================================
   CONFIRM MODAL (Xóa / Gửi thông báo) — icon tròn lớn + khung tên đối tượng
   ========================================================================== */
.confirm-modal.modal-sm {
  position: relative;
  max-width: 460px;
  overflow: hidden;
}

.confirm-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.confirm-modal-body {
  padding: 30px 26px 22px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.confirm-modal-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.confirm-modal-icon i,
.confirm-modal-icon svg {
  width: 26px;
  height: 26px;
}

.confirm-icon-danger {
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon-success {
  background: #D1FAE5;
  color: var(--green-hover);
}

.confirm-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.confirm-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 300px;
}

.confirm-modal-target {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
}

.confirm-modal-target i,
.confirm-modal-target svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.55;
}

.confirm-modal-footer {
  padding: 16px 26px 26px !important;
  border-top: none !important;
  gap: 10px;
}

.confirm-modal-footer .btn {
  flex: 1;
  justify-content: center;
  height: 38px;
}

/* ==========================================================================
   UNIFIED NOTIFICATION FILTER PANEL - ULTRA PREMIUM SAAS REDESIGN
   ========================================================================== */
.notif-filter-panel {
  background: var(--surface, var(--surface));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  margin-bottom: 20px;
  position: sticky;
  top: 68px;
  z-index: 25;
}

/* Row 1: Segmented Tabs + Search + Action Buttons */
.notif-filter-row-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg);
}

.notif-filter-panel .notif-status-tabs {
  margin-bottom: 0;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.notif-filter-panel .notif-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 36px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.notif-filter-panel .notif-tab-btn i,
.notif-filter-panel .notif-tab-btn svg {
  width: 14px;
  height: 14px;
}

.notif-filter-panel .notif-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.notif-filter-panel .notif-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.notif-filter-panel .notif-tab-btn.active#tab-notif-draft-scheduled {
  color: var(--amber-hover);
}

.notif-filter-panel .notif-tab-btn.active#tab-notif-sent {
  color: var(--green-hover);
}

.notif-filter-panel .notif-tab-btn.active#tab-notif-all {
  color: var(--accent-hover);
}

.notif-filter-panel .tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 10px;
  line-height: 1.2;
}

.badge-draft-sched {
  background: var(--amber-soft);
  color: var(--amber-hover);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-sent {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-all {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

/* Search Box */
.notif-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.notif-search-box input {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 36px;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}

.notif-search-box input::placeholder {
  color: var(--text-dim);
  font-size: var(--text-sm);
}

.notif-search-box input:focus {
  background: var(--surface);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.notif-search-box i,
.notif-search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 11px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 17px;
  cursor: pointer;
  display: none;
  line-height: 1;
}

.search-clear-btn:hover {
  color: var(--text);
}

/* Action Buttons */
.notif-filter-btns {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-create-notif {
  height: 36px;
  padding: 0 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  border: none;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.btn-create-notif:hover {
  background: var(--accent-hover);
}

/* Row 2: Secondary Filter Controls */
.notif-filter-row-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.notif-dropdowns-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Sleek Select Dropdown */
.sleek-filter-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px 0 12px;
  height: 38px;
  transition: all 0.15s ease;
}

.sleek-filter-item:hover {
  border-color: var(--border-hover);
  background: var(--surface);
}

.sleek-filter-item:focus-within {
  border-color: var(--accent-hover);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.sleek-filter-item .field-icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 7px;
}

.sleek-filter-item select {
  height: 100%;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  outline: none;
  cursor: pointer;
  padding-right: 4px;
}

#filter-notif-type {
  width: 140px;
}

#filter-notif-status {
  width: 180px;
}

#filter-user-status {
  width: 152px;
}

#filter-user-balance {
  width: 142px;
}

#filter-user-sort {
  width: 172px;
}

#filter-order-status {
  width: 175px;
}

.user-filter-panel .notif-search-box {
  flex: 0 1 260px;
  max-width: 260px;
  min-width: 160px;
}

.order-filter-panel .notif-search-box {
  flex: 0 1 300px;
  max-width: 300px;
  min-width: 180px;
}

.user-filter-panel .notif-filter-row-primary,
.order-filter-panel .notif-filter-row-primary {
  flex-wrap: nowrap;
}

@media (max-width: 1180px) {
  .user-filter-panel .notif-filter-row-primary,
  .order-filter-panel .notif-filter-row-primary {
    flex-wrap: wrap;
  }
}

/* Bộ lọc Bài viết & Thông báo: gộp toàn bộ vào 1 hàng — ô tìm kiếm co giãn lấp khoảng trống, nút tạo mới
   dạt về cuối; màn hình hẹp thì tự xuống dòng */
.article-filter-panel .notif-filter-row-primary,
.broadcast-filter-panel .notif-filter-row-primary {
  flex-wrap: nowrap;
  gap: 10px;
  padding-bottom: 0;
  border-bottom: none;
}

.article-filter-panel .notif-search-box,
.broadcast-filter-panel .notif-search-box {
  flex: 1 1 180px;
  min-width: 160px;
}

.article-filter-panel .notif-filter-row-primary > *,
.broadcast-filter-panel .notif-filter-row-primary > * {
  flex-shrink: 0;
}

.article-filter-panel .notif-filter-row-primary > .notif-search-box,
.broadcast-filter-panel .notif-filter-row-primary > .notif-search-box {
  flex-shrink: 1;
}

.article-filter-panel .notif-filter-btns,
.broadcast-filter-panel .notif-filter-btns {
  margin-left: auto;
}

@media (max-width: 1360px) {
  .article-filter-panel .notif-filter-row-primary,
  .broadcast-filter-panel .notif-filter-row-primary {
    flex-wrap: wrap;
  }
}

/* Date Range Capsule */
.sleek-date-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  height: 36px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.sleek-date-capsule:hover {
  border-color: var(--border-hover);
  background: var(--surface);
}

.sleek-date-capsule:focus-within {
  border-color: var(--accent-hover);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.sleek-date-capsule .capsule-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sleek-date-capsule .capsule-date-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  outline: none;
  cursor: pointer;
  padding: 0;
  width: 124px;
}

.sleek-date-capsule .capsule-arrow {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  user-select: none;
}

/* Presets Segmented Group */
.sleek-presets-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2.5px;
  height: 36px;
  gap: 2px;
}

.sleek-presets-group .date-preset-chip {
  height: 30px;
  padding: 0 11px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.sleek-presets-group .date-preset-chip:hover {
  color: var(--text);
}

.sleek-presets-group .date-preset-chip.active {
  background: var(--surface);
  color: var(--accent-hover);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Count Pill Badge */
.notif-count-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.notif-count-pill .count-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.notif-count-pill strong {
  color: var(--text);
  font-weight: 700;
  font-size: var(--text-sm);
}



/* ==============================================================================
 * ADMIN BOTTOM NAVIGATION & MOBILE DRAWER (KHI GIAO DIỆN NHỎ CHUYỂN XUỐNG DƯỚI)
 * ============================================================================== */
.admin-bottom-nav {
  display: none;
}

.btn-mobile-sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .btn-mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }

  .btn-mobile-sidebar-toggle:hover {
    background: var(--bg);
  }

  .btn-mobile-sidebar-toggle svg {
    width: 20px;
    height: 20px;
  }

  .admin-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 1050;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.05);
  }

  .admin-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .admin-bottom-nav-item svg {
    width: 21px;
    height: 21px;
    stroke-width: 2;
    transition: transform 0.15s ease;
  }

  .admin-bottom-nav-item:hover,
  .admin-bottom-nav-item.active {
    color: var(--primary);
  }

  .admin-bottom-nav-item.active svg {
    stroke-width: 2.3;
    transform: translateY(-1px);
  }

  .content-body {
    padding-bottom: 78px !important;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
    display: block;
  }

  .sidebar {
    z-index: 1200 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }
}

/* ==============================================================================
   MAINTENANCE MODE & SYSTEM TOGGLES
   ========================================================================== */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-hover);
  transition: 0.25s ease;
  border-radius: 28px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--red); /* Cảnh báo đỏ nổi bật khi bảo trì đang bật */
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(24px);
}

/* Biến thể xanh cho các toggle mang nghĩa "Bật = tích cực" (VD: hiển thị kênh), khác với
   toggle Bảo trì ở trên (Bật = cảnh báo đỏ) */
.switch-toggle.toggle-positive input:checked + .switch-slider {
  background-color: var(--green);
}

/* Persistent Admin Top Maintenance Banner */
.maintenance-admin-banner {
  background: var(--amber-soft);
  border-bottom: 1.5px solid var(--amber-border);
  color: var(--amber-hover);
  padding: 10px 24px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  position: relative;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.maintenance-admin-banner-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.maintenance-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.maintenance-banner-left i {
  color: #d97706;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.maintenance-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-banner-off {
  background: var(--red);
  color: var(--surface);
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-banner-off:hover {
  background: var(--red);
}

.btn-banner-settings {
  background: var(--surface);
  border: 1px solid #d97706;
  color: var(--amber-hover);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-banner-settings:hover {
  background: var(--amber-soft);
}



/* ==========================================================================
   NOTIFICATION MODAL — HEADER, FORM & SCHEDULE PANEL
   ========================================================================== */
.notif-modal-card {
  max-height: 92vh;
}

.notif-modal-header {
  align-items: flex-start !important;
  gap: 12px;
  padding: 18px 20px !important;
}

.notif-modal-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-modal-header-icon i,
.notif-modal-header-icon svg {
  width: 19px;
  height: 19px;
}

.notif-modal-header-text {
  flex: 1;
  min-width: 0;
}

.notif-modal-header-text .modal-title {
  margin-bottom: 2px;
}

.notif-modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.notif-modal-body {
  padding: 18px 20px !important;
}

.notif-form-group {
  margin-bottom: 16px !important;
}

.notif-form-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.notif-form-label i,
.notif-form-label svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  flex-shrink: 0;
}

.notif-select {
  font-size: 12.5px;
  height: 36px;
}

.notif-char-count {
  align-self: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Schedule Time Panel */
.notif-schedule-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.notif-schedule-panel.notif-schedule-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.notif-schedule-inputs {
  display: flex;
  gap: 8px;
}

.notif-schedule-input {
  height: 36px;
  font-size: 12.5px;
  background: var(--surface) !important;
  border: 1px solid var(--border-hover) !important;
  border-radius: 6px;
}

.notif-schedule-time-input {
  flex: 0 0 110px;
}

.notif-schedule-date-input {
  flex: 1;
  min-width: 0;
}

.notif-schedule-input:focus {
  border-color: var(--accent) !important;
}

.notif-schedule-panel.notif-schedule-error .notif-schedule-input {
  border-color: var(--red-border) !important;
}

.notif-schedule-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.notif-schedule-hint[hidden] {
  display: none !important;
}

.notif-schedule-hint i,
.notif-schedule-hint svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.notif-schedule-panel.notif-schedule-error .notif-schedule-hint {
  color: var(--red);
}

/* ==========================================================================
   NOTIFICATION MODAL ACTION BUTTONS (LƯU NHÁP, LÊN LỊCH, GỬI NGAY)
   ========================================================================== */
.notif-modal-footer {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  padding: 12px 18px !important;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.notif-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-modal-footer .btn {
  height: 36px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.notif-modal-footer .btn i,
.notif-modal-footer .btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Cả 3 nút dùng chung kiểu pastel viền màu (giống badge phân loại/trạng thái trong bảng), chỉ khác màu */
.btn-notif-draft,
.btn-notif-schedule,
.btn-notif-send {
  border: 1px solid transparent !important;
}

/* 1. Nút Lưu Nháp (Draft) — Slate, đồng bộ với badge-status-draft */
.btn-notif-draft {
  background: rgba(148, 163, 184, 0.14) !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
  color: var(--text-muted) !important;
}
.btn-notif-draft:hover {
  background: rgba(148, 163, 184, 0.22) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
}
/* 2. Nút Lên Lịch (Schedule) — Amber, đồng bộ với badge-status-scheduled (nhạt hơn vì amber vốn "nịch" hơn xanh/xám ở cùng độ mờ) */
.btn-notif-schedule {
  background: rgba(245, 158, 11, 0.05) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  color: var(--amber-hover) !important;
}
.btn-notif-schedule:hover {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: var(--amber-hover) !important;
}
/* 3. Nút Gửi Ngay (Send) — Green, đồng bộ với badge-status-sent */
.btn-notif-send {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: var(--green-hover) !important;
}
.btn-notif-send:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
}

/* ==========================================================================
   UPGRADED ORDERS FILTER PANEL
   ========================================================================== */
.order-filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 18px;
}

/* Quick Date Presets */
.date-preset-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.date-preset-chip:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-hover);
}

.date-preset-chip.active {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
  font-weight: 600;
}



.tab-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  line-height: 1;
}

/* Notification Status Tabs (2 tag phân loại: Nháp & Lên lịch [Mặc định] vs Đã Gửi) */
.notif-status-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow-x: auto;
}

.notif-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  height: 34px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.notif-tab-btn i,
.notif-tab-btn svg {
  width: 15px;
  height: 15px;
}

.notif-tab-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.notif-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.notif-tab-btn.active#tab-notif-draft-scheduled {
  color: #D97706;
  border-color: rgba(217, 119, 6, 0.3);
  background: var(--amber-soft);
}

.notif-tab-btn.active#tab-notif-sent {
  color: var(--green-hover);
  border-color: rgba(5, 150, 105, 0.3);
  background: var(--green-soft);
}

.notif-tab-btn.active#tab-notif-all {
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.3);
  background: var(--accent-soft);
}

/* ==========================================================================
   WITHDRAWAL STATUS TABS & FILTER PANEL
   ========================================================================== */
.withdrawal-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.withdrawal-tab-btn i,
.withdrawal-tab-btn svg {
  width: 16px;
  height: 16px;
}

.withdrawal-tab-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.withdrawal-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.withdrawal-tab-btn.active#tab-w-pending {
  color: #D97706;
  border-color: rgba(217, 119, 6, 0.35);
}

.withdrawal-tab-btn.active#tab-w-approved {
  color: var(--green-hover);
  border-color: rgba(5, 150, 105, 0.35);
}

.withdrawal-tab-btn.active#tab-w-rejected {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.35);
}

.withdrawal-tab-btn.active#tab-w-all {
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.35);
}

.withdrawal-tab-btn.active#tab-fb-new {
  color: #D97706;
  border-color: rgba(217, 119, 6, 0.35);
}

.withdrawal-tab-btn.active#tab-fb-reviewed {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.35);
}

.withdrawal-tab-btn.active#tab-fb-resolved {
  color: var(--green-hover);
  border-color: rgba(5, 150, 105, 0.35);
}

.withdrawal-tab-btn.active#tab-fb-all {
  color: var(--accent);
  border-color: rgba(79, 70, 229, 0.35);
}

/* Bộ lọc Rút Tiền đồng bộ 2 hàng chuẩn SaaS với ".notif-filter-panel" */
.withdrawal-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-w-pending {
  color: var(--amber-hover);
}
.withdrawal-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-w-approved {
  color: var(--green-hover);
}
.withdrawal-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-w-rejected {
  color: var(--red);
}
.withdrawal-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-w-all {
  color: var(--accent-hover);
}

/* Bộ lọc Góp Ý đồng bộ 2 hàng chuẩn SaaS với ".notif-filter-panel" */
.feedback-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-fb-new {
  color: var(--amber-hover);
}
.feedback-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-fb-reviewed {
  color: var(--blue);
}
.feedback-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-fb-resolved {
  color: var(--green-hover);
}
.feedback-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-fb-all {
  color: var(--accent-hover);
}

/* Bộ lọc Bài Viết đồng bộ 2 hàng chuẩn SaaS với ".notif-filter-panel" */
.article-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-art-published {
  color: var(--green-hover);
}
.article-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-art-draft {
  color: var(--amber-hover);
}
.article-filter-panel .notif-status-tabs .notif-tab-btn.active#tab-art-all {
  color: var(--accent-hover);
}


.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-gray {
  background: var(--text-dim);
}

/* ============ Soạn Bài Viết kiểu WYSIWYG (y hệt giao diện Xem Trước ngoài App) ============ */
.article-edit-body {
  padding: 0 !important;
  max-height: 78vh;
}

.article-edit-banner {
  width: 100%;
  background: #f8fafc;
}

.article-edit-banner-img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.article-edit-banner-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.article-edit-banner-url i {
  width: 15px;
  height: 15px;
  color: #94a3b8;
  flex-shrink: 0;
}

.article-edit-banner-url input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: #475569;
  outline: none;
  padding: 4px 0;
  font-family: inherit;
}

.article-edit-content-area {
  padding: 22px 24px 28px 24px;
}

.article-edit-tag-select {
  display: inline-block;
  background: var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230284C7' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--blue);
  padding: 4px 28px 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  outline: none;
  cursor: pointer;
  margin-bottom: 12px;
  appearance: none;
  -webkit-appearance: none;
}

.article-edit-tag-select:focus {
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.article-edit-title-input {
  display: block;
  width: 100%;
  font-size: 18.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  border: none;
  outline: none;
  background: transparent;
  padding: 4px 0;
  margin: 0 0 10px 0;
  font-family: inherit;
  border-radius: 6px;
}

.article-edit-title-input::placeholder {
  color: #cbd5e1;
  font-weight: 700;
}

.article-edit-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

.article-edit-date-row i {
  width: 15px;
  height: 15px;
  color: #64748b;
}

.article-edit-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 16px 0;
}

.article-edit-summary-input {
  display: block;
  width: 100%;
  background: #fffbeb;
  border: none;
  border-left: 3.5px solid #ee4d2d;
  padding: 12px 14px;
  border-radius: 4px 10px 10px 4px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #d97706;
  line-height: 1.5;
  outline: none;
  resize: none;
  overflow: hidden;
  font-family: inherit;
}

.article-edit-summary-input::placeholder {
  color: #d97706;
  opacity: 0.55;
  font-weight: 500;
}

.article-edit-content-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: #334155;
  line-height: 1.65;
  resize: none;
  overflow: hidden;
  min-height: 120px;
  font-family: inherit;
  border-radius: 6px;
}

.article-edit-content-input::placeholder {
  color: #cbd5e1;
}

.article-edit-title-input:hover,
.article-edit-title-input:focus,
.article-edit-content-input:hover,
.article-edit-content-input:focus {
  background: #f8fafc;
}

.article-edit-summary-input:hover,
.article-edit-summary-input:focus {
  background: #fef3c7;
}

/* ==============================================================================
   ADMIN PAGINATION BAR (Kiểu tối giản: < 1 2 3 4 5 ... 774 >)
   ============================================================================== */
.orders-pagination-bar,
.admin-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
  user-select: none;
}

.orders-page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.orders-page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 6px 8px;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, opacity 0.15s ease;
  line-height: 1;
}

.orders-page-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}

.orders-page-arrow:hover:not(:disabled) {
  color: var(--accent, #EE4D2D);
}

.orders-page-arrow:disabled {
  color: var(--text-dim, #9CA3AF);
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.orders-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text, #374151);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease;
  line-height: 1;
}

.orders-page-num:hover:not(.active) {
  color: var(--accent, #EE4D2D);
}

.orders-page-num.active {
  color: var(--accent, #EE4D2D);
  font-weight: 700;
  cursor: default;
  pointer-events: none;
}

.orders-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 28px;
  color: var(--text-dim, #9CA3AF);
  font-size: 14px;
  letter-spacing: 2px;
  cursor: default;
  user-select: none;
  line-height: 1;
}

@media (max-width: 640px) {
  .orders-pagination-bar,
  .admin-pagination-bar {
    gap: 12px;
    padding: 12px 14px;
    overflow-x: auto;
  }
  .orders-page-numbers {
    gap: 10px;
  }
  .orders-page-num {
    min-width: 24px;
    font-size: 14px;
  }
}

/* ==============================================================================
   CUSTOM CONFIRMATION MODAL (Thay thế hoàn toàn window.confirm mặc định)
   ============================================================================== */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.confirm-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-card {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 28px 24px 24px;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.confirm-modal-overlay.active .confirm-modal-card {
  opacity: 1;
}

.confirm-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.confirm-modal-icon.danger {
  background: #FEE2E2;
  border: 6px solid #FEF2F2;
  color: #DC2626;
}

.confirm-modal-icon.warning {
  background: #FEF3C7;
  border: 6px solid #FFFBEB;
  color: #D97706;
}

.confirm-modal-icon.primary {
  background: #EFF6FF;
  border: 6px solid #F0FDF4;
  color: #2563EB;
}

.confirm-modal-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.confirm-modal-title {
  font-size: 18.5px;
  font-weight: 700;
  color: var(--text, #0F172A);
  margin: 0 0 10px 0;
  line-height: 1.35;
}

.confirm-modal-message {
  font-size: 14.5px;
  color: var(--text-muted, #475569);
  line-height: 1.6;
  margin: 0 0 14px 0;
}

.confirm-modal-message strong {
  color: var(--text, #0F172A);
  font-weight: 700;
}

.confirm-modal-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #991B1B;
  text-align: left;
  line-height: 1.45;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.confirm-modal-sub.warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.confirm-modal-sub.primary,
.confirm-modal-sub.info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}

.confirm-modal-sub svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.confirm-modal-btn {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
}

.confirm-modal-btn.btn-cancel {
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #CBD5E1);
  color: var(--text, #334155);
}

.confirm-modal-btn.btn-cancel:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

.confirm-modal-btn.btn-confirm-danger {
  background: #DC2626;
  border: 1px solid #DC2626;
  color: #FFFFFF;
}

.confirm-modal-btn.btn-confirm-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

.confirm-modal-btn.btn-confirm-warning {
  background: #D97706;
  border: 1px solid #D97706;
  color: #FFFFFF;
}

.confirm-modal-btn.btn-confirm-warning:hover {
  background: #B45309;
  border-color: #B45309;
}

.confirm-modal-btn.btn-confirm-primary {
  background: var(--accent, #EE4D2D);
  border: 1px solid var(--accent, #EE4D2D);
  color: #FFFFFF;
}

.confirm-modal-btn.btn-confirm-primary:hover {
  background: var(--accent-hover, #D73211);
  border-color: var(--accent-hover, #D73211);
}
