:root {
  --primary: #b91c1c;
  --primary-hover: #991b1b;
  --primary-light: #fef2f2;
  --secondary: #0f172a;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header - Ẩn thanh banner đỏ theo yêu cầu */
.app-header {
  display: none !important;
}

.header-container {
  width: 100%;
  max-width: 100%;
  padding: 0 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* GDT Menu Bar Styling (Sticky Menu Bar chạy theo khi cuộn trang) */
.gdt-menubar {
  background: #fbf6ef;
  border-bottom: 2px solid #e2d2bd;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;
}

.menubar-container {
  width: 100%;
  max-width: 100%;
  padding: 0 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  overflow: visible;
}

.menu-item {
  position: relative;
  display: inline-block;
}

.menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #5c3813;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  border-radius: 6px;
  white-space: nowrap;
}

.menu-btn:hover {
  background: #f1e4d3;
  color: #873600;
}

.menu-item.active .menu-btn {
  color: #933c04;
  background: #f3e6d6;
  border-bottom: 2px solid #b45309;
  border-radius: 6px 6px 0 0;
}

.menu-icon {
  width: 15px;
  height: 15px;
  color: #b45309;
  flex-shrink: 0;
}

.menu-arrow {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.menu-item:hover .menu-arrow,
.menu-item.open .menu-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  min-width: 260px;
  padding: 8px 0;
  display: none;
  flex-direction: column;
  z-index: 99999;
  animation: dropdownFadeIn 0.12s ease-out forwards;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-item:hover .dropdown-menu,
.menu-item.open .dropdown-menu {
  display: flex;
}

.dropdown-link {
  padding: 9px 20px;
  font-size: 0.88rem;
  color: #334155;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  line-height: 1.45;
  font-weight: 400;
  cursor: pointer;
}

.dropdown-link:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Menu con khi được chọn chuẩn Hình 3: có icon check xanh, chữ in đậm, nền trong suốt/trắng */
.dropdown-link.active {
  background: transparent;
  color: #0f172a;
  font-weight: 700;
}

.dropdown-link.active::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}

@media (max-width: 900px) {
  .menubar-container {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .menubar-container::-webkit-scrollbar {
    display: none;
  }
}

/* Navbar User Section & Logout Button (Góc phải menu bar) */
.navbar-user-section {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding-left: 0.75rem;
}

.navbar-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  background: #ffffff;
  border: 1px solid #dfc7af;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #873600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-user-icon {
  width: 15px;
  height: 15px;
  color: #b45309;
}

.btn-logout-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  background: #ffffff;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-logout-nav:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

/* Centered Authentication Screen (Hiển thị chính giữa màn hình khi chưa đăng nhập) */
.auth-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fbf7f0 0%, #f4e9db 50%, #ebdcce 100%);
  padding: 1.5rem;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(135, 54, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #ebd9c5;
  padding: 2.25rem 2rem;
  box-sizing: border-box;
  animation: authCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  background: linear-gradient(135deg, #b91c1c 0%, #873600 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.85rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.28);
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #873600;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: #78716c;
  line-height: 1.4;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
}

.input-icon-wrapper .form-control {
  padding-left: 2.35rem;
  padding-right: 2.35rem;
}

.btn-pwd-eye {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  transition: color 0.15s;
}

.btn-pwd-eye:hover {
  color: #374151;
}

.btn-login-submit {
  height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  background: #873600 !important;
  border-color: #873600 !important;
  color: #ffffff !important;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  margin-top: 1.25rem;
  cursor: pointer;
}

.btn-login-submit:hover {
  background: #6e2c00 !important;
  border-color: #6e2c00 !important;
  box-shadow: 0 4px 14px rgba(135, 54, 0, 0.32);
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f3e8db;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #78716c;
}

/* ==========================================================================
   GDT TAX PORTAL STYLE (TRA CỨU & BẢNG KẾT QUẢ CHUẨN CỔNG THUẾ)
   ========================================================================== */

/* 1. Tabs chuyển đổi bán ra / mua vào */
.gdt-query-tabs {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.gdt-query-tab-btn {
  background: #d8d8d8;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.gdt-query-tab-btn:hover {
  background: #e2e8f0;
}

.gdt-query-tab-btn.active {
  background: #ffffff;
  color: #873600;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #ffffff;
  border-top: 2px solid #873600;
  font-weight: 700;
  margin-bottom: -1px;
}

/* 1.1 Khung Tabs Thông báo từ CQT chuẩn Hình 2 & Hình 3 (Parallelogram Slanted Tabs + Nút Cuộn) */
.gdt-notice-tabs-wrapper {
  display: flex;
  align-items: stretch;
  position: relative;
  margin-bottom: -1px;
  z-index: 2;
  width: 100%;
  background: #cbd5e1;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.gdt-tabs-nav-btn {
  background: #f8fafc;
  border: none;
  color: #475569;
  width: 26px;
  min-width: 26px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s;
  user-select: none;
  z-index: 5;
}
.gdt-tabs-nav-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #873600;
}
.gdt-tabs-nav-btn:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
  background: #f1f5f9;
}
.gdt-tabs-nav-btn.prev {
  border-right: 1px solid #cbd5e1;
}
.gdt-tabs-nav-btn.next {
  border-left: 1px solid #cbd5e1;
}

.gdt-notice-types-bar {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scroll-behavior: smooth;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  background: #c8cbd0;
  padding: 0;
  margin: 0;
}
.gdt-notice-types-bar::-webkit-scrollbar {
  display: none;
}

.gdt-notice-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  background: #cfd3d8;
  border: none;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
  margin-right: -13px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 14px 100%);
}

