/* ==========================================================================
   TRANSJAKARTA MDM3 - TELEMETRY DARK-SIMPLE-MODERN THEME
   Direct server-side API integration (No Vue/iframe mirroring)
   Colors matching Telemetry: #070a0f (bg), #0f1520 (surface), #00e5ff (primary)
   Fully responsive for Desktop & Mobile (PWA / APK viewport)
   ========================================================================== */

.tj-mdm3-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: #070a0f;
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

/* 1. TOP SUBTABS BAR */
.tj-mdm3-subtabs-bar {
  position: relative;
  z-index: 200;
  overflow: visible !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  background: #0b111e;
  border-bottom: 1px solid #1e293b;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 12px;
}

.tj-mdm3-subtabs-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tj-mdm3-subtabs-left::-webkit-scrollbar {
  display: none;
}

.tj-mdm3-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.tj-mdm3-tab-item:hover {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.06);
}

.tj-mdm3-tab-item.active {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  font-weight: 600;
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}



.tj-mdm3-subtabs-right {
  position: relative;
  z-index: 201;
  overflow: visible !important;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* User Badge with Status Dot + Username | Organization Dropdown */
.tj-mdm3-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  background: #111c2e;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tj-mdm3-user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.tj-mdm3-user-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
}

.tj-mdm3-user-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
}

.tj-mdm3-username {
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.tj-mdm3-badge-divider {
  color: #334155;
  user-select: none;
  font-weight: 300;
}

.tj-mdm3-org-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tj-mdm3-header-select {
  height: 28px;
  border: 1px solid #233146 !important;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #00e5ff !important;
  background-color: #162032 !important;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tj-mdm3-header-select:hover {
  border-color: #00e5ff !important;
}

.tj-mdm3-header-select:focus {
  border-color: #00e5ff !important;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25) !important;
}

.tj-mdm3-btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #111c2e;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.tj-mdm3-btn-subtle:hover {
  background: #16243b;
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.4);
}

.tj-mdm3-btn-subtle.tj-mdm3-btn-icon-only {
  padding: 0;
  width: 32px;
  height: 31px;
  justify-content: center;
  gap: 0;
  flex-shrink: 0;
}

/* 2. BODY CONTENT */
.tj-mdm3-content-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 10px 12px 0 12px;
  box-sizing: border-box;
}

/* 3. SEARCH CARD (Device SN | No Body) */
.tj-mdm3-search-card {
  flex-shrink: 0;
  background: #0d1524;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.tj-mdm3-search-grid {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tj-mdm3-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tj-mdm3-label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

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

.tj-mdm3-input {
  height: 34px;
  border: 1px solid #233146 !important;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  color: #f1f5f9 !important;
  background-color: #162032 !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  width: 260px;
}

.tj-mdm3-input::placeholder {
  color: #64748b;
}

.tj-mdm3-input:hover {
  border-color: #3b82f6 !important;
}

.tj-mdm3-input:focus {
  border-color: #00e5ff !important;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25) !important;
}

/* 4. ACTION TOOLBAR */
.tj-mdm3-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tj-mdm3-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-mdm3-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-mdm3-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.tj-mdm3-btn-primary {
  background-color: #00e5ff;
  color: #070a0f;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.tj-mdm3-btn-primary:hover {
  background-color: #38bdf8;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}

.tj-mdm3-btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.tj-mdm3-btn-danger:hover:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.28);
}

.tj-mdm3-btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tj-mdm3-btn-default {
  background-color: #162032;
  border-color: #233146;
  color: #e2e8f0;
}

.tj-mdm3-btn-default:hover {
  background-color: #1e2c44;
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.4);
}

.tj-mdm3-batch-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.16);
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #00e5ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.tj-mdm3-btn-reset-filters {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}

.tj-mdm3-btn-reset-filters:hover {
  background-color: #1e2c44;
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.16);
}

.tj-mdm3-btn-reset-filters.has-active-filters {
  background-color: rgba(0, 229, 255, 0.10);
  border-color: rgba(0, 229, 255, 0.48);
  color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.18);
}

.tj-mdm3-btn-reset-filters.has-active-filters:hover {
  background-color: rgba(0, 229, 255, 0.18);
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.30);
}

.tj-mdm3-btn-reset-filters.is-spinning svg {
  animation: tjMdm3ResetSpin 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.tj-mdm3-dropdown {
  position: relative;
  display: inline-block;
}

.tj-mdm3-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 190px;
  background: #0f172a;
  border: 1px solid #233146;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 229, 255, 0.1);
  padding: 4px 0;
  display: none;
  z-index: 100;
}

.tj-mdm3-dropdown-menu.show {
  display: block;
}

.tj-mdm3-dropdown-item {
  padding: 8px 14px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-mdm3-dropdown-item:hover {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
}

.tj-mdm3-total-pill {
  font-size: 13px;
  color: #94a3b8;
  background: #0d1524;
  border: 1px solid #1e293b;
  padding: 6px 12px;
  border-radius: 6px;
}

.tj-mdm3-total-pill strong {
  color: #00e5ff;
}

.tj-mdm3-offline-count {
  font-weight: 400;
  color: #94a3b8;
}

#mdm3OnlineGapBadge.is-neg {
  color: #ef4444;
  font-weight: 700;
}

#mdm3OnlineGapBadge.is-pos {
  color: #10b981;
  font-weight: 700;
}

/* 5. TABLE CARD (3 Column preview + Operations) */
.tj-mdm3-table-card {
  background: #0d1524;
  border: 1px solid #1e293b;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.tj-mdm3-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.tj-mdm3-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.tj-mdm3-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #111a28;
  color: #94a3b8;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tj-mdm3-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #162030;
  color: #f1f5f9;
  vertical-align: middle;
}

.tj-mdm3-th-check {
  width: 32px;
  text-align: center;
  padding: 10px 4px !important;
}

.tj-mdm3-th-status {
  text-align: left;
  padding: 10px 12px !important;
}

.tj-mdm3-td-status {
  text-align: left;
  padding: 10px 12px !important;
}

.tj-mdm3-th-op {
  width: 76px;
  text-align: center;
  padding: 10px 4px !important;
}

.tj-mdm3-table tr:hover td {
  background-color: #131e30;
}

.tj-mdm3-sn-link {
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: color 0.15s ease;
}

.tj-mdm3-sn-link:hover {
  color: #00e5ff;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.tj-mdm3-remarks-cell {
  font-weight: 600;
  color: #ffffff;
  font-size: 13px;
}

