/* ==========================================================
   VNPT HIS SQL INSPECTOR - MOBILE-FIRST STYLESHEET
   Dark Mode Aesthetic with Cyan/Emerald Accents & Glassmorphism
   ========================================================== */

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #121827;
  --bg-tertiary: #1b2438;
  --bg-glass: rgba(18, 24, 39, 0.85);
  --bg-card: rgba(23, 32, 51, 0.7);
  --bg-code: #080c14;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', Consolas, Monaco, 'Courier New', monospace;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Base App Layout (Sidebar + Main Content) */
.app-layout,
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
    var(--bg-primary);
  position: relative;
}

.app-main-wrapper {
  flex: 1;
  min-width: 0; /* Cho phép co giãn và code viewer cuộn ngang mượt mà */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(24px + var(--safe-bottom));
  transition: all 0.25s ease;
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------------- SIDEBAR NAVIGATION ---------------- */
.app-sidebar {
  width: 260px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 64px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-logo-box {
  position: relative;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 20px;
  height: 20px;
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Buttons inside Sidebar Header */
.btn-sidebar-collapse,
.btn-sidebar-close-mobile {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-sidebar-collapse:hover,
.btn-sidebar-close-mobile:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-sidebar-collapse svg,
.btn-sidebar-close-mobile svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

/* Sidebar Nav Scroll Area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 4px 10px;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.06));
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-cyan);
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-badge.hot {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.nav-badge.soon {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Sidebar Footer / User Profile Card */
.sidebar-footer {
  padding: 12px 10px calc(12px + var(--safe-bottom)) 10px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(11, 15, 25, 0.4);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.user-info-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-hospital {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-user-action {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-sidebar-user-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-sidebar-user-action svg {
  width: 16px;
  height: 16px;
}

/* Sidebar Collapsed State (Desktop) */
.app-sidebar.collapsed {
  width: 68px;
}

.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .nav-group-title,
.app-sidebar.collapsed .user-info-text,
.app-sidebar.collapsed .btn-sidebar-user-action {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
  padding: calc(14px + var(--safe-top)) 8px 14px 8px;
  justify-content: center;
}

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

.app-sidebar.collapsed .btn-sidebar-collapse svg {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.app-sidebar.collapsed .sidebar-footer {
  padding: 10px 6px calc(10px + var(--safe-bottom)) 6px;
}

.app-sidebar.collapsed .sidebar-user-card {
  justify-content: center;
  padding: 6px 0;
  border-color: transparent;
  background: transparent;
}

/* ---------------- TOP HEADER ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

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

/* Hamburger button */
.btn-hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-hamburger:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-hamburger svg {
  width: 20px;
  height: 20px;
}

.header-status-pill {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
}

.header-status-pill .status-indicator {
  position: static;
  width: 8px;
  height: 8px;
}

.logo-badge {
  position: relative;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.logo-icon {
  width: 22px;
  height: 22px;
}

.status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.status-indicator.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-indicator.offline {
  background-color: var(--accent-amber);
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.auth-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: 6px;
}

.auth-pill.logged-in {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:active {
  transform: scale(0.95);
  background: var(--border-subtle);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------------- MAIN CONTENT ---------------- */
.main-content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------- SEARCH CARD ---------------- */
.search-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.btn-clear {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-clear svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  height: 46px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

.recent-container {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-tag:active, .chip-tag:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: var(--border-accent);
}

/* ---------------- STEP 2: VARIANTS SECTION ---------------- */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

.badge-number {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
}

.section-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.valid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.invalid {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.variants-list-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.variants-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variant-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.variant-btn .tag-vi {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.variant-btn.active .tag-vi {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

/* ---------------- STEP 3: SQL INSPECTOR ---------------- */
.sql-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.sql-meta-bar {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.sql-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sql-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proc-type-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.sql-proc-name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-all;
}

.sql-details-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.detail-separator {
  color: var(--border-subtle);
}

/* Sticky Toolbar */
.sql-toolbar {
  position: sticky;
  top: 63px;
  z-index: 40;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar-group::-webkit-scrollbar {
  display: none;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tool-btn svg {
  width: 14px;
  height: 14px;
}

.tool-btn.highlight {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.tool-btn:active {
  transform: scale(0.95);
}

.font-sizer {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 2px;
}

.tool-btn-sm {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* Find Bar */
.sql-find-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border-bottom: 1px solid var(--border-accent);
  padding: 8px 12px;
  gap: 8px;
}

.find-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  flex: 1;
}

.find-input-box svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.find-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 100%;
}

.find-counter {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.find-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-find-nav {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
}

/* Code Viewer */
.code-viewer-container {
  position: relative;
  background: var(--bg-code);
  overflow-x: auto;
  min-height: 260px;
  max-height: 70vh;
}

.code-viewer-wrapper {
  display: flex;
  min-width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.line-numbers {
  display: flex;
  flex-direction: column;
  padding: 12px 10px 12px 8px;
  background: #06090f;
  color: #334155;
  user-select: none;
  text-align: right;
  border-right: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.6;
}

.line-numbers span {
  display: block;
}

.code-pre {
  margin: 0;
  padding: 12px 14px;
  flex: 1;
  overflow-x: visible;
  white-space: pre;
}

.code-pre.wrap {
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block {
  font-family: inherit;
  color: #cbd5e1;
}

/* SQL Syntax Highlight Tokens */
.sql-kw {
  color: #38bdf8; /* Cyan */
  font-weight: 600;
}

.sql-func {
  color: #c084fc; /* Purple */
  font-weight: 500;
}

.sql-type {
  color: #fbbf24; /* Amber */
}

.sql-str {
  color: #34d399; /* Green */
}

.sql-num {
  color: #fb923c; /* Orange */
}

.sql-comment {
  color: #64748b; /* Gray Slate */
  font-style: italic;
}

.sql-op {
  color: #f472b6; /* Pink */
}

.sql-highlight {
  background-color: #f59e0b;
  color: #000000;
  border-radius: 2px;
  padding: 0 2px;
}

.sql-highlight.current {
  background-color: #38bdf8;
  color: #000000;
  outline: 2px solid #ffffff;
}

/* ---------------- EMPTY GUIDE ---------------- */
.welcome-guide {
  padding: 24px 16px;
  display: flex;
  justify-content: center;
}

.guide-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  padding: 24px 18px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.guide-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.guide-icon svg {
  width: 28px;
  height: 28px;
}

.guide-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.guide-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.guide-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  width: 100%;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

/* ---------------- MODAL / BOTTOM SHEET ---------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end; /* Mobile: bottom sheet */
  justify-content: center;
  transition: opacity 0.2s ease;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.modal-title-group svg {
  width: 20px;
  height: 20px;
}

.modal-title-group h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  height: 44px;
  padding: 0 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

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

.password-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.btn-show-pass {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.btn-show-pass svg {
  width: 18px;
  height: 18px;
}

.session-info-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.info-label {
  color: var(--text-muted);
}

.info-val {
  color: var(--text-primary);
  font-weight: 500;
}

.info-val.mono {
  font-family: var(--font-mono);
}

.text-truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-actions {
  margin-top: 8px;
}

.full-width {
  width: 100%;
}

/* ---------------- TOAST NOTIFICATION ---------------- */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  pointer-events: none;
}

/* ---------------- UTILITIES ---------------- */
.hidden {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------------- VIEWS CONTAINER & MODULES ---------------- */
.views-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fadeInView 0.2s ease-out;
}

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

/* Extensible Module Placeholder Cards */
.module-placeholder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.module-header-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-status {
  font-size: 11px;
  color: var(--text-muted);
}

.module-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 6px;
}

.hero-icon-box svg {
  width: 24px;
  height: 24px;
}

.hero-icon-box.accent-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.hero-icon-box.accent-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.hero-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.extension-guide-box {
  background: rgba(56, 189, 248, 0.05);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.extension-guide-box h4 {
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.extension-guide-box p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.extension-guide-box code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #38bdf8;
}

/* Logs Filter & Terminal Preview */
.log-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-pill.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.mock-terminal-box {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.mock-terminal-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.mock-terminal-body {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-row {
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-row.info { color: #93c5fd; }
.log-row.success { color: #86efac; }
.log-row.warn { color: #fde047; }
.log-row.ready { color: #a5b4fc; }

/* BHYT Grid */
.bhyt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.bhyt-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.bhyt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.3);
}

.bhyt-card-icon {
  font-size: 24px;
}

.bhyt-card h4 {
  font-size: 14px;
  color: var(--text-primary);
}

.bhyt-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* User Guide Full Page */
.guide-full-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-header-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.guide-header-hero h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.guide-header-hero p {
  font-size: 13px;
  color: var(--text-secondary);
}

.guide-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.guide-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-info-card.full-span {
  grid-column: 1 / -1;
}

.guide-info-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcut-table th,
.shortcut-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.shortcut-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.shortcut-table td {
  color: var(--text-secondary);
}

.shortcut-table kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

.api-step-item {
  border-left: 2px solid var(--accent-cyan);
  padding-left: 12px;
  margin-bottom: 8px;
}

.api-tag.post {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  margin-right: 6px;
}

.api-step-item strong {
  font-size: 13px;
  color: var(--text-primary);
}

.api-step-item p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.api-step-item code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--accent-cyan);
}

/* ================= RESPONSIVE LAYOUT RULES ================= */

/* Mobile Screens (< 768px) */
@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .btn-sidebar-collapse {
    display: none; /* Chỉ dùng trên Desktop */
  }

  .btn-sidebar-close-mobile {
    display: flex; /* Hiện trên Mobile drawer */
  }

  .header-status-pill {
    display: none;
  }
}

/* Tablet & Desktop Screens (>= 768px) */
@media (min-width: 768px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .btn-sidebar-close-mobile {
    display: none !important;
  }

  .btn-sidebar-collapse {
    display: flex;
  }

  .header-status-pill {
    display: flex;
  }

  .modal-overlay {
    align-items: center; /* Center on desktop */
  }

  .modal-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
  }

  .app-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .main-content {
    padding: 24px;
  }

  .search-form {
    flex-direction: row;
  }

  .search-input-wrapper {
    flex: 1;
  }

  .btn-primary {
    width: auto;
    padding: 0 24px;
  }
}

/* ==========================================================================
   BHYT PORTAL MODULE STYLES (PURE CSS & MODERN MOBILE-FIRST)
   ========================================================================== */

.bhyt-header-hero {
  background: linear-gradient(135deg, rgba(18, 24, 39, 0.9) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.bhyt-hero-info {
  flex: 1;
}

.bhyt-hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.bhyt-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.bhyt-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bhyt-status-badge.offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.bhyt-status-badge.offline .status-dot {
  background: #94a3b8;
}

.bhyt-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.bhyt-status-badge.online .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-green 2s infinite;
}

.bhyt-status-badge.expired {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.bhyt-status-badge.expired .status-dot {
  background: #f43f5e;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.bhyt-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.bhyt-hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 800px;
}

.bhyt-hero-desc code {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.bhyt-session-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-bhyt-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-bhyt-action svg {
  width: 15px;
  height: 15px;
}

.btn-bhyt-action:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-bhyt-action.btn-bhyt-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Sub Navigation Tabs */
.bhyt-subtabs-nav {
  display: flex;
  gap: 8px;
  background: rgba(18, 24, 39, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.bhyt-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bhyt-subtab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.bhyt-subtab-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.15));
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.subtab-icon {
  font-size: 15px;
}

/* Subtab Panes */
.bhyt-subtab-pane {
  display: none;
}

.bhyt-subtab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Panel Card */
.bhyt-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  margin-bottom: 20px;
}

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

.panel-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  font-size: 20px;
}

.panel-title-box h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.panel-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Layout Grid */
.bhyt-grid-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

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

/* Form Styles */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-select,
.form-input {
  width: 100%;
  height: 42px;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-show-pass {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.btn-show-pass:hover {
  opacity: 1;
}

/* Captcha Interactive Box */
.captcha-group {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 6px;
}

.captcha-interactive-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.captcha-img-container {
  position: relative;
  width: 180px;
  height: 52px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.captcha-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.captcha-spinner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-icon {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-refresh-captcha {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-captcha svg {
  width: 15px;
  height: 15px;
}

.btn-refresh-captcha:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-refresh-captcha.spinning svg {
  animation: spin 0.6s linear infinite;
}

.captcha-input {
  letter-spacing: 2px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Submit Buttons */
.form-actions-bar {
  margin-top: 18px;
}

.btn-bhyt-submit {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-bhyt-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-bhyt-submit:active {
  transform: translateY(0);
}

.btn-bhyt-submit.btn-accent-emerald {
  background: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-bhyt-submit svg,
#btnRunExportCategory svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0 !important;
}

/* Session Info Card */
.session-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.session-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.session-info-row .info-label {
  color: var(--text-secondary);
}

.session-info-row .info-val {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.session-raw-cookies-box {
  margin-bottom: 16px;
}

.cookie-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.btn-copy-mini {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-copy-mini:hover {
  background: rgba(56, 189, 248, 0.15);
}

.cookie-textarea {
  width: 100%;
  height: 60px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 11px;
  resize: none;
  outline: none;
}

.bhyt-note-box {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bhyt-note-box strong {
  color: var(--accent-cyan);
}

/* Accordion for Endpoints */
.bhyt-endpoints-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  transition: all 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.accordion-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.bhyt-endpoints-accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 16px;
  background: rgba(11, 15, 25, 0.5);
  display: none;
  border-top: 1px solid var(--border-subtle);
}

.bhyt-endpoints-accordion.open .accordion-content {
  display: block;
}

/* Progress Box */
.export-progress-box {
  margin-top: 18px;
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-details {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Subtab 3: Error Dictionary */
.error-search-box {
  flex: 1;
  max-width: 400px;
}

.search-input {
  height: 38px;
  font-size: 12px;
}

.error-filter-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-weight: 600;
}

.error-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.error-card {
  background: rgba(18, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.error-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.error-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.error-code-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.error-group-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.error-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.error-card-cause {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 6px;
}

.error-card-solution {
  font-size: 12px;
  color: #a7f3d0;
  line-height: 1.5;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}

.error-card-solution strong {
  color: #34d399;
}

/* ==========================================================================
   BHYT MODULE: SUBTAB 2 - KẾT QUẢ GỬI HỒ SƠ QĐ 130
   ========================================================================== */
.qd130-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 16px;
  align-items: flex-end;
}

.qd130-search-form {
  margin-top: 10px;
}

.form-actions-inline {
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.form-actions-inline .btn-bhyt-submit {
  height: 42px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* KPI Summary Cards Grid */
.qd130-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.kpi-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.kpi-icon {
  font-size: 26px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.kpi-trans .kpi-icon { background: rgba(56, 189, 248, 0.12); }
.kpi-total .kpi-icon { background: rgba(168, 85, 247, 0.12); }
.kpi-valid .kpi-icon { background: rgba(16, 185, 129, 0.12); }
.kpi-error .kpi-icon { background: rgba(244, 63, 94, 0.12); }
.kpi-money .kpi-icon { background: rgba(245, 158, 11, 0.12); }

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kpi-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-valid .kpi-value { color: #34d399; }
.kpi-error .kpi-value { color: #fb7185; }
.kpi-money .kpi-value { color: #fbbf24; }

/* Table Controls */
.qd130-table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-mini {
  height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  min-width: 240px;
}

.qd130-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* QD130 Table */
.qd130-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
  max-height: 580px;
  overflow-y: auto;
}

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

.qd130-table th {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.qd130-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.qd130-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

.qd130-table tbody tr.has-error {
  background: rgba(244, 63, 94, 0.03);
}

.qd130-table tbody tr.has-error:hover {
  background: rgba(244, 63, 94, 0.07);
}

/* Cell Elements */
.cell-magd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.magd-text {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon-mini {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-icon-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.badge-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-tag.tag-checkin {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-tag.tag-kcb {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-tag.tag-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-tag.tag-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-num {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.badge-num.num-error {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-num.num-valid {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-num.num-zero {
  color: var(--text-muted);
}

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

.btn-action-table {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-action-table.btn-view-error {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-action-table.btn-view-error:hover {
  background: rgba(244, 63, 94, 0.25);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

.btn-action-table.btn-dl-excel {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.btn-action-table.btn-dl-excel:hover {
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Empty State */
.qd130-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.qd130-empty-state .empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.qd130-empty-state h4 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.qd130-empty-state p {
  font-size: 12px;
  max-width: 420px;
  margin: 0 auto;
}

/* Modal Error Details */
.modal-dialog.modal-lg {
  max-width: 860px;
}

.modal-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.modal-table-wrapper {
  max-height: 440px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.qd130-error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.qd130-error-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
}

.qd130-error-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.btn-link-dict {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-link-dict:hover {
  background: rgba(56, 189, 248, 0.25);
}

/* Date Presets & Date Input Enhancements */
.qd130-date-presets-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.presets-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.qd130-date-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-preset-date {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-date:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-preset-date.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
  font-weight: 600;
}

.date-input {
  cursor: pointer;
  color-scheme: dark;
}

/* PageSize Selector & Table Controls */
.table-pagesize-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-mini {
  padding: 5px 8px;
  font-size: 12px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.select-mini:focus {
  border-color: var(--accent-cyan);
}

/* Pagination Bar */
.qd130-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 12px;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 12px;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.btn-page:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 4px;
}

.page-num-input {
  width: 46px;
  height: 28px;
  text-align: center;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.page-num-input::-webkit-inner-spin-button,
.page-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .qd130-filter-grid {
    grid-template-columns: 1fr;
  }
  .qd130-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .qd130-table-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .search-mini {
    width: 100%;
  }
  .qd130-pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* ==========================================================================
   HIS SQL LOG INSPECTOR (DMC_TraCuuLogFunc / TRA.CUU.LOG) STYLES
   ========================================================================== */

.his-logs-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.his-logs-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
}

.his-logs-hero-info {
  flex: 1;
}

.his-logs-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tag-cyan {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #22d3ee !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
}

.tag-emerald {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.his-logs-title {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.his-logs-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 900px;
}

.his-logs-hero-actions {
  flex-shrink: 0;
}

/* Search & Filter Grid */
.his-logs-search-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-input-col {
  width: 100%;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.filter-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-select-sm {
  height: 38px;
  padding: 0 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.form-select-sm:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Stats Bar */
.his-logs-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin-top: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.stats-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--accent-cyan);
}

.stat-pill.query-tag code {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Logs Results & States */
.his-logs-results-wrap {
  margin-top: 16px;
}

.his-logs-loading-state,
.his-logs-empty-card {
  padding: 48px 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-top: 10px;
}

.spinner-large {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px auto;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.his-logs-empty-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 8px 0;
}

.his-logs-empty-card p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.his-logs-empty-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fbbf24;
}

/* Table Design */
.his-logs-table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

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

.table-his-logs th {
  background: rgba(30, 41, 59, 0.95);
  color: #94a3b8;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table-his-logs td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
  color: #e2e8f0;
}

.table-his-logs tbody tr {
  transition: background 0.15s ease;
}

.table-his-logs tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

.table-his-logs tbody tr.row-ora-error {
  background: rgba(244, 63, 94, 0.03);
}

.table-his-logs tbody tr.row-ora-error:hover {
  background: rgba(244, 63, 94, 0.08);
}

/* Table Column Widths & Content */
.col-rn {
  width: 50px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
}

.col-time {
  width: 150px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cbd5e1;
}

.col-section {
  width: 240px;
  max-width: 280px;
}

.section-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge-proc-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: #38bdf8;
  word-break: break-all;
}

.btn-open-sql-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 2px;
}

.btn-open-sql-tag:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.col-message {
  min-width: 280px;
  max-width: 500px;
}

.log-message-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ora-error-badge {
  display: inline-block;
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  font-size: 11px;
}

.col-user {
  width: 140px;
  white-space: nowrap;
}

.user-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.col-trace {
  width: 200px;
  max-width: 240px;
}

.trace-snippet {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #fda4af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-actions {
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

.actions-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-icon:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Mobile Card View */
.his-logs-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.his-log-mobile-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.his-log-mobile-card.card-ora-error {
  border-left: 3px solid #f43f5e;
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.05) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.mobile-card-time {
  color: #94a3b8;
  font-family: var(--font-mono);
}

.mobile-card-body {
  margin-bottom: 10px;
}

.mobile-card-section {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: #38bdf8;
  margin-bottom: 6px;
  word-break: break-all;
}

.mobile-card-msg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
  word-break: break-word;
}

.mobile-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Pagination */
.his-logs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.pagination-page-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.page-input {
  width: 48px;
  height: 30px;
  text-align: center;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Log Detail Modal Styles */
.log-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
}

.meta-val {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.log-detail-section-box {
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.section-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-box-title {
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-box-content {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  word-break: break-all;
}

.log-detail-box {
  margin-bottom: 16px;
}

.detail-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.detail-box-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.log-detail-pre {
  background: rgba(8, 12, 20, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.text-rose {
  color: #fb7185 !important;
}

@media (max-width: 768px) {
  .his-logs-hero {
    flex-direction: column;
    padding: 18px;
  }
  .filter-controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-item {
    width: 100%;
  }
  .form-select-sm {
    width: 100%;
  }
  .filter-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
  .filter-actions .btn-primary {
    flex: 1;
  }
  .his-logs-table-responsive {
    display: none;
  }
  .his-logs-mobile-list {
    display: flex;
  }
  .log-detail-meta-grid {
    grid-template-columns: 1fr;
  }
  .his-logs-pagination {
    flex-direction: column;
    gap: 12px;
  }
}

@media (min-width: 769px) {
  .his-logs-mobile-list {
    display: none !important;
  }
}

/* ==========================================================
   MASTER TOOL AUTHENTICATION & LOGIN PORTAL STYLES
   ========================================================== */

/* Locking behavior */
html.not-authenticated #app {
  display: none !important;
}

html:not(.not-authenticated) #appLoginPortal {
  display: none !important;
}

#appLoginPortal.hidden {
  display: none !important;
}

/* Master Login Portal Container */
.app-login-portal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #070a13;
  overflow-y: auto;
  padding: 24px 16px;
  user-select: none;
}

/* Animated Ambient Glow / Mesh Background */
.login-bg-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-grid-matrix {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, black 50%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 50%, transparent 95%);
  opacity: 0.7;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform, opacity;
}

.login-orb.orb-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  left: 20%;
  background: radial-gradient(circle, #0284c7 0%, rgba(2, 132, 199, 0) 70%);
  animation: floatOrb1 16s ease-in-out infinite alternate;
}

.login-orb.orb-2 {
  width: 480px;
  height: 480px;
  bottom: -120px;
  right: 15%;
  background: radial-gradient(circle, #4f46e5 0%, rgba(79, 70, 229, 0) 70%);
  animation: floatOrb2 20s ease-in-out infinite alternate;
}

.login-orb.orb-3 {
  width: 320px;
  height: 320px;
  top: 40%;
  right: 25%;
  background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
  opacity: 0.2;
  animation: floatOrb3 14s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.08); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -40px) scale(1.1); }
  100% { transform: translate(30px, -60px) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 50px) scale(1.15); }
}

/* Glassmorphism Login Card */
.login-card-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 450px;
  margin: auto;
  animation: loginCardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 22px;
  box-shadow: 
    0 25px 60px -12px rgba(0, 0, 0, 0.9),
    0 0 50px rgba(56, 189, 248, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 36px 32px 28px 32px;
  display: flex;
  flex-direction: column;
}

/* Brand Header */
.login-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-emblem-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-emblem-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #38bdf8, #10b981, #6366f1, #38bdf8);
  opacity: 0.6;
  filter: blur(4px);
  animation: spinSlow 8s linear infinite;
}

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

.login-emblem-icon {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.login-emblem-icon svg {
  width: 28px;
  height: 28px;
}

.login-brand-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.login-brand-subtitle {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 10px;
}

.login-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 9999px;
  font-size: 11px;
  color: #38bdf8;
  font-weight: 500;
}

.security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Alert Box */
.login-alert {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  line-height: 1.4;
  animation: shakeAlert 0.4s ease-in-out;
}

.login-alert.hidden {
  display: none !important;
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #f43f5e;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-card.shakeAlert {
  animation: shakeAlert 0.4s ease-in-out;
}

/* Login Fields */
.login-field-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

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

.login-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s;
}

.login-input-icon svg {
  width: 18px;
  height: 18px;
}

.login-input {
  width: 100%;
  height: 48px;
  background: rgba(8, 13, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0 14px 0 42px;
  color: #f8fafc;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-input:focus {
  border-color: #38bdf8;
  background: rgba(11, 18, 33, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 0 16px rgba(56, 189, 248, 0.15);
}

.login-input:focus + .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
  color: #38bdf8;
}

.btn-toggle-app-pass {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.btn-toggle-app-pass:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.btn-toggle-app-pass svg {
  width: 18px;
  height: 18px;
}

/* Options */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.login-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
  cursor: pointer;
}

/* Submit Button */
.btn-login-portal-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #1e40af 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login-portal-submit:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 50%, #2563eb 100%);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-login-portal-submit:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-login-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-login-text svg {
  width: 18px;
  height: 18px;
}

.btn-login-loader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Quick Fill Helper Box */
.login-helper-box {
  margin-top: 14px;
  text-align: center;
}

.btn-quick-fill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-quick-fill:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.btn-quick-fill strong {
  color: #e2e8f0;
}

/* Footer Notice */
.login-card-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.footer-security-text {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-dot {
  opacity: 0.5;
}

/* ==========================================================
   SIDEBAR & HEADER MASTER TOOL USER STYLES
   ========================================================== */

.tool-user-strip {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.tool-user-strip:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.tool-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.tool-user-avatar svg {
  width: 16px;
  height: 16px;
}

.tool-user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tool-user-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-user-title {
  font-size: 10px;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.tool-user-role {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 600;
}

.tool-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-tool-logout {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-tool-logout:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.5);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
  transform: scale(1.05);
}

.btn-tool-logout svg {
  width: 14px;
  height: 14px;
}

/* Header Logout Button */
.btn-header-logout {
  color: #94a3b8;
  transition: all 0.2s ease;
}

.btn-header-logout:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Sidebar collapsed adjustments */
.app-sidebar.collapsed .tool-user-details,
.app-sidebar.collapsed .btn-tool-logout {
  display: none !important;
}

.app-sidebar.collapsed .tool-user-strip {
  padding: 6px;
  justify-content: center;
}

/* Responsive adjustments for Login Screen */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px 22px 20px;
    border-radius: 18px;
  }
  .login-brand-title {
    font-size: 22px;
  }
}

/* ==========================================================
   VIEW: ACCOUNT & HOSPITAL MANAGER (MYSQL) STYLES
   ========================================================== */

.account-mgr-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 4px;
}

/* Hero Banner */
.account-mgr-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: 
    radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}

.account-mgr-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #38bdf8, #10b981);
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.account-mgr-hero h2 {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.account-mgr-hero p {
  font-size: 13px;
  color: #94a3b8;
  max-width: 650px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-hero-action svg {
  width: 16px;
  height: 16px;
}

/* Database Connection Status Bar */
.db-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.db-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-status-text {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
}

.db-storage-tag {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.db-status-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-host-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

.btn-xs-link {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-xs-link:hover {
  color: #7dd3fc;
}

/* Active Unit Highlight Card */
.active-unit-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(14, 165, 233, 0.06) 100%), var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.active-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.active-unit-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.5px;
}

.active-unit-meta-time {
  font-size: 12px;
  color: #64748b;
  font-family: var(--font-mono);
}

.active-unit-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.active-unit-main {
  flex: 1;
  min-width: 250px;
}

.active-unit-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.active-unit-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unit-code-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 10px;
  border-radius: 6px;
}

.unit-host-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 6px;
}

.active-unit-creds-grid {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cred-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cred-val {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  width: fit-content;
}

.status-pill.status-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-err {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-pill.status-untested {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Toolbar: Search & Filter */
.account-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.account-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 450px;
  display: flex;
  align-items: center;
}

.account-search-wrapper svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #64748b;
  pointer-events: none;
}

.account-search-input {
  width: 100%;
  height: 40px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 36px 0 38px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.account-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.account-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Table Card */
.account-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.account-data-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.account-data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.account-data-table tbody tr {
  transition: background 0.15s ease;
}

.account-data-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.03);
}

.account-data-table tbody tr.row-active {
  background: rgba(16, 185, 129, 0.04);
}

.account-data-table tbody tr.row-active td:first-child {
  position: relative;
}

.account-data-table tbody tr.row-active td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #10b981;
}

/* Table Actions */
.table-action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-tbl-action {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tbl-action.btn-use {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.btn-tbl-action.btn-use:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-tbl-action.btn-active-badge {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #10b981;
  cursor: default;
  font-weight: 700;
}

.btn-tbl-action.btn-test {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.btn-tbl-action.btn-test:hover {
  background: rgba(56, 189, 248, 0.22);
}

.btn-tbl-action.btn-edit {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: #cbd5e1;
}

.btn-tbl-action.btn-edit:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-tbl-action.btn-del {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.btn-tbl-action.btn-del:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #ffffff;
}

/* Empty State */
.account-empty-state {
  text-align: center;
  padding: 48px 24px;
}

.account-empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.account-empty-state h4 {
  font-size: 16px;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.account-empty-state p {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
}

/* Form Section Boxes in Modal */
.form-section-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.section-tag.his {
  background: #0284c7;
  color: #ffffff;
}

.section-tag.bhyt {
  background: #10b981;
  color: #ffffff;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Test Feedback Box */
.test-feedback-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.feedback-item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.mysql-test-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

.mysql-test-banner.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.mysql-test-banner.error {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .account-mgr-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .active-unit-body {
    flex-direction: column;
    align-items: flex-start;
  }
  .account-data-table {
    display: block;
    overflow-x: auto;
  }
}