.gdt-notice-tab-btn:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
}

.gdt-notice-tab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.gdt-notice-tab-btn.active {
  background: #ffffff !important;
  color: #873600 !important;
  font-weight: 700;
  z-index: 4;
}

.gdt-notice-tab-btn.active:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
}

/* 2. Banner tiêu đề */
.gdt-query-banner {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.gdt-query-banner-notch {
  width: 16px;
  height: 24px;
  background: #873600;
  clip-path: polygon(0 0, 100% 0, 65% 50%, 100% 100%, 0 100%);
  margin-right: 12px;
  flex-shrink: 0;
}

.gdt-query-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #212529;
  margin: 0;
}

/* 3. Form tìm kiếm 2 cột chuẩn GDT */
.gdt-search-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 1.25rem 2.25rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  width: 100%;
  box-sizing: border-box;
}

.gdt-search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
  row-gap: 0.75rem;
}

@media (max-width: 900px) {
  .gdt-search-grid {
    grid-template-columns: 1fr;
    column-gap: 1rem;
  }
}

.gdt-search-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gdt-search-field {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.gdt-field-label {
  width: 165px;
  min-width: 165px;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 500;
  margin: 0;
}

.gdt-req {
  color: #dc2626;
  font-weight: 700;
  margin-left: 2px;
}

.gdt-field-input,
.gdt-field-select {
  flex: 1;
  height: 32px;
  border: none;
  border-bottom: 1px solid #94a3b8;
  border-radius: 0;
  padding: 3px 6px;
  font-size: 0.84rem;
  color: #1e293b;
  background: transparent;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.gdt-field-input:focus,
.gdt-field-select:focus {
  outline: none;
  border-bottom: 2px solid #873600;
}

.gdt-field-checkbox-row {
  align-items: center;
}

.gdt-field-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #873600;
  margin: 0;
}

.gdt-daterange-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.gdt-date-sublabel {
  font-size: 0.8rem;
  color: #475569;
  white-space: nowrap;
}

.gdt-field-date {
  height: 30px;
  border: none;
  border-bottom: 1px solid #94a3b8;
  padding: 2px 4px;
  font-size: 0.82rem;
  color: #1e293b;
  box-sizing: border-box;
  width: 125px;
}

.gdt-field-date:focus {
  outline: none;
  border-bottom: 2px solid #873600;
}

.gdt-quick-period-select {
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.gdt-sub-pickers {
  margin-left: 165px;
  padding: 4px 0;
}

.gdt-search-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.gdt-btn-search,
.gdt-btn-reset,
.gdt-btn-export-search {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 20px;
  border: none;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #873600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 34px;
  transition: background 0.15s ease;
  white-space: nowrap;
  vertical-align: middle;
}

.gdt-btn-search:hover,
.gdt-btn-reset:hover,
.gdt-btn-export-search:hover {
  background: #6e2c00;
}

/* 4. Results Toolbar */
.gdt-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0 4px;
}

.gdt-toolbar-left {
  font-size: 0.85rem;
  color: #475569;
}

.gdt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gdt-tool-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.gdt-tool-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.gdt-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f8fafc;
}

.gdt-page-info {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  padding: 0 4px;
}

.gdt-pagesize-select {
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.8rem;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}

.gdt-toolbar-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.gdt-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.gdt-icon-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.gdt-icon-btn-excel:hover {
  color: #16a34a;
  border-color: #16a34a;
}

/* 5. Sub-tabs */
.gdt-sub-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.gdt-sub-tab {
  background: #dcdcdc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.gdt-sub-tab:hover {
  background: #e5e7eb;
}

.gdt-sub-tab.active {
  background: #ffffff;
  color: #873600;
  border: 1px solid #cbd5e1;
  border-bottom: 1px solid #ffffff;
  border-top: 2px solid #873600;
  font-weight: 700;
}