/* Status Badges */
.tj-mdm3-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.tj-mdm3-badge-online {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.tj-mdm3-badge-offline {
  background-color: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}

.tj-mdm3-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tj-mdm3-badge-online .tj-mdm3-badge-dot {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.tj-mdm3-badge-offline .tj-mdm3-badge-dot {
  background-color: #94a3b8;
}

/* Operation column buttons (Edit | Action v) */
.tj-mdm3-op-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tj-mdm3-btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.32);
  color: #00e5ff;
  border-radius: 5px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.tj-mdm3-btn-edit:hover {
  background: rgba(0, 229, 255, 0.22);
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.tj-mdm3-btn-edit:disabled,
.tj-mdm3-btn-edit[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  color: #64748b !important;
  background: rgba(15, 23, 42, 0.4) !important;
  box-shadow: none !important;
}

.tj-mdm3-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #facc15;
  border-radius: 5px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.tj-mdm3-btn-action:hover,
.tj-mdm3-btn-action:focus,
.tj-mdm3-btn-action.active {
  background: rgba(250, 204, 21, 0.25);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

/* Row Action Dropdown Menu (Scrollable with 19 Action Items) */
.tj-mdm3-action-wrapper {
  position: relative;
  display: inline-block;
}

.tj-mdm3-action-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 230px;
  max-height: 380px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid #233146;
  border-radius: 8px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 229, 255, 0.12);
  padding: 6px 0;
  display: none;
  z-index: 999;
}

.tj-mdm3-action-menu.show {
  display: block;
}

.tj-mdm3-action-menu::-webkit-scrollbar {
  width: 5px;
}

.tj-mdm3-action-menu::-webkit-scrollbar-thumb {
  background: #233146;
  border-radius: 4px;
}

.tj-mdm3-action-menu::-webkit-scrollbar-thumb:hover {
  background: #00e5ff;
}

.tj-mdm3-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tj-mdm3-action-item:hover {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
}

.tj-mdm3-dropdown-divider,
.tj-mdm3-action-divider {
  height: 1px;
  background: #1e293b;
  margin: 4px 0;
}

/* 6. PAGINATION */
.tj-mdm3-pagination {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: #0b1324;
  border-top: 1px solid #1e293b;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  flex-wrap: nowrap;
  gap: 12px;
}

.tj-mdm3-page-info {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.tj-mdm3-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.tj-mdm3-page-nav-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.tj-mdm3-pagesize-select {
  height: 30px;
  border: 1px solid #233146;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  color: #f1f5f9;
  background: #162032;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.tj-mdm3-pagesize-select:focus,
.tj-mdm3-pagesize-select:hover {
  border-color: #00e5ff;
}

.tj-mdm3-page-numbers {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.tj-mdm3-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #233146;
  background: #162032;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
}

.tj-mdm3-page-btn:hover:not(:disabled) {
  border-color: #00e5ff;
  color: #00e5ff;
  background: #1a273e;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.tj-mdm3-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #1e293b;
  background: #0f172a;
}

.tj-mdm3-page-btn.active {
  background-color: #00e5ff;
  border-color: #00e5ff;
  color: #070a0f;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.tj-mdm3-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 30px;
  color: #64748b;
  font-size: 12px;
  user-select: none;
  flex-shrink: 0;
}

/* Empty & Loading state */
.tj-mdm3-empty-state {
  text-align: center;
  padding: 40px 20px !important;
  color: #94a3b8;
}

.tj-mdm3-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #1e293b;
  border-top-color: #00e5ff;
  border-radius: 50%;
  animation: tjMdm3Spin 0.8s linear infinite;
}

@keyframes tjMdm3Spin {
  to {
    transform: rotate(360deg);
  }
}

/* 7. LOGIN GATEWAY OVERLAY */
.tj-mdm3-login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.tj-mdm3-login-card {
  width: 100%;
  max-width: 400px;
  background: #0f172a;
  border: 1px solid #233146;
  border-radius: 10px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.15);
  padding: 28px 24px;
  box-sizing: border-box;
  animation: tjMdm3Pop 0.25s ease-out;
}

@keyframes tjMdm3Pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tj-mdm3-login-header {
  text-align: center;
  margin-bottom: 22px;
}

.tj-mdm3-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 50%;
  margin-bottom: 12px;
}

.tj-mdm3-login-title {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
}

.tj-mdm3-login-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.4;
}

.tj-mdm3-login-field {
  margin-bottom: 14px;
}

.tj-mdm3-login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.tj-mdm3-login-input {
  width: 100%;
  height: 38px;
  border: 1px solid #233146;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  color: #f1f5f9;
  background: #162032;
  outline: none;
  box-sizing: border-box;
}

.tj-mdm3-login-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25);
}

.tj-mdm3-captcha-box {
  width: 100px;
  height: 38px;
  border: 1px solid #233146;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #162032;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tj-mdm3-captcha-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tj-mdm3-login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.tj-mdm3-login-btn {
  width: 100%;
  height: 40px;
  background: #00e5ff;
  color: #070a0f;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.tj-mdm3-login-btn:hover {
  background: #38bdf8;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}

.tj-mdm3-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 8. MODAL BACKDROP (EDIT & DETAIL) */
.tj-mdm3-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 15, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.tj-mdm3-modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  background: #0f172a;
  border: 1px solid #233146;
  border-radius: 10px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tjMdm3Pop 0.2s ease-out;
}

.tj-mdm3-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #1e293b;
  background: #111a28;
}

.tj-mdm3-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-mdm3-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.tj-mdm3-modal-close:hover {
  color: #00e5ff;
}

.tj-mdm3-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tj-mdm3-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  background: #111a28;
  border-top: 1px solid #1e293b;
}

/* Edit Form Grid */
.tj-mdm3-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tj-mdm3-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tj-mdm3-form-field.full {
  grid-column: span 2;
}

.tj-mdm3-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.tj-mdm3-form-input,
.tj-mdm3-form-select {
  height: 36px;
  border: 1px solid #233146 !important;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  color: #f1f5f9 !important;
  background-color: #162032 !important;
  outline: none;
  box-sizing: border-box;
}

.tj-mdm3-form-input:disabled {
  background-color: #0e1624 !important;
  color: #64748b !important;
  border-color: #1a2538 !important;
  cursor: not-allowed;
}

.tj-mdm3-form-input:focus,
.tj-mdm3-form-select:focus {
  border-color: #00e5ff !important;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25) !important;
}

/* Detail Modal Specifics */
.tj-mdm3-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tj-mdm3-detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #162032;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.tj-mdm3-detail-field .k {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tj-mdm3-detail-field .v {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  word-break: break-all;
}

.tj-mdm3-apk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.tj-mdm3-apk-table th {
  background: #111a28;
  padding: 8px 10px;
  border: 1px solid #1e293b;
  color: #94a3b8;
  text-align: left;
}

.tj-mdm3-apk-table td {
  padding: 8px 10px;
  border: 1px solid #1e293b;
  color: #e2e8f0;
}

.tj-mdm3-pkg-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: text;
}

.tj-mdm3-pkg-action:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.tj-mdm3-pkg-action:hover code {
  color: #f87171 !important;
  text-decoration: underline;
}

.tj-mdm3-pkg-action .tj-mdm3-pkg-trash-icon {
  opacity: 0.35;
  color: #ef4444;
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.tj-mdm3-pkg-action:hover .tj-mdm3-pkg-trash-icon {
  opacity: 1;
  transform: scale(1.15);
}

.tj-mdm3-pkg-protected {
  cursor: not-allowed;
  opacity: 0.85;
}

.tj-mdm3-pkg-protected:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
}

.tj-mdm3-pkg-protected:hover code {
  color: #94a3b8 !important;
  text-decoration: none;
}

