  :root {
    --bg-primary: #0b0f17;
    --bg-card: rgba(22, 30, 46, 0.75);
    --bg-card-hover: rgba(30, 41, 64, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-blue: #0070f3;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --bg-modal: #1e293b;
    --border-modal: #334155;
    --bg-surface: var(--bg-modal);
    --bg-main: rgba(0, 0, 0, 0.2);
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
  }

  body {
    background-color: var(--bg-primary);
    background-image:
      radial-gradient(at 10% 10%, rgba(0, 112, 243, 0.12) 0px, transparent 50%),
      radial-gradient(at 90% 90%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 24px;
  }

  @media (max-width: 768px) {
    body {
      padding: 12px;
    }

    .data-section {
      padding: 16px;
    }

    .kpi-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 12px !important;
    }

    .kpi-card {
      padding: 12px;
    }

    .kpi-title {
      font-size: 11px;
    }

    .kpi-val {
      font-size: 20px;
    }

    .kpi-icon {
      width: 28px;
      height: 28px;
      font-size: 14px;
    }
  }

  /* Layout Container */
  .container {
    max-width: 1400px;
    margin: 0 auto;
  }

  /* Header Navbar */
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
  }

  @media (max-width: 768px) {
    .navbar {
      flex-direction: column;
      align-items: flex-start;
      padding: 16px;
    }

    .nav-actions {
      width: 100%;
      justify-content: space-between;
      flex-wrap: wrap;
    }
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 112, 243, 0.3);
  }

  .brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }

  .brand-text p {
    font-size: 12px;
    color: var(--text-muted);
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
  }

  .pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0% {
      opacity: 1;
      transform: scale(1);
    }

    50% {
      opacity: 0.4;
      transform: scale(1.2);
    }

    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  .btn-refresh {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .lang-switch {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    width: 68px;
    height: 30px;
  }

  .lang-option {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s ease;
    user-select: none;
  }

  .lang-option.active {
    color: #fff;
  }

  .lang-slider {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: 31px;
    background: var(--accent-blue);
    border-radius: 16px;
    z-index: 1;
    transition: transform 0.3s ease;
  }

  .lang-switch.is-en .lang-slider {
    transform: translateX(31px);
  }

  /* KPI Grid */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
  }

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

  .kpi-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
  }

  .kpi-val {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 4px;
  }

  .kpi-sub {
    font-size: 11px;
    color: var(--text-dim);
  }

  /* Charts Section */
  .charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }

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

  .chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 22px;
    border-radius: var(--radius-lg);
  }

  .card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .chart-container {
    position: relative;
    height: 260px;
    width: 100%;
  }

  /* Data Tables Section */
  .data-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
  }

  .table-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    margin: -24px -24px 20px -24px;
    padding: 24px 24px 12px 24px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide scrollbar for tabs */
  .table-tabs::-webkit-scrollbar {
    display: none;
  }

  .table-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  @media (max-width: 768px) {
    .table-tabs {
      margin: -16px -16px 20px -16px;
      padding: 16px 16px 12px 16px;
    }
  }

  .tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
  }

  .tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
  }

  .table-wrapper {
    overflow-x: auto;
  }

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

  th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
  }

  td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
  }

  tr:hover td {
    background: rgba(255, 255, 255, 0.03);
  }

  /* Ô Hành Động chứa nhiều nút (Users/Logs table) — luôn giữ 1 dòng, không wrap xuống dòng 2
     dù cột hẹp (thêm 2026-07-28, dùng chung cho mọi bảng có >1 nút hành động/dòng). */
  .action-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  /* Cột dữ liệu tĩnh (không click được, vd Phòng Ban/Chức Danh) — rút gọn bằng "..." khi dài,
     nhường không gian ngang cho cột có nút bấm (thêm 2026-07-28). */
  .col-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
  }

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

  .badge-inuse {
    background: rgba(0, 112, 243, 0.15);
    color: #60a5fa;
  }

  .badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
  }

  .badge-completed {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
  }

  /* Skeleton Loader */
  .skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
  }

  @keyframes loading {
    0% {
      background-position: 200% 0;
    }

    100% {
      background-position: -200% 0;
    }
  }

  /* ── Asset Register Filter Bar ─────────────────────────────────────── */
  .filter-toggle-btn {
    display: none;
    background: rgba(0, 112, 243, 0.15);
    border: 1px solid rgba(0, 112, 243, 0.3);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .mobile-filter-header {
    display: none;
    margin-bottom: 12px;
    justify-content: space-between;
    align-items: center;
  }

  .asset-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
  }

  @media (max-width: 768px) {
    .filter-toggle-btn {
      display: inline-block;
    }

    .mobile-filter-header {
      display: flex;
    }

    .asset-filter-bar {
      display: none;
    }

    /* Hidden by default on mobile */
  }

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

  .filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 90px;
  }

  /* Radio Chips */
  .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .radio-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s;
    user-select: none;
  }

  .radio-chip input[type="radio"] {
    display: none;
  }

  .radio-chip:has(input:checked),
  .radio-chip.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(0, 112, 243, 0.12);
  }

  .radio-chip:hover {
    border-color: rgba(0, 112, 243, 0.5);
    color: var(--text-main);
  }

  /* Status Chips */
  .status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .status-chip {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s;
    user-select: none;
  }

  .status-chip:hover {
    opacity: 0.85;
  }

  .status-chip.active {
    box-shadow: 0 0 0 2px currentColor;
  }

  .chip-available {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.08);
  }

  .chip-inuse-ok {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(96, 165, 250, 0.08);
  }

  .chip-inuse-missing {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
  }

  .chip-inuse-byod {
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.4);
    background: rgba(129, 140, 248, 0.08);
  }

  .chip-other {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(148, 163, 184, 0.08);
  }

  /* Status badges inside table */
  .badge-status-available {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
  }

  .badge-status-inuse-ok {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
  }

  .badge-status-inuse-miss {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
  }

  .badge-status-inuse-byod {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
  }

  .badge-status-other {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
  }

  /* ── Popup/Modal Shell — Style UX/UI dùng chung cho MỌI UI_Modal_*.html ──
     Đây là nguồn duy nhất (single source of truth) cho khung Popup: overlay,
     content, header, body, footer. KHÔNG lặp lại các thuộc tính này bằng
     inline style trong từng file UI_Modal_*.html — chỉ inline phần khác biệt
     thật sự của riêng modal đó (vd: max-width, max-height). */
  .modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center; justify-content: center;
  }
  .modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-modal);
    border-radius: var(--radius-md);
    width: 90%; max-width: 1000px; height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }
  .modal-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
  }
  .modal-header h3 {
    margin: 0; font-size: 16px; color: var(--text-main);
  }
  .modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; transition: color 0.2s;
  }
  .modal-close:hover { color: #ef4444; }
  .modal-body {
    flex: 1; padding: 20px 24px; overflow: hidden;
  }
  .modal-body iframe {
    width: 100%; height: 100%; border: none;
  }
  .modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 10px;
  }
  .btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 9px 18px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px; font-weight: 600;
  }
  .btn-primary {
    background: var(--accent-blue);
    border: none; color: #fff;
    padding: 9px 18px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px; font-weight: 600;
  }

  /* ── Tab Header Action Button (.btn-action) — nút hành động nhỏ ở đầu mỗi
     UI_Tab_*.html (Thêm Mới / Map File / Quét File Index...). Trước
     2026-07-27, 6 nút này ở 5 file Tab tự lặp lại y hệt 1 khối inline CSS. ── */
  .btn-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: none; border-radius: var(--radius-sm);
    color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s;
  }
  .btn-action:hover { opacity: 0.9; }
  .btn-action.blue { background: #3b82f6; }
  .btn-action.green { background: var(--accent-green); }

  /* ── Popup Form Fields (.it-form) — Style UX/UI dùng chung cho form bên
     trong mọi Popup (Asset/User/License/Roadmap/Flow). Trước 2026-07-27 khối
     này nằm nhầm trong UI_Modal_AssetForm.html dù 4 modal khác cũng dùng. ── */
  .it-form .form-row { display: flex; gap: 15px; margin-bottom: 15px; }
  .it-form .form-group { margin-bottom: 15px; display: flex; flex-direction: column; }
  .it-form .form-group.half { width: 50%; }
  .it-form .form-group.third { width: 33.33%; }
  .it-form label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
  .it-form .required { color: #ef4444; }
  .it-form input[type="text"], .it-form input[type="email"], .it-form input[type="number"],
  .it-form input[type="date"], .it-form select, .it-form textarea {
    padding: 10px 12px; border-radius: 6px; border: 1px solid #475569; background: #0f172a; color: #f8fafc; font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  }
  .it-form input:focus, .it-form select:focus, .it-form textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
  .it-form .form-hint { font-size: 11px; color: #94a3b8; margin-top: 4px; }