/* 6. Bảng kết quả chuẩn Cổng Thuế GDT */
.gdt-table-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0 4px 4px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  overflow: hidden;
  width: 100%;
}

/* Khung cuộn XY không gây giật / đẩy dữ liệu trong bảng */
.gdt-table-scroll-container {
  width: 100%;
  max-height: 540px; /* Chiều cao cố định cuộn dọc Y mượt mà */
  overflow-x: auto;  /* Cuộn ngang X */
  overflow-y: auto;  /* Cuộn dọc Y */
  overflow: overlay; /* Scrollbar nổi */
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  position: relative;
}

.gdt-table-scroll-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.gdt-table-scroll-container::-webkit-scrollbar-track {
  background: #f8fafc;
}
.gdt-table-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.gdt-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #873600;
}
.gdt-table-scroll-container::-webkit-scrollbar-corner {
  background: #f8fafc;
}

.gdt-invoices-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  background: #ffffff;
}

.gdt-invoices-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #eaeff5;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 18px 6px 18px !important;
  height: 48px !important;
  text-align: center !important;
  vertical-align: middle !important;
  line-height: 1.35;
  white-space: nowrap;
  border-right: 1px solid #cbd5e1;
  border-bottom: 2px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
}

.gdt-invoices-table thead th:first-child {
  border-left: 1px solid #cbd5e1;
}

.gdt-invoices-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 8px;
  font-size: 0.78rem;
  color: #1e293b;
  vertical-align: middle;
  line-height: 1.35;
}

.gdt-invoices-table td:first-child {
  border-left: 1px solid #e2e8f0;
}

.gdt-invoices-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.gdt-invoices-table tr:hover td {
  background-color: #f1f5f9;
}

/* Dòng được chọn (Click chọn dòng, click lại tắt) */
.gdt-invoices-table tr.selected td,
.gdt-invoices-table tr.selected-row td {
  background-color: #dbeafe !important;
  color: #1e3a8a !important;
}

.gdt-invoices-table tr.selected-row {
  outline: 1.5px solid #3b82f6;
  outline-offset: -1.5px;
}

/* Nút ghim / đóng băng cột trên từng tiêu đề th */
.th-pin-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  transition: all 0.15s ease;
  z-index: 2;
}

.gdt-invoices-table thead th:hover .th-pin-btn {
  opacity: 0.85;
}

.th-pin-btn:hover {
  opacity: 1 !important;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
}

.th-pin-btn.pinned {
  opacity: 1 !important;
  color: #2563eb !important;
  background: #bfdbfe !important;
}

/* Cột đang được đóng băng (Ghim khi trượt ngang) */
.gdt-invoices-table th.col-frozen {
  position: sticky !important;
  z-index: 15 !important;
  background-color: #e2e8f0 !important;
}

.gdt-invoices-table td.col-frozen {
  position: sticky !important;
  z-index: 5 !important;
  background-color: #ffffff !important;
}

.gdt-invoices-table tbody tr:hover td.col-frozen {
  background-color: #f1f5f9 !important;
}

.gdt-invoices-table tbody tr.selected-row td.col-frozen,
.gdt-invoices-table tbody tr.selected td.col-frozen {
  background-color: #dbeafe !important;
}

.gdt-invoices-table th.col-frozen-last,
.gdt-invoices-table td.col-frozen-last {
  box-shadow: 3px 0 6px -1px rgba(0, 0, 0, 0.14) !important;
  border-right: 2px solid #64748b !important;
}

/* Popover danh sách cột đóng băng */
.freeze-cols-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 10px;
  width: 250px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.freeze-cols-popover.active {
  display: block;
}

.freeze-col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  border-radius: 4px;
}

.freeze-col-item:hover {
  background: #f1f5f9;
}

.gdt-table-link {
  color: #873600;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.gdt-table-link:hover {
  text-decoration: underline;
  color: #6e2c00;
}

.gdt-action-icon-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 5px;
  color: #475569;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.gdt-action-icon-btn:hover {
  background: #f1f5f9;
  color: #873600;
  border-color: #873600;
}
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  margin: 0;
}

.btn-group-toggle {
  display: inline-flex;
  gap: 0.35rem;
}

.btn-group-toggle .invoice-type-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 6px;
  white-space: nowrap;
}

select.filter-select,
.filter-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: normal !important;
  padding: 4px 30px 4px 12px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  min-width: 140px !important;
  box-sizing: border-box !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 9px) center !important;
  background-size: 14px 14px !important;
  color: #1e293b !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
}

select.filter-select:focus,
.filter-select:focus {
  outline: none !important;
  border-color: #b45309 !important;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.15) !important;
}

input.filter-date-input,
.filter-date-input {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  line-height: 22px !important;
  padding: 8px 10px !important;
  font-size: 0.88rem !important;
  border-radius: 6px !important;
  width: 145px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  border: 1px solid var(--border) !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
}