.tj-mdm3-pkg-protected .tj-mdm3-pkg-shield-icon {
  opacity: 0.7;
  color: #38bdf8;
  flex-shrink: 0;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN FOR MOBILE DEVICES (PWA / APK VIEWPORT)
   ========================================================================== */
@media (max-width: 768px) {
  .tj-mdm3-subtabs-bar {
    min-height: 38px;
    padding: 6px 10px;
    flex-wrap: nowrap;
    gap: 6px;
    overflow: visible !important;
  }

  .tj-mdm3-subtabs-left {
    width: auto;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tj-mdm3-tab-item {
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tj-mdm3-subtabs-right {
    width: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: visible !important;
  }

  .tj-mdm3-header-select {
    max-width: 115px;
    font-size: 11px;
    height: 28px;
    padding: 0 4px;
  }

  .tj-mdm3-btn-subtle {
    padding: 4px 8px;
    font-size: 11px;
    height: 28px;
    box-sizing: border-box;
  }

  .tj-mdm3-btn-subtle.tj-mdm3-btn-icon-only {
    padding: 0;
    width: 30px;
    height: 28px;
  }

  .tj-mdm3-dept-trigger-btn {
    padding: 5px 10px;
    font-size: 12px;
    height: 28px;
    min-width: 115px;
    max-width: 165px;
    box-sizing: border-box;
  }

  .tj-mdm3-user-badge {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 8px;
  }

  .tj-mdm3-header-select {
    max-width: 140px;
    font-size: 11px;
    height: 26px;
  }

  .tj-mdm3-content-body {
    padding: 10px;
    gap: 10px;
  }

  .tj-mdm3-search-card {
    padding: 12px 14px;
  }

  .tj-mdm3-search-grid {
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .tj-mdm3-search-item {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tj-mdm3-input-wrapper,
  .tj-mdm3-input {
    width: 100% !important;
  }

  .tj-mdm3-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .tj-mdm3-toolbar-left {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    align-items: center;
  }

  .tj-mdm3-toolbar-right {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    align-items: center;
  }

  .tj-mdm3-total-dual-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    padding: 4px 6px 4px 10px;
    font-size: 11.5px;
    box-sizing: border-box;
  }

  .tj-mdm3-total-dual-pill > span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tj-mdm3-total-dual-pill > span::-webkit-scrollbar {
    display: none;
  }

  .tj-mdm3-col-menu-wrap {
    flex-shrink: 0;
  }

  .tj-mdm3-col-dropdown {
    max-width: calc(100vw - 20px);
  }

  .tj-mdm3-table th,
  .tj-mdm3-table td {
    padding: 10px 10px;
  }

  .tj-mdm3-action-menu {
    max-width: 90vw;
    right: 0;
    left: auto;
  }

  .tj-mdm3-modal-backdrop {
    padding: 10px;
  }

  .tj-mdm3-modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
  }

  .tj-mdm3-form-grid,
  .tj-mdm3-detail-grid {
    grid-template-columns: 1fr;
  }

  .tj-mdm3-form-field.full {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .tj-mdm3-user-badge {
    gap: 4px;
  }

  .tj-mdm3-username {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tj-mdm3-header-select {
    max-width: 110px;
  }

  .tj-mdm3-btn {
    padding: 0 10px;
    font-size: 12px;
  }

  .tj-mdm3-btn-reset-filters {
    width: 32px;
    padding: 0;
  }

  .tj-mdm3-content-body {
    padding: 6px 0 0 0 !important;
    gap: 6px !important;
  }

  .tj-mdm3-search-card {
    padding: 8px 10px !important;
    border-radius: 6px !important;
    margin: 0 4px !important;
  }

  .tj-mdm3-toolbar {
    padding: 0 6px !important;
    gap: 6px !important;
  }

  .tj-mdm3-total-dual-pill {
    font-size: 11px;
    padding: 4px 6px 4px 8px;
    gap: 6px;
  }
}

/* Low-resolution mobile viewports (e.g. 320px-410px): stack toolbar cleanly so GAP & Column Checklist button are ALWAYS visible */
@media (max-width: 410px) {
  .tj-mdm3-toolbar {
    flex-wrap: wrap !important;
    row-gap: 6px !important;
  }

  .tj-mdm3-toolbar-right {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: stretch !important;
  }

  .tj-mdm3-total-dual-pill {
    width: 100% !important;
    justify-content: space-between !important;
    font-size: 10.5px !important;
    padding: 4px 6px 4px 9px !important;
  }

  .tj-mdm3-col-menu-btn {
    width: 28px !important;
    height: 26px !important;
  }
}

@media (max-width: 640px) {

  .tj-mdm3-table-card {
    border-radius: 6px 6px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .tj-mdm3-table th,
  .tj-mdm3-table td {
    padding: 7px 3px !important;
    font-size: 11.5px !important;
  }

  .tj-mdm3-th-check {
    width: 26px !important;
    padding: 7px 2px !important;
  }

  .tj-mdm3-th-status,
  .tj-mdm3-td-status {
    text-align: left !important;
    padding: 7px 3px !important;
  }

  .tj-mdm3-th-op {
    width: 68px !important;
    padding: 7px 2px !important;
  }

  .tj-mdm3-sn-link {
    font-size: 11px !important;
    letter-spacing: -0.2px !important;
  }

  .tj-mdm3-remarks-cell {
    font-size: 11.5px !important;
  }

  .tj-mdm3-op-btns {
    gap: 4px !important;
  }

  .tj-mdm3-btn-edit,
  .tj-mdm3-btn-action {
    width: 26px !important;
    height: 26px !important;
  }

  .tj-mdm3-badge {
    padding: 3px 6px !important;
    font-size: 10.5px !important;
    gap: 3px !important;
  }

  .tj-mdm3-pagination {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "info size"
      "nav nav" !important;
    align-items: center !important;
    padding: 8px 10px max(10px, env(safe-area-inset-bottom)) 10px !important;
    gap: 8px !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 30 !important;
    border-radius: 0 !important;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.6) !important;
    background-color: #0b1324 !important;
  }

  .tj-mdm3-page-info {
    grid-area: info !important;
    font-size: 11px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .tj-mdm3-page-controls {
    display: contents !important;
  }

  .tj-mdm3-pagesize-select {
    grid-area: size !important;
    height: 28px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    justify-self: end !important;
  }

  .tj-mdm3-page-nav-wrap {
    grid-area: nav !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 0 !important;
  }

  .tj-mdm3-page-btn {
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 4px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
  }

  .tj-mdm3-page-ellipsis {
    width: 16px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
}


/* ==========================================================================
   REMOTE DESKTOP & REMOTE SSH IN-APP VIEWS & SUBTABS
   ========================================================================== */
.tj-mdm3-tab-item {
  position: relative;
}

.tj-mdm3-tab-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.tj-mdm3-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 5px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.45);
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tj-mdm3-tab-close svg {
  display: block;
  margin: auto;
}

.tj-mdm3-tab-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.65);
}

.tj-mdm3-remote-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px 16px 16px 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.tj-mdm3-remote-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.tj-mdm3-remote-toolbar {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background: #0b111e;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  gap: 8px;
}

.tj-mdm3-remote-toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.tj-mdm3-remote-toolbar-left,
.tj-mdm3-remote-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tj-mdm3-remote-presets-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.tj-mdm3-btn-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  background: #162032;
  border: 1px solid #233146;
  color: #e2e8f0;
  white-space: nowrap;
  transition: all 0.2s;
  box-sizing: border-box;
}

.tj-mdm3-btn-preset:hover {
  background: #1e293b;
  border-color: #00e5ff;
  color: #00e5ff;
}

.tj-mdm3-remote-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-size: 13px;
  color: #f1f5f9;
}

.tj-mdm3-remote-session-badge code {
  color: #00e5ff;
  font-family: monospace;
  font-weight: 700;
}

.tj-mdm3-ssh-creds-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #334155;
  font-size: 12px;
  color: #94a3b8;
}

.tj-mdm3-ssh-creds-bar code {
  color: #38bdf8;
  background: #0b111e;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #1e293b;
}

.tj-mdm3-remote-frame-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
  display: flex;
}