.sub-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  animation: subPickerFadeIn 0.2s ease-out;
}

@keyframes subPickerFadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-search-group {
  flex: 1 1 200px;
  min-width: 180px;
}

.filter-search-group .search-input-group {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-group .search-input-group .search-icon {
  position: absolute;
  left: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

.filter-search-group .search-input-group input {
  padding-left: 2.25rem;
  height: 40px !important;
  font-size: 0.88rem;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.filter-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.filter-actions-group .btn {
  height: 40px !important;
  padding: 0 1rem;
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .horizontal-filter-bar {
    gap: 0.6rem;
  }
  .filter-actions-group {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .horizontal-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .filter-group {
    width: 100%;
    justify-content: space-between;
  }
  .filter-date-input {
    width: 100%;
  }
  .filter-actions-group {
    width: 100%;
    justify-content: stretch;
  }
  .filter-actions-group .btn {
    flex: 1;
    justify-content: center;
  }
}

/* Main Container */
.main-content {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  padding: 0 1.5rem;
  flex: 1;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  transition: all 0.25s ease;
}

.dashboard-grid.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
  gap: 0;
}

.dashboard-grid.sidebar-collapsed .sidebar-controls {
  display: none;
}

.sidebar-controls {
  min-width: 0;
}

.main-display {
  min-width: 0;
  width: 100%;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Common */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

/* Captcha Box */
.captcha-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.captcha-image-wrapper {
  flex: 1;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.captcha-image-wrapper img, .captcha-image-wrapper svg {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #e2e8f0;
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f1f5f9;
}

.btn-secondary {
  background: #334155;
  color: white;
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-block {
  width: 100%;
}

/* Session Info Banner */
.session-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Thống kê 4 thẻ ngang chuẩn Hình 1 người dùng */
.gdt-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 0.85rem 0 1rem 0 !important;
}

.gdt-stats-summary .stat-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gdt-stats-summary .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.35rem;
}

.gdt-stats-summary .stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}

.gdt-stats-summary .stat-value.primary {
  color: #c02626;
}

.gdt-stats-summary .stat-value.success {
  color: #16a34a;
}

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

@media (max-width: 520px) {
  .gdt-stats-summary {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
}

.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-group input {
  padding-left: 2.2rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.custom-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.custom-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.custom-table td:nth-child(6),
.custom-table td:nth-child(7),
.custom-table td:nth-child(8) {
  white-space: nowrap;
}

.custom-table th:last-child,
.custom-table td:last-child {
  min-width: 95px;
  text-align: center;
  padding-right: 0.85rem;
}

.custom-table tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  position: relative;
}

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

/* Realistic Invoice Simulation in Modal */
.invoice-bill {
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  background: #fafafa;
  border-radius: 8px;
  font-size: 0.9rem;
}

.invoice-bill-header {
  text-align: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.invoice-bill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  color: white;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.25s ease forwards;
}

.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #0284c7; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Spinner */
.spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   APP VIEWS & SUBMODULE WORKSPACES
   ========================================================================== */
.app-view {
  display: none;
}
.app-view.active {
  display: block;
  animation: viewFadeIn 0.2s ease-out forwards;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb Bar */
.module-breadcrumb-bar {
  background: white;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.breadcrumb-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}
.breadcrumb-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.breadcrumb-root {
  color: var(--text-muted);
}
.breadcrumb-sep {
  color: #cbd5e1;
}
.breadcrumb-module {
  color: var(--secondary);
  font-weight: 600;
}
.breadcrumb-current {
  color: var(--primary);
  font-weight: 700;
}

/* Form Grid Rows */
.form-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .form-row-2, .form-row-3, .form-row-4 {
    grid-template-columns: 1fr;
  }
}

/* Line Items Table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
.line-items-table th {
  background: #f8fafc;
  padding: 0.6rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-align: left;
}
.line-items-table td {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.line-items-table input, .line-items-table select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}
.line-items-table input:focus, .line-items-table select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Invoice Total Summary Box */
.invoice-summary-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-main);
}
.summary-row.total {
  border-top: 2px dashed #cbd5e1;
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
}

/* View Container & Layouts */
.view-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.view-title-group h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #fee2e2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.filter-tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tab-btn:hover {
  color: var(--primary);
}

.filter-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px 4px 0 0;
}

.table-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
}

.btn-table {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-main);
  transition: all 0.15s;
}

.btn-table:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-table-primary {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.btn-table-primary:hover {
  background: #b91c1c;
}

.btn-table-success {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.btn-table-success:hover {
  background: #15803d;
}

.btn-table-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-table-danger:hover {
  background: #fef2f2;
}

/* Invoice Preview Document Styling */
.inv-preview-paper {
  background: white;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 2.5rem;
  border-radius: 6px;
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.5;
}

.inv-preview-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 4rem;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.06);
  pointer-events: none;
  white-space: nowrap;
}

.inv-preview-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #b91c1c;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.inv-preview-seller {
  flex: 1;
}

.inv-preview-meta {
  text-align: right;
  min-width: 220px;
}

.inv-preview-title {
  text-align: center;
  margin: 1.25rem 0;
}

.inv-preview-title h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #b91c1c;
  letter-spacing: 0.5px;
}

.inv-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

.inv-preview-table th, .inv-preview-table td {
  border: 1px solid #94a3b8;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.inv-preview-table th {
  background: #f1f5f9;
  font-weight: 700;
  text-align: center;
}

.inv-preview-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 2rem;
  text-align: center;
}

.sig-box {
  padding: 1rem;
}

.sig-stamp {
  margin-top: 0.5rem;
  display: inline-block;
  border: 2px dashed #16a34a;
  background: #f0fdf4;
  color: #16a34a;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   OFFICIAL GDT MASTER-DETAIL LAYOUT (QUẢN LÝ NGƯỜI DÙNG & VAI TRÒ)
   ========================================================================== */
.gdt-arrow-header {
  border-bottom: 2px solid #8c6b2d;
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
}

.gdt-arrow-badge {
  display: inline-flex;
  align-items: center;
  background: #8c6b2d;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 1.75rem 0.4rem 1.25rem;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 12px 50%);
  letter-spacing: 0.3px;
}

.gdt-split-container {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr);
  gap: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
}

@media (max-width: 1024px) {
  .gdt-split-container {
    grid-template-columns: 1fr;
  }
}

.btn-gdt-brown {
  background: #8c6b2d !important;
  color: #fff !important;
  border: 1px solid #8c6b2d !important;
  border-radius: 4px !important;
  padding: 0.45rem 1.4rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-gdt-brown:hover {
  background: #78350f !important;
  border-color: #78350f !important;
}

.btn-gdt-outline-brown {
  background: #fff !important;
  color: #8c6b2d !important;
  border: 1px solid #8c6b2d !important;
  border-radius: 4px !important;
  padding: 0.45rem 1.4rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-gdt-outline-brown:hover {
  background: #fefce8 !important;
}

.gdt-filter-box {
  margin-bottom: 1.25rem;
}

.gdt-filter-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.gdt-filter-row label {
  font-size: 0.85rem;
  color: #334155;
  font-weight: 500;
}

.gdt-filter-row input {
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.875rem;
  width: 100%;
}

.gdt-filter-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.gdt-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.75rem;
}

.gdt-pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gdt-page-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #475569;
}
.gdt-page-btn:hover {
  background: #f8fafc;
}

.gdt-page-input {
  width: 44px;
  height: 28px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.8rem;
}

.gdt-page-size {
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.8rem;
  padding: 0 0.35rem;
}

.gdt-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #cbd5e1;
  font-size: 0.85rem;
}

.gdt-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-weight: 700;
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.gdt-table th:first-child,
.gdt-table td:first-child {
  text-align: center;
  width: 50px;
}

.gdt-table td {
  border: 1px solid #cbd5e1;
  padding: 0.55rem 0.65rem;
  background: #fff;
  vertical-align: middle;
}

.gdt-table tr:hover td {
  background: #f8fafc;
}

.gdt-table tr.selected td {
  background: #fefce8;
}

.gdt-detail-panel {
  border-left: 1px solid #e2e8f0;
  padding-left: 1.5rem;
}

.gdt-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #8c6b2d;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.gdt-detail-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.gdt-icon-actions {
  display: flex;
  gap: 0.35rem;
}

.gdt-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8c6b2d;
  transition: all 0.15s;
}

.gdt-icon-btn:disabled,
.gdt-icon-btn.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}

.gdt-icon-btn:not(:disabled):not(.disabled) {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  border-color: #8c6b2d;
  color: #8c6b2d;
}

.gdt-icon-btn:not(:disabled):not(.disabled):hover {
  background: #fefce8;
  border-color: #873600;
  color: #873600;
}

.gdt-icon-btn#btnFreezeCols {
  color: #2563eb;
  border-color: #93c5fd;
  background: #eff6ff;
}

.gdt-icon-btn#btnFreezeCols:hover {
  background: #dbeafe;
}



.gdt-detail-form-group {
  margin-bottom: 0.9rem;
}

.gdt-detail-label {
  display: block;
  font-size: 0.82rem;
  color: #334155;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.gdt-detail-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.875rem;
}