.tj-mdm3-remote-iframe {
  width: 100%;
  height: 100%;
  min-height: 580px;
  border: none;
  display: block;
  background: #000;
}

@media (max-width: 768px) {
  .tj-mdm3-remote-container {
    padding: 8px;
  }

  .tj-mdm3-remote-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .tj-mdm3-remote-toolbar-main {
    justify-content: space-between;
    gap: 6px;
  }

  .tj-mdm3-remote-toolbar-left {
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  .tj-mdm3-remote-toolbar-right {
    justify-content: flex-end;
    gap: 6px;
  }

  .tj-mdm3-remote-presets-bar {
    justify-content: flex-start;
    gap: 6px;
  }

  .tj-mdm3-remote-session-badge {
    font-size: 11px;
    max-width: 100%;
    padding: 3px 8px;
  }

  .tj-mdm3-modal-footer {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .tj-mdm3-remote-iframe {
    min-height: 480px;
  }
}

/* When in a remote session subtab (SSH / Desktop), minimize Device Manager tab to monitor icon only */
#mdm3Tab_deviceMgr.icon-only span,
#mdm3Tab_deviceMgr:not(.active) span {
  display: none !important;
}

#mdm3Tab_deviceMgr.icon-only,
#mdm3Tab_deviceMgr:not(.active) {
  padding: 6px 9px !important;
  gap: 0 !important;
  min-width: 34px !important;
  justify-content: center !important;
}

#mdm3Tab_deviceMgr.icon-only svg,
#mdm3Tab_deviceMgr:not(.active) svg {
  width: 15px !important;
  height: 15px !important;
  display: block !important;
  margin: 0 !important;
}

/* Push Modal Info Card Styles */
.tj-mdm3-push-info-card {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tj-mdm3-push-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

.tj-mdm3-push-info-row strong {
  color: #e2e8f0;
  font-family: monospace;
}


/* =========================================================================
   HIERARCHICAL DEPARTMENT DRILLDOWN PICKER
   ========================================================================= */
.tj-mdm3-dept-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 202;
  overflow: visible !important;
}

.tj-mdm3-dept-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #0f172a;
  border: 1px solid #2b4c75;
  color: #ffffff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 130px;
  max-width: 210px;
  outline: none;
}

.tj-mdm3-dept-trigger-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #ffffff;
}

.tj-mdm3-dept-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.tj-mdm3-dept-trigger-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tj-mdm3-dept-picker-wrapper.is-open .tj-mdm3-dept-trigger-arrow {
  transform: rotate(180deg);
}

.tj-mdm3-dept-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: 265px;
  max-width: calc(100vw - 16px);
  max-height: min(390px, calc(100vh - 145px));
  overflow-y: auto;
  background: #090f1d;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(56, 189, 248, 0.25);
  z-index: 9999 !important;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .tj-mdm3-dept-trigger-btn {
    padding: 4px 10px;
    font-size: 12px;
    height: 28px;
    min-width: 115px;
    max-width: 165px;
    box-sizing: border-box;
  }

  .tj-mdm3-dept-dropdown-menu {
    width: 255px;
    max-width: calc(100vw - 16px);
    max-height: min(360px, calc(100vh - 135px));
  }
}

.tj-mdm3-dept-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.tj-mdm3-dept-dropdown-menu::-webkit-scrollbar-thumb {
  background: #1e3a5f;
  border-radius: 3px;
}

.tj-mdm3-dept-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #1e3a5f;
  transition: all 0.15s ease;
  user-select: none;
}

.tj-mdm3-dept-back-btn:hover {
  background: rgba(56, 189, 248, 0.24);
  color: #7dd3fc;
  padding-left: 11px;
}

.tj-mdm3-dept-search-box {
  padding: 6px 10px;
  border-bottom: 1px solid #1e293b;
  background: #0c1424;
}

.tj-mdm3-dept-search-input {
  width: 100%;
  padding: 6px 10px;
  background: #040810;
  border: 1px solid #1e3a5f;
  border-radius: 5px;
  color: #f1f5f9;
  font-size: 12px;
  box-sizing: border-box;
  outline: none;
}

.tj-mdm3-dept-search-input:focus {
  border-color: #38bdf8;
}

.tj-mdm3-dept-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.tj-mdm3-dept-cat-item:hover {
  background: #1e293b;
  color: #38bdf8;
}