.gdt-detail-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Permission Matrix Tree */
.gdt-permission-tree {
  max-height: 440px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.gdt-tree-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 0.55rem 10px !important;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
  margin-bottom: 0.5rem;
  background: #f1f5f9;
  box-sizing: border-box !important;
}

.gdt-tree-header-cols,
.gdt-tree-checkboxes {
  display: grid !important;
  grid-template-columns: 85px 85px !important;
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.gdt-tree-header-cols label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 0 0 12px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #334155 !important;
  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  gap: 6px !important;
}

.gdt-tree-header-cols input[type="checkbox"],
.gdt-tree-checkboxes input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  cursor: pointer !important;
  accent-color: #8c6b2d !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.gdt-tree-checkboxes input[type="checkbox"] {
  margin-left: 12px !important;
  justify-self: start !important;
}

.gdt-tree-group {
  margin-bottom: 0.35rem;
  padding: 0 !important;
}

.gdt-tree-group-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
  padding: 0.4rem 10px !important;
  background: #f8fafc;
  border-radius: 4px;
  margin-bottom: 0.2rem;
  box-sizing: border-box !important;
}

.gdt-tree-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.3rem 10px 0.3rem 20px !important;
  font-size: 0.82rem;
  color: #475569;
  box-sizing: border-box !important;
}

.gdt-tree-item:hover {
  background: #f8fafc;
}

/* ==========================================================================
   10. MODAL DANH SÁCH HÓA ĐƠN LIÊN QUAN (CHUẨN GDT 2 PANEL)
   ========================================================================== */
.gdt-modal-related {
  max-width: 1560px !important;
  width: 98vw !important;
  height: 95vh !important;
  max-height: 95vh !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25) !important;
  border: 1px solid #cbd5e1 !important;
}

.gdt-modal-related-header {
  background: #ffffff;
  border-bottom: 2px solid #873600;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.gdt-modal-ribbon-title {
  display: flex;
  align-items: center;
}

.gdt-related-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #f8fafc;
}

/* Panel trái: Danh sách bảng hóa đơn liên quan (mở rộng đủ rộng để không rớt dòng) */
.gdt-related-left-panel {
  width: 45% !important;
  min-width: 630px !important;
  border-right: 1.5px solid #cbd5e1;
  background: #ffffff;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0.75rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.gdt-related-table-wrap {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  overflow-x: auto;
}

.gdt-related-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: inherit;
}

.gdt-related-table thead tr {
  background: #e9ecef;
  color: #212529;
  font-weight: 700;
  border-bottom: 1.5px solid #ced4da;
}

.gdt-related-table th {
  padding: 9px 8px;
  border: 1px solid #ced4da;
  vertical-align: middle;
  line-height: 1.35;
  white-space: nowrap !important;
  font-size: 0.82rem;
  text-align: center;
  background: #e9ecef;
}

.gdt-related-table td {
  padding: 9px 8px;
  border: 1px solid #ced4da;
  vertical-align: middle;
  line-height: 1.4;
  font-size: 0.82rem;
}

.gdt-related-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.gdt-related-table tbody tr:hover {
  background: #f4f1ed;
}

.gdt-related-table tbody tr.active-row {
  background: #dedad4 !important;
  font-weight: 600;
}

.gdt-related-table tbody tr.active-row td {
  border-color: #b0aba3;
}

/* Panel phải: Xem bản thể hiện hóa đơn đầy đủ chuẩn GDT */
.gdt-related-right-panel {
  flex: 1;
  width: 55%;
  overflow-y: auto;
  background: #525659;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

/* Bản thể hiện hóa đơn khổ A4 chuẩn Cổng Thuế: Khung đồng đôi, họa tiết góc, trống đồng Đông Sơn */
.gdt-invoice-paper {
  background: #ffffff;
  width: 100%;
  max-width: 780px;
  min-height: 980px;
  padding: 26px 30px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  position: relative;
  border: 2.5px solid #a86426;
  outline: 1px solid #a86426;
  outline-offset: -7px;
  font-family: "Times New Roman", Times, serif;
  color: #1e293b;
  line-height: 1.4;
  overflow: hidden;
}

/* Họa tiết góc khung đồng */
.gdt-corner-bracket {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 3;
}
.gdt-corner-bracket.corner-tl { top: 3px; left: 3px; }
.gdt-corner-bracket.corner-tr { top: 3px; right: 3px; transform: rotate(90deg); }
.gdt-corner-bracket.corner-bl { bottom: 3px; left: 3px; transform: rotate(-90deg); }
.gdt-corner-bracket.corner-br { bottom: 3px; right: 3px; transform: rotate(180deg); }

/* Hình nền Trống đồng Đông Sơn vector chìm giữa trang */
.gdt-dongson-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  height: 440px;
  opacity: 0.085;
  pointer-events: none;
  z-index: 1;
}

.gdt-paper-content {
  position: relative;
  z-index: 2;
}

.gdt-paper-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.gdt-paper-qr-wrap {
  width: 82px;
  height: 82px;
  border: 1px solid #cbd5e1;
  padding: 3px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdt-paper-meta-right {
  text-align: right;
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.35;
}

.gdt-paper-title-wrap {
  text-align: center;
  margin: 0.5rem 0 1rem 0;
}

.gdt-paper-main-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 0.35rem 0;
  letter-spacing: 0.5px;
}

.gdt-paper-sub-note {
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.gdt-paper-date {
  font-size: 0.88rem;
  font-style: italic;
  color: #334155;
  margin-bottom: 0.35rem;
}

.gdt-paper-mccqt {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.gdt-paper-divider {
  border: none;
  border-top: 1px dashed #cbd5e1;
  margin: 0.6rem 0;
}

.gdt-paper-info-section {
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.gdt-paper-info-row {
  margin-bottom: 2px;
}

.gdt-paper-info-row strong {
  color: #0f172a;
}

/* Bảng hàng hóa dịch vụ trong bản thể hiện */
.gdt-paper-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.6rem 0;
}

.gdt-paper-items-table th,
.gdt-paper-items-table td {
  border: 1px solid #94a3b8;
  padding: 5px 6px;
}

.gdt-paper-items-table thead {
  background: #f8fafc;
  font-weight: 700;
}

/* Phần chữ ký số điện tử */
.gdt-paper-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.86rem;
}

.gdt-paper-sign-col {
  width: 46%;
  text-align: center;
}

.gdt-digital-sign-box {
  border: 1px dashed #16a34a;
  background: #f0fdf4;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #15803d;
  margin-top: 1rem;
  text-align: left;
  line-height: 1.35;
}

/* Khung Chữ ký số điện tử chuẩn Cổng Thuế GDT (Hình 3) */
.gdt-digital-sign-box-authentic {
  border: 1.5px solid #16a34a;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 0.8rem;
  color: #15803d;
  margin-top: 0.85rem;
  text-align: left;
  line-height: 1.35;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.gdt-paper-summary-grid {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

.gdt-paper-summary-grid .gdt-paper-items-table {
  margin: 0;
}

.gdt-paper-summary-grid td,
.gdt-paper-summary-grid th {
  padding: 4px 6px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* In ấn bản thể hiện hóa đơn khổ A4 chuẩn Cổng Thuế GDT */
@media print {
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body * {
    visibility: hidden;
  }
  .modal-backdrop.active,
  .modal-backdrop.active .modal-content,
  .modal-backdrop.active .gdt-invoice-paper,
  .modal-backdrop.active .gdt-invoice-paper * {
    visibility: visible;
  }
  .modal-backdrop.active {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
  }
  .modal-backdrop.active .modal-content {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
  }
  .modal-backdrop.active .modal-header,
  .modal-backdrop.active .btn-icon,
  .modal-backdrop.active .gdt-related-modal-header,
  .modal-backdrop.active .gdt-related-left-panel {
    display: none !important;
  }
  .gdt-invoice-paper {
    box-shadow: none !important;
    margin: 0 auto !important;
    border: 2px solid #a86426 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    width: 100% !important;
    max-width: 100% !important;
  }
  .modal-backdrop.active .gdt-notice-paper {
    box-shadow: none !important;
    margin: 0 auto !important;
    border: 2px solid #b78953 !important;
    outline: 1px solid #b78953 !important;
    outline-offset: -6px !important;
    page-break-inside: avoid;
    break-inside: avoid;
    width: 100% !important;
    max-width: 100% !important;
    visibility: visible !important;
  }
  .modal-backdrop.active .gdt-notice-paper * {
    visibility: visible !important;
  }
}

/* -------------------------------------------------------------------------
   CỤM NÚT THAO TÁC THÔNG BÁO CQT (XEM, XUẤT FILE, XUẤT XML, IN)
   ------------------------------------------------------------------------- */
.gdt-notice-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.gdt-notice-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #cbd5e1;
  cursor: not-allowed;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
}

.gdt-notice-action-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.gdt-notice-action-btn:not(:disabled) {
  border-color: #873600;
  color: #873600;
  cursor: pointer;
  opacity: 1;
}

.gdt-notice-action-btn:not(:disabled):hover {
  background-color: #fdf6ed;
  border-color: #a04000;
  color: #a04000;
  box-shadow: 0 1px 3px rgba(135, 54, 0, 0.15);
}

.gdt-notice-action-btn svg {
  stroke-width: 1.8px;
}

/* Row selection in notice table */
tr.gdt-notice-row {
  transition: background-color 0.15s ease;
  user-select: none;
}

tr.gdt-notice-row:hover td {
  background-color: #f8fafc;
}

tr.gdt-notice-row.selected-row td {
  background-color: #f3ede7 !important;
  color: #1e293b !important;
}

/* -------------------------------------------------------------------------
   BẢN THỂ HIỆN THÔNG BÁO 01/TB-KTDL CHUẨN CỔNG THUẾ GDT (A4)
   ------------------------------------------------------------------------- */
.gdt-notice-modal-wrapper {
  position: relative;
  max-width: 820px;
  width: 95vw;
  max-height: 94vh;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

.gdt-notice-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-right: 2px;
}

.gdt-notice-pill-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #873600;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.gdt-notice-pill-btn:hover {
  background: #fdf6ed;
  border-color: #873600;
}

.gdt-notice-close-x {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.gdt-notice-close-x:hover {
  color: #000000;
  background: #f1f5f9;
}

.gdt-notice-scroll-body {
  overflow-y: auto;
  max-height: 88vh;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid #333333;
  background: #ffffff;
}

.gdt-notice-paper {
  background: #ffffff;
  color: #000000;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 30px 36px 36px 36px;
  margin: 0 auto;
  width: 100%;
  max-width: 780px;
  position: relative;
  overflow: hidden;
}

.gdt-notice-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  max-width: 90%;
  max-height: 90%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.gdt-notice-content-wrapper {
  position: relative;
  z-index: 1;
}

.gdt-notice-mau-so {
  text-align: right;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.gdt-notice-header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
}

.gdt-notice-header-left {
  width: 44%;
  text-align: center;
}

.gdt-notice-header-left .agency-main {
  font-size: 13.5px;
  font-weight: 400;
  text-transform: uppercase;
}

.gdt-notice-header-left .agency-sub {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: underline;
  margin: 1px 0 4px 0;
}

.gdt-notice-header-left .notice-so {
  font-size: 13.5px;
}

.gdt-notice-header-right {
  width: 54%;
  text-align: center;
}

.gdt-notice-header-right .nation-title {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.gdt-notice-header-right .motto {
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  margin: 1px 0 4px 0;
}

.gdt-notice-header-right .notice-date {
  font-style: italic;
  font-size: 13.5px;
}

.gdt-notice-title-block {
  text-align: center;
  margin: 16px 0 14px 0;
}

.gdt-notice-title-main {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gdt-notice-title-sub {
  font-size: 14px;
  font-weight: 700;
  margin-top: 3px;
}

.gdt-notice-recipient {
  margin-bottom: 10px;
  font-size: 14px;
  padding-left: 20px;
}

.gdt-notice-recipient strong {
  font-weight: 700;
}

.gdt-notice-body-p {
  margin-bottom: 8px;
  text-align: justify;
  text-indent: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.gdt-notice-details-list {
  margin: 6px 0 10px 20px;
  list-style: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.45;
}

.gdt-notice-details-list li {
  margin-bottom: 3px;
}

.gdt-notice-reason-title {
  margin-top: 8px;
  margin-bottom: 6px;
  padding-left: 20px;
  font-size: 14px;
}

.gdt-notice-error-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px 0;
  font-size: 14px;
}

.gdt-notice-error-table th,
.gdt-notice-error-table td {
  border: 1px solid #1e293b;
  padding: 6px 10px;
  vertical-align: top;
}

.gdt-notice-error-table thead th {
  text-align: center;
  font-weight: 700;
  background: #fbfbfc;
}

.gdt-notice-error-table td.col-stt {
  text-align: center;
  width: 50px;
}

.gdt-notice-error-table td.col-desc {
  width: 38%;
}

.gdt-notice-error-table td.col-action {
  width: 38%;
}

.gdt-notice-error-table td.col-notes {
  text-align: center;
}

/* Khung chữ ký số CQT góc phải */
.gdt-notice-stamp-box {
  border: 1.5px solid #16a34a;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.gdt-notice-stamp-box .stamp-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gdt-notice-stamp-box .stamp-title {
  color: #16a34a;
  font-weight: 700;
  font-size: 13.5px;
  font-family: Arial, sans-serif;
}

.gdt-notice-stamp-box .stamp-signer {
  color: #16a34a;
  font-size: 13px;
  font-weight: 600;
  font-family: Arial, sans-serif;
}

.gdt-notice-stamp-box .stamp-time {
  color: #16a34a;
  font-size: 12.5px;
  font-family: Arial, sans-serif;
}

.gdt-notice-stamp-box .stamp-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media print {
  .gdt-notice-top-actions {
    display: none !important;
  }
  .modal-backdrop.active {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .modal-backdrop.active .gdt-notice-modal-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
  }
  .modal-backdrop.active .gdt-notice-scroll-body {
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .modal-backdrop.active .gdt-notice-paper {
    border: 1px solid #333333 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}