.tj-mdm3-dept-cat-arrow {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.tj-mdm3-dept-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tj-mdm3-dept-item:hover {
  background: #1e293b;
  color: #38bdf8;
  padding-left: 18px;
}

.tj-mdm3-dept-item.active {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  font-weight: 700;
}

.tj-mdm3-dept-item.parent-select {
  font-weight: 600;
  color: #94a3b8;
  border-bottom: 1px dashed rgba(30, 58, 95, 0.6);
  background: rgba(15, 23, 42, 0.5);
}

.tj-mdm3-dept-divider {
  height: 1px;
  background: #1e293b;
  margin: 4px 0;
}

/* =========================================================================
   STATUS HEADER FILTER DROPDOWN & COLUMN HEADER SEARCH INPUTS
   ========================================================================= */
.tj-mdm3-status-filter-wrap {
  display: inline-flex;
  align-items: center;
}

.tj-mdm3-status-filter-select {
  width: auto !important;
  min-width: 80px;
  height: 26px;
  box-sizing: border-box;
  background: #0a1120;
  border: 1px solid #1e3a5f;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 0 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.tj-mdm3-status-filter-select:hover {
  border-color: #38bdf8;
}

.tj-mdm3-status-filter-select.filter-on {
  border-color: #059669;
  color: #34d399;
  background: rgba(5, 150, 105, 0.15);
}

.tj-mdm3-status-filter-select.filter-off {
  border-color: #475569;
  color: #94a3b8;
  background: rgba(71, 85, 105, 0.15);
}

.tj-mdm3-th-sn,
.tj-mdm3-th-body {
  vertical-align: middle;
}

.tj-mdm3-th-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.tj-mdm3-th-sn .tj-mdm3-th-search-wrap {
  max-width: 220px;
}

.tj-mdm3-th-body .tj-mdm3-th-search-wrap {
  max-width: 170px;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 26px !important;
  box-sizing: border-box !important;
  background-color: #0a1120 !important;
  border: 1px solid #1e3a5f !important;
  border-radius: 4px !important;
  padding: 0 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  color: #f1f5f9 !important;
  text-transform: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input.has-value {
  padding-right: 22px !important;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input::placeholder {
  color: #94a3b8 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  opacity: 1 !important;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input:hover {
  border-color: #38bdf8 !important;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input:focus {
  border-color: #00e5ff !important;
  background-color: #0d172a !important;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2) !important;
}

.tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input.has-value {
  border-color: #00e5ff !important;
  background-color: rgba(0, 229, 255, 0.08) !important;
  color: #ffffff !important;
}

/* =========================================================================
   SEARCH INPUT CLEAR BUTTONS
   ========================================================================= */
.tj-mdm3-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.tj-mdm3-btn-clear-input {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 5;
}

.tj-mdm3-btn-clear-input.tj-mdm3-th-clear-btn {
  right: 3px;
  font-size: 14px;
  padding: 1px 4px;
  color: #94a3b8;
}

.tj-mdm3-btn-clear-input:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 640px) {

  .tj-mdm3-th-sn .tj-mdm3-th-search-wrap,
  .tj-mdm3-th-body .tj-mdm3-th-search-wrap {
    max-width: none;
  }

  .tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    letter-spacing: 0.15px !important;
  }

  .tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input.has-value {
    padding-right: 18px !important;
  }

  .tj-mdm3-table thead th input[type="text"].tj-mdm3-th-search-input::placeholder {
    font-size: 10.5px !important;
    letter-spacing: 0.3px !important;
  }

  .tj-mdm3-status-filter-select {
    width: auto !important;
    min-width: 62px;
    height: 24px;
    font-size: 10.5px;
    padding: 0 4px;
    letter-spacing: 0.2px;
  }

  .tj-mdm3-btn-clear-input.tj-mdm3-th-clear-btn {
    right: 2px;
    font-size: 13px;
    padding: 0 3px;
  }
}

/* =========================================================================
   AFC <-> MDM3 SYNCHRONIZATION UI (DEV / v4.0)
   - Total MDM | AFC: X | Y + ≡ Columns Checklist Popover
   - Header [⚠️] Mismatch Filter & Row SN ⚠️ Indicator
   - NO BODY MDM & NO BODY AFC Columns
   - Advance Dual STATUS (ON | ON, ON | OFF, OFF | ON, OFF | OFF)
   ========================================================================= */

.tj-mdm3-total-dual-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 12px;
  position: relative;
}

.tj-mdm3-col-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tj-mdm3-col-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid #233146;
  background: #162032;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
}

.tj-mdm3-col-menu-btn:hover,
.tj-mdm3-col-menu-btn.active {
  border-color: #00e5ff;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.14);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

/* AFC Columns Checklist Popover (matches AFC Heartbeat Columns UI) */
.tj-mdm3-col-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 255px;
  max-height: min(480px, calc(100vh - 150px));
  background: #0b1322;
  border: 1px solid #233146;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 229, 255, 0.12);
  z-index: 2500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.tj-mdm3-col-dropdown.show {
  display: flex;
}

.tj-mdm3-col-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0f192d;
  border-bottom: 1px solid #1e293b;
}

.tj-mdm3-col-dropdown-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.tj-mdm3-col-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.16);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #00e5ff;
  font-size: 11.5px;
  font-weight: 700;
}

.tj-mdm3-col-reset-btn {
  background: transparent;
  border: 1px solid #233146;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tj-mdm3-col-reset-btn:hover {
  border-color: #00e5ff;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
}

.tj-mdm3-col-dropdown-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  max-height: 360px;
}

.tj-mdm3-col-dropdown-list::-webkit-scrollbar {
  width: 5px;
}

.tj-mdm3-col-dropdown-list::-webkit-scrollbar-thumb {
  background: #233146;
  border-radius: 3px;
}

.tj-mdm3-col-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tj-mdm3-col-item:hover {
  background: rgba(0, 229, 255, 0.08);
  color: #ffffff;
}

.tj-mdm3-col-item.is-locked {
  opacity: 0.85;
  cursor: default;
}

.tj-mdm3-col-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0284c7;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.tj-mdm3-col-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #080e1a;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #64748b;
}

.tj-mdm3-afc-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #132036;
  border: 1px solid #233146;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tj-mdm3-afc-sync-btn:hover:not(:disabled) {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
}

.tj-mdm3-afc-sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Header DEVICE SN + [⚠️] Mismatch Filter Row */
.tj-mdm3-th-sn-row {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 265px;
}

.tj-mdm3-th-sn .tj-mdm3-th-search-wrap {
  flex: 1;
  max-width: 210px;
}

.tj-mdm3-btn-mismatch-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 26px;
  min-width: 28px;
  padding: 0 6px;
  background: #0a1120;
  border: 1px solid #1e3a5f;
  border-radius: 4px;
  color: #f59e0b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.tj-mdm3-btn-mismatch-filter:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.tj-mdm3-btn-mismatch-filter.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: #fbbf24;
  color: #fde68a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.tj-mdm3-mismatch-filter-icon {
  font-size: 12px;
  line-height: 1;
}

.tj-mdm3-mismatch-filter-count {
  font-size: 10.5px;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1;
}

/* NO BODY AFC Column */
.tj-mdm3-th-body-afc,
.tj-mdm3-th-afc-search {
  vertical-align: middle;
}

.tj-mdm3-th-body-afc .tj-mdm3-th-search-wrap,
.tj-mdm3-th-afc-search .tj-mdm3-th-search-wrap {
  max-width: 170px;
}

.tj-mdm3-body-afc-cell {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 13px;
  white-space: nowrap;
}

.tj-mdm3-body-afc-cell.is-mismatch,
.tj-mdm3-remarks-cell.is-mismatch {
  color: #fbbf24;
}

/* Row SN + ⚠️ Mismatch Icon */
.tj-mdm3-sn-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tj-mdm3-sn-mismatch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: help;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.45));
  transition: transform 0.15s ease;
}

.tj-mdm3-sn-mismatch-icon:hover {
  transform: scale(1.18);
}

/* Advance Dual Status (MDM | AFC) - Strictly Symmetric */
.tj-mdm3-dual-status {
  display: inline-grid;
  grid-template-columns: 34px 10px 34px;
  align-items: center;
  justify-items: center;
  padding: 3px 5px;
  border-radius: 6px;
  background: #09101d;
  border: 1px solid #1e293b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.tj-mdm3-dual-half {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 19px;
  padding: 0;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.2px;
  box-sizing: border-box;
}

.tj-mdm3-dual-half.is-on {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.tj-mdm3-dual-half.is-off {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.09);
}

.tj-mdm3-dual-half.is-empty {
  color: #64748b;
  background: rgba(100, 116, 139, 0.07);
}

.tj-mdm3-dual-Status-warn .tj-mdm3-dual-half.is-off {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
}

.tj-mdm3-dual-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  color: #475569;
  font-weight: 400;
  text-align: center;
  user-select: none;
}

/* Compact 4-Slot Status Badge: MDM|TLM|AFC|⚠️ -> ON|ON|-|⚠️ (Tentative Rectool Deploy Hazard) */
.tj-mdm3-tri-status {
  display: inline-grid;
  grid-template-columns: 24px 6px 24px 6px 24px;
  align-items: center;
  justify-items: center;
  padding: 2px 4px;
  border-radius: 6px;
  background: #09101d;
  border: 1px solid #1e293b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
}

.tj-mdm3-tri-status.has-deploy-hazard {
  grid-template-columns: 24px 6px 24px 6px 24px 6px 22px;
}

.tj-mdm3-tri-hazard-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 19px;
  border-radius: 4px;
  box-sizing: border-box;
}

.tj-mdm3-tri-hazard-cell.hz-red {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
}

.tj-mdm3-tri-hazard-cell.hz-yellow {
  color: #facc15;
  background: rgba(250, 204, 21, 0.16);
}

.tj-mdm3-tri-hazard-cell.hz-blue {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
}

.tj-mdm3-tri-hazard-cell.hz-green {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
}

.tj-mdm3-tri-hazard-cell.hz-safe {
  color: transparent;
  background: transparent;
}

.tj-mdm3-tri-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 19px;
  border-radius: 4px;
  text-align: center;
  box-sizing: border-box;
}

.tj-mdm3-tri-cell.is-active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.16);
}

.tj-mdm3-tri-cell.is-inactive {
  color: #f87171;
  background: rgba(239, 68, 68, 0.16);
}

.tj-mdm3-tri-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6px;
  color: #475569;
  font-weight: 400;
  text-align: center;
  user-select: none;
}

.tj-mdm3-th-swver,
.tj-mdm3-td-swver {
  width: 96px !important;
  min-width: 92px !important;
  max-width: 106px !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  white-space: nowrap;
}

.tj-mdm3-td-swver {
  font-size: 11.5px !important;
  font-family: 'JetBrains Mono', monospace;
}

.tj-mdm3-swver-wrap {
  display: inline-flex;
  align-items: center;
}

.tj-mdm3-swver-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  background: #0a1120;
  border: 1px solid #2b4c75;
  color: #ffffff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.25px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tj-mdm3-swver-btn:hover {
  border-color: #38bdf8;
  background: #0f1b33;
}

.tj-mdm3-swver-btn.is-active {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10b981;
  color: #10b981;
}

.tj-mdm3-swver-btn-lbl {
  white-space: nowrap;
}

.tj-mdm3-swver-chevron {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Custom Dark Popover for SW VER (consistent dark navy like -ss2-, zero washed-out native select) */
.tj-mdm3-swver-popover {
  position: fixed;
  z-index: 99999;
  min-width: 160px;
  max-width: 240px;
  max-height: 290px;
  overflow-y: auto;
  background: #0b1222;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tj-mdm3-swver-opt {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.tj-mdm3-swver-opt:hover {
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
}

.tj-mdm3-swver-opt.is-selected {
  background: #1d63dc;
  color: #ffffff;
  font-weight: 700;
}

/* Per-Pillar Interactive Filter Header: [ MDM | TLM | AFC ] */
.tj-mdm3-tri-filter-bar {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 2px 3px;
  gap: 2px;
  border-radius: 6px;
  background: #0a1120;
  border: 1px solid #2b4c75;
  box-sizing: border-box;
}

.tj-mdm3-tri-seg {
  appearance: none;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 5px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.14s ease, color 0.14s ease;
}

.tj-mdm3-tri-seg:hover {
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
}

.tj-mdm3-tri-seg.is-on {
  background: rgba(16, 185, 129, 0.22);
  color: #10b981;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.55);
}

.tj-mdm3-tri-seg.is-off {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
}

.tj-mdm3-tri-seg-hazard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  color: #ffffff;
}

.tj-mdm3-tri-seg-hazard.is-hz-green {
  background: rgba(34, 197, 94, 0.22);
  color: #22c55e;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.55);
}

.tj-mdm3-tri-seg-hazard.is-hz-red {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
}

.tj-mdm3-tri-seg-hazard.is-hz-yellow {
  background: rgba(250, 204, 21, 0.22);
  color: #facc15;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.55);
}

.tj-mdm3-tri-seg-hazard.is-hz-blue {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.55);
}

.tj-mdm3-tri-seg-hazard.is-hz-safe {
  background: rgba(148, 163, 184, 0.20);
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.55);
}

.tj-mdm3-tri-pop-opt.opt-hz-green { color: #22c55e; }
.tj-mdm3-tri-pop-opt.opt-hz-red { color: #ef4444; }
.tj-mdm3-tri-pop-opt.opt-hz-yellow { color: #facc15; }
.tj-mdm3-tri-pop-opt.opt-hz-blue { color: #38bdf8; }
.tj-mdm3-tri-pop-opt.opt-hz-safe { color: #e2e8f0; }

.tj-mdm3-tri-pop-opt.opt-hz-green.is-selected { background: rgba(34, 197, 94, 0.18); }
.tj-mdm3-tri-pop-opt.opt-hz-red.is-selected { background: rgba(239, 68, 68, 0.18); }
.tj-mdm3-tri-pop-opt.opt-hz-yellow.is-selected { background: rgba(250, 204, 21, 0.18); }
.tj-mdm3-tri-pop-opt.opt-hz-blue.is-selected { background: rgba(56, 189, 248, 0.18); }
.tj-mdm3-tri-pop-opt.opt-hz-safe.is-selected { background: rgba(148, 163, 184, 0.22); }

.tj-mdm3-tri-fsep {
  color: #64748b;
  font-size: 10px;
  user-select: none;
  pointer-events: none;
}

.tj-mdm3-tri-popover {
  position: fixed;
  z-index: 99999;
  min-width: 84px;
  background: #0d1527;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tj-mdm3-tri-pop-title {
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 7px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  margin-bottom: 2px;
}

.tj-mdm3-tri-pop-opt {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #cbd5e1;
}

.tj-mdm3-tri-pop-opt:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tj-mdm3-tri-pop-opt.opt-on {
  color: #10b981;
}

.tj-mdm3-tri-pop-opt.opt-off {
  color: #f87171;
}

.tj-mdm3-tri-pop-opt.is-selected {
  background: rgba(56, 189, 248, 0.16);
}

.tj-mdm3-tri-pop-opt.opt-on.is-selected {
  background: rgba(16, 185, 129, 0.18);
}

.tj-mdm3-tri-pop-opt.opt-off.is-selected {
  background: rgba(239, 68, 68, 0.18);
}

/* Extra Dynamic AFC Columns */
.tj-mdm3-th-afc-extra {
  white-space: nowrap;
  color: #38bdf8 !important;
  font-size: 11.5px !important;
}

.tj-mdm3-td-afc-extra {
  white-space: nowrap;
  font-size: 12.5px;
  color: #cbd5e1;
}

/* Interactive Undelivered Column Header & Cell */
.tj-mdm3-th-undeliver {
  padding: 6px 8px !important;
  text-align: center !important;
  cursor: pointer;
  user-select: none;
}

.tj-mdm3-td-undeliver {
  text-align: center !important;
}

.tj-mdm3-th-undeliver-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.tj-mdm3-th-undeliver-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  color: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.tj-mdm3-th-undeliver-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.tj-mdm3-th-undeliver-title {
  letter-spacing: 0.5px;
  font-weight: 700;
}

.tj-mdm3-th-undeliver-sep {
  opacity: 0.45;
  font-weight: 400;
}

.tj-mdm3-th-undeliver-count {
  font-weight: 800;
}

.tj-mdm3-th-undeliver-count.has-count {
  color: #fbbf24;
}

.tj-mdm3-th-undeliver-count.zero-count {
  color: #64748b;
}

.tj-mdm3-th-undeliver-sort-arrow {
  font-size: 9px;
  margin-left: 2px;
  color: #fbbf24;
  line-height: 1;
}

@media (max-width: 640px) {
  .tj-mdm3-th-sn-row {
    max-width: none;
  }

  .tj-mdm3-th-body-afc .tj-mdm3-th-search-wrap,
  .tj-mdm3-th-afc-search .tj-mdm3-th-search-wrap {
    max-width: none;
  }

  .tj-mdm3-btn-mismatch-filter {
    height: 24px;
    min-width: 24px;
    padding: 0 4px;
  }

  .tj-mdm3-dual-status {
    grid-template-columns: 30px 8px 30px;
    padding: 2px 4px;
    font-size: 10.5px;
  }

  .tj-mdm3-dual-half {
    width: 30px;
    height: 17px;
  }

  .tj-mdm3-dual-sep {
    width: 8px;
  }

  .tj-mdm3-tri-status {
    grid-template-columns: 21px 5px 21px 5px 21px;
    padding: 2px 3px;
    font-size: 9.5px;
  }

  .tj-mdm3-tri-status.has-deploy-hazard {
    grid-template-columns: 21px 5px 21px 5px 21px 5px 19px;
  }

  .tj-mdm3-tri-hazard-cell {
    width: 19px;
    height: 17px;
  }

  .tj-mdm3-tri-cell {
    width: 21px;
    height: 17px;
  }

  .tj-mdm3-tri-sep {
    width: 5px;
  }

  .tj-mdm3-tri-filter-bar {
    height: 24px;
    padding: 1px 2px;
  }

  .tj-mdm3-tri-seg {
    font-size: 9.5px;
    padding: 2px 3px;
  }

  .tj-mdm3-th-swver,
  .tj-mdm3-td-swver {
    width: 86px !important;
    min-width: 82px !important;
    max-width: 92px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .tj-mdm3-td-swver {
    font-size: 10.5px !important;
  }

  .tj-mdm3-swver-btn {
    height: 24px;
    padding: 0 6px;
    font-size: 10px;
    gap: 4px;
  }
}

/* ==========================================================================
   ACT LOG — APK DOWNLOAD HISTORY POPUP (Telemetry Dark Cyber Theme)
   ========================================================================== */
.tj-mdm3-actlog-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  background: #0f172a;
  border: 1px solid #2b4c75;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-sizing: border-box;
  outline: none;
}

.tj-mdm3-actlog-trigger-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #ffffff;
}

.tj-actlog-backdrop {
  z-index: 12000;
  padding: 14px;
  box-sizing: border-box;
}

.tj-actlog-card {
  width: min(1220px, 96vw) !important;
  max-width: 1220px !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #0a101d !important;
  border: 1px solid rgba(0, 229, 255, 0.28) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.78), 0 0 28px rgba(0, 229, 255, 0.12) !important;
  overflow: hidden !important;
}

.tj-actlog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, #0d1629 0%, #0f1b31 100%);
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

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

/* Red [X] button at top-left */
.tj-actlog-close-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: #f87171;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.tj-actlog-close-x:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.tj-actlog-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tj-actlog-title {
  color: #f1f5f9;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.tj-actlog-badge-live {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.tj-actlog-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 0 16px;
  background: #0b1222;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tj-actlog-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tj-actlog-tab:hover {
  color: #e2e8f0;
}

.tj-actlog-tab.active {
  color: #00e5ff;
  border-bottom-color: #00e5ff;
  background: rgba(0, 229, 255, 0.06);
  border-radius: 6px 6px 0 0;
}

.tj-actlog-drill-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-bottom: 6px;
}

.tj-actlog-btn-back {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.tj-actlog-btn-back:hover {
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
}

.tj-actlog-drill-label {
  font-size: 11.5px;
  color: #cbd5e1;
  font-family: monospace;
}

.tj-actlog-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px 16px;
  gap: 10px;
  overflow: hidden;
}

.tj-actlog-search-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  flex-shrink: 0;
}

.tj-actlog-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
  min-width: 145px;
}

.tj-actlog-filter-status {
  flex: 0 1 180px;
}

.tj-actlog-filter-field label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.tj-actlog-input {
  height: 32px !important;
  font-size: 12px !important;
  padding: 0 28px 0 10px !important;
  width: 100%;
  box-sizing: border-box;
}

.tj-actlog-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.tj-actlog-input-box-combo .tj-actlog-input {
  padding-right: 52px !important;
}

.tj-actlog-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.14s ease;
}

.tj-actlog-clear-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.tj-actlog-clear-btn-combo {
  right: 28px;
}

.tj-actlog-drop-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.14s ease;
}

.tj-actlog-drop-btn:hover,
.tj-actlog-drop-btn.is-open {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
}

.tj-actlog-drop-btn.is-open svg {
  transform: rotate(180deg);
}

.tj-actlog-app-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 230px;
  overflow-y: auto;
  background: #0c1526;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.78);
}

.tj-actlog-app-opt {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 5px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.tj-actlog-app-opt:hover,
.tj-actlog-app-opt.active {
  background: rgba(0, 229, 255, 0.14);
}

.tj-actlog-app-opt-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
}

.tj-actlog-app-opt-pkg {
  font-size: 10px;
  color: #64748b;
  font-family: monospace;
}

.tj-actlog-app-empty {
  padding: 10px;
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

.tj-actlog-nobody-cell {
  font-family: monospace;
  font-weight: 700;
  color: #38bdf8;
  font-size: 11.5px;
  white-space: nowrap;
}

.tj-actlog-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-actlog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.tj-actlog-toolbar-left,
.tj-actlog-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-actlog-btn-danger,
.tj-actlog-btn-analysis,
.tj-actlog-btn-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 31px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tj-actlog-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.tj-actlog-btn-danger:hover:not(:disabled) {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.tj-actlog-btn-analysis {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.tj-actlog-btn-analysis:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.22);
  border-color: #00e5ff;
  color: #ffffff;
}

.tj-actlog-btn-danger:disabled,
.tj-actlog-btn-analysis:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tj-actlog-btn-refresh {
  width: 32px;
  padding: 0;
  background: #131f36;
  border: 1px solid #293a57;
  color: #cbd5e1;
}

.tj-actlog-btn-refresh:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: #00e5ff;
  color: #00e5ff;
}

.tj-actlog-btn-refresh.spinning svg {
  animation: tjActLogSpin 0.8s linear infinite;
}

.tj-actlog-col-wrap {
  position: relative;
}

.tj-actlog-btn-col {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 6px;
  background: #131f36;
  border: 1px solid #293a57;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.tj-actlog-btn-col:hover,
.tj-actlog-btn-col.is-open {
  background: rgba(0, 229, 255, 0.14);
  border-color: #00e5ff;
  color: #00e5ff;
}

.tj-actlog-col-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 205px;
  background: #0c1526;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.72);
}

.tj-actlog-col-menu-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 6px 6px 6px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 4px;
}

.tj-actlog-col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.tj-actlog-col-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.tj-actlog-col-item.locked {
  color: #94a3b8;
  cursor: default;
}

.tj-actlog-col-item-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tj-actlog-col-item input[type="checkbox"] {
  accent-color: #00e5ff;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.tj-actlog-col-item.locked input[type="checkbox"] {
  cursor: not-allowed;
  opacity: 0.7;
}

.tj-actlog-col-lock-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
}

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

.tj-actlog-analysis-panel {
  background: #0e1a30;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}

.tj-actlog-analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tj-actlog-analysis-title {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
}

.tj-actlog-analysis-hide {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.tj-actlog-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.tj-actlog-kpi {
  background: #091121;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 8px 10px;
}

.tj-actlog-kpi-label {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.tj-actlog-kpi-val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  font-family: monospace;
}

.tj-actlog-table-wrap {
  flex: 1;
  min-height: 200px;
  overflow: auto;
  background: #0d1526;
  border: 1px solid #1e293b;
  border-radius: 8px;
}

.tj-actlog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: #e2e8f0;
}

.tj-actlog-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #111c33;
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
  text-align: left;
  padding: 6px 7px;
  border-bottom: 1px solid #24334d;
  white-space: nowrap;
}

.tj-actlog-table tbody td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.75);
  vertical-align: middle;
  line-height: 1.25;
}

.tj-actlog-table tbody tr:hover {
  background: rgba(0, 229, 255, 0.05);
}

.tj-actlog-empty {
  text-align: center !important;
  color: #64748b;
  padding: 28px 10px !important;
  font-size: 12px;
}

.tj-actlog-app-title {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 11.5px;
  line-height: 1.2;
}

.tj-actlog-app-pkg {
  font-size: 10px;
  color: #64748b;
  font-family: monospace;
  margin-top: 1px;
  word-break: break-all;
}

.tj-actlog-sn-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tj-actlog-sn-code {
  font-family: monospace;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.tj-actlog-body-chip {
  display: inline-block;
  width: fit-content;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 9.5px;
  font-weight: 700;
}

.tj-actlog-params {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 150px;
}

.tj-actlog-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.tj-actlog-pill-info {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.tj-actlog-pill-green {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.tj-actlog-pill-amber {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.tj-actlog-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tj-actlog-desc-cell {
  font-size: 10.5px;
  color: #cbd5e1;
  max-width: 190px;
  word-break: break-word;
}

.tj-actlog-status-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.tj-actlog-status-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.48);
  color: #f87171;
}

.tj-actlog-status-info {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.tj-actlog-status-warn {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.tj-actlog-status-muted {
  background: rgba(100, 116, 139, 0.18);
  border: 1px solid rgba(100, 116, 139, 0.45);
  color: #94a3b8;
}

.tj-actlog-task-link {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-family: monospace;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tj-actlog-task-link:hover {
  color: #00e5ff;
}

.tj-actlog-row-btn {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.tj-actlog-row-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

.tj-actlog-row-btn-cancel {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.tj-actlog-row-btn-cancel:hover {
  background: #d97706;
  color: #ffffff;
}

.tj-actlog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 4px 2px 4px;
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}

.tj-actlog-page-left,
.tj-actlog-page-nav,
.tj-actlog-page-goto {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tj-actlog-page-goto input {
  width: 52px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  text-align: center;
  font-size: 12px;
}

.tj-actlog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0b1222;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.tj-actlog-footer-meta {
  font-size: 11.5px;
  color: #64748b;
}

/* Red [Close] button at bottom-right */
.tj-actlog-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 18px;
  border-radius: 7px;
  background: #dc2626;
  border: 1px solid #ef4444;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}

.tj-actlog-close-btn:hover {
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65);
}

@media (max-width: 768px) {
  .tj-mdm3-actlog-trigger-btn {
    padding: 0 9px;
    font-size: 10.5px;
    height: 28px;
    gap: 5px;
  }
}

@media (max-width: 640px) {
  .tj-actlog-backdrop {
    padding: 6px;
  }

  .tj-actlog-card {
    width: 98vw !important;
    max-height: 95vh !important;
  }

  .tj-actlog-header {
    padding: 9px 12px;
  }

  .tj-actlog-body {
    padding: 7px 8px;
    gap: 7px;
  }

  .tj-actlog-search-bar {
    padding: 7px 8px;
    gap: 6px;
  }

  .tj-actlog-filter-field {
    flex: 1 1 120px;
    min-width: 110px;
  }

  .tj-actlog-btn-danger span,
  .tj-actlog-btn-analysis span,
  .tj-actlog-btn-col span {
    font-size: 10.5px;
  }

  .tj-actlog-btn-danger,
  .tj-actlog-btn-analysis,
  .tj-actlog-btn-col {
    height: 28px;
    padding: 0 8px;
    gap: 4px;
  }

  .tj-actlog-btn-refresh {
    width: 28px;
    height: 28px;
  }

  .tj-actlog-table {
    font-size: 10.5px;
  }

  .tj-actlog-table thead th {
    padding: 5px 4px;
    font-size: 10px;
  }

  .tj-actlog-table tbody td {
    padding: 5px 4px;
  }

  .tj-actlog-app-title {
    font-size: 10.5px;
  }

  .tj-actlog-app-pkg {
    font-size: 9px;
  }

  .tj-actlog-sn-code {
    font-size: 10px;
  }

  .tj-actlog-status {
    padding: 2px 5px;
    font-size: 9.5px;
  }

  .tj-actlog-desc-cell {
    font-size: 9.5px;
    max-width: 130px;
  }

  .tj-actlog-footer {
    padding: 8px 12px;
  }
}

/* ========================================================================= */
/* CUSTOM DARK IN-APP CONFIRM DIALOG (Replaces native browser confirm())     */
/* ========================================================================= */
.tj-mdm3-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100025;
  background: rgba(3, 7, 15, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tj-mdm3-confirm-card {
  width: 100%;
  max-width: 390px;
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  color: #f1f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tj-mdm3-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 11px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.tj-mdm3-confirm-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.1px;
}

.tj-mdm3-confirm-x {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tj-mdm3-confirm-x:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

.tj-mdm3-confirm-body {
  padding: 15px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  white-space: pre-line;
}

.tj-mdm3-confirm-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 16px 14px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.45);
}

.tj-mdm3-confirm-btn {
  height: 33px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.tj-mdm3-confirm-btn-cancel {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.tj-mdm3-confirm-btn-cancel:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
}

.tj-mdm3-confirm-btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(248, 113, 113, 0.45);
  color: #ffffff;
}

.tj-mdm3-confirm-btn-danger:hover {
  filter: brightness(1.1);
}

.tj-mdm3-confirm-btn-warn {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: rgba(251, 191, 36, 0.45);
  color: #ffffff;
}

.tj-mdm3-confirm-btn-warn:hover {
  filter: brightness(1.1);
}

.tj-mdm3-confirm-btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.tj-mdm3-confirm-btn-primary:hover {
  filter: brightness(1.1);
}