/* LTP TMS – design tokens lấy từ logo (kế hoạch mục 2.3) */
:root {
  --ltp-navy: #232265;
  --ltp-blue: #056bb6;
  --ltp-sky: #96d9ec;
  --ltp-star: #f5f122; /* chỉ trang trí, không dùng cho chữ */
  --ltp-primary-subtle: #e6f5fb;

  --bs-primary: var(--ltp-blue);
  --bs-primary-rgb: 5, 107, 182;
  --bs-link-color: var(--ltp-blue);
  --bs-link-color-rgb: 5, 107, 182;
  --bs-link-hover-color: var(--ltp-navy);
  --bs-link-hover-color-rgb: 35, 34, 101;
  --bs-body-bg: #f5f7fa;
  --bs-body-color: #1f2433;
  --bs-primary-bg-subtle: var(--ltp-primary-subtle);
}

.btn-primary {
  --bs-btn-bg: var(--ltp-blue);
  --bs-btn-border-color: var(--ltp-blue);
  --bs-btn-hover-bg: var(--ltp-navy);
  --bs-btn-hover-border-color: var(--ltp-navy);
  --bs-btn-active-bg: var(--ltp-navy);
  --bs-btn-active-border-color: var(--ltp-navy);
  --bs-btn-disabled-bg: var(--ltp-blue);
  --bs-btn-disabled-border-color: var(--ltp-blue);
}
.btn-outline-primary {
  --bs-btn-color: var(--ltp-blue);
  --bs-btn-border-color: var(--ltp-blue);
  --bs-btn-hover-bg: var(--ltp-blue);
  --bs-btn-hover-border-color: var(--ltp-blue);
  --bs-btn-active-bg: var(--ltp-navy);
}
.text-primary { color: var(--ltp-blue) !important; }
.text-navy { color: var(--ltp-navy) !important; }
.bg-primary-subtle { background-color: var(--ltp-primary-subtle) !important; }
.form-control:focus, .form-select:focus { border-color: var(--ltp-sky); box-shadow: 0 0 0 .2rem rgba(5, 107, 182, .2); }
.page-link { color: var(--ltp-blue); }
.page-item.active .page-link { background-color: var(--ltp-blue); border-color: var(--ltp-blue); }

/* ---------- Trang đăng nhập ---------- */
.ltp-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background-color: var(--bs-body-bg); background-image: radial-gradient(#d9dee8 1px, transparent 1px); background-size: 16px 16px; }
.ltp-auth-card { width: 100%; max-width: 420px; border: 0; border-radius: 16px; }
.ltp-auth-logo { width: 220px; max-width: 70%; height: auto; }

/* ---------- Thanh điều hướng ---------- */
.ltp-navbar { min-height: 52px; }
.ltp-brand-mark { height: 34px; width: auto; }
.ltp-app-icon-sm { width: 26px; height: 26px; }
.ltp-home-btn { font-size: 1.1rem; line-height: 1; }
.ltp-navbar .nav-link { color: #3a4152; font-size: .925rem; }
.ltp-navbar .nav-link.active, .ltp-navbar .nav-link:hover { color: var(--ltp-blue); }
.ltp-avatar { padding: 0; border: 0; }
.ltp-avatar::after { display: none; }
.ltp-avatar-circle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ltp-blue); color: #fff; font-weight: 600; font-size: .8rem; }
.ltp-avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.ltp-badge-dot { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #dc3545; color: #fff; font-size: .7rem; font-weight: 600; line-height: 18px; text-align: center; }
.ltp-max-w-280 { max-width: 280px; }
.ltp-qr { width: 200px; height: 200px; }
.ltp-recovery-codes li { padding: .1rem 0; }

/* ---------- Màn hình ứng dụng kiểu lưới (mục 3.1) ---------- */
.ltp-launcher-page { min-height: calc(100vh - 52px); background-color: var(--bs-body-bg);
  background-image: radial-gradient(#d9dee8 1px, transparent 1px); background-size: 16px 16px; }
.ltp-launcher { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.ltp-banner { background: #d4ecf3; border: 1px solid #b5dfeb; border-left: 4px solid var(--ltp-blue); color: #12325a; border-radius: 6px; }
.ltp-app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 1rem; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (min-width: 576px) { .ltp-app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 992px) { .ltp-app-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ltp-app-tile { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-decoration: none; color: #1f2433;
  border-radius: 16px; padding: .25rem; outline: none; }
.ltp-app-tile:focus-visible .ltp-app-icon { box-shadow: 0 0 0 3px var(--ltp-sky), 0 1px 3px rgba(31, 36, 51, .18); }
.ltp-app-icon { position: relative; width: 80px; height: 80px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(31, 36, 51, .12), 0 1px 2px rgba(31, 36, 51, .08); transition: transform .12s ease, box-shadow .12s ease; }
.ltp-app-icon img { width: 52px; height: 52px; }
.ltp-app-tile:hover .ltp-app-icon { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(31, 36, 51, .16); }
.ltp-app-label { font-size: 14px; text-align: center; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ltp-app-tile.ltp-dragging { opacity: .4; }
.ltp-app-tile.ltp-drop-target .ltp-app-icon { box-shadow: 0 0 0 3px var(--ltp-blue); }

/* ---------- Tìm kiếm Ctrl+K ---------- */
.ltp-search-results { max-height: 50vh; overflow-y: auto; }
.ltp-search-results .list-group-item.active { background: var(--ltp-primary-subtle); color: #1f2433; border-color: var(--ltp-sky); }
.ltp-search-results img { width: 22px; height: 22px; }

/* ---------- Trang trong ứng dụng ---------- */
.ltp-control-panel { background: #fff; border-bottom: 1px solid #e5e8ef; }
.ltp-breadcrumb { font-size: 1.1rem; }
.ltp-table thead th { background: #f8f9fb; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.ltp-table thead th a { color: inherit; text-decoration: none; }
.ltp-table tbody tr.ltp-row-link { cursor: pointer; }
.ltp-table tbody tr:hover { background: var(--ltp-primary-subtle); }
.ltp-form-card { max-width: 1100px; }
.ltp-status { font-size: .75rem; }
.ltp-kpi { border: 0; border-radius: 12px; }
.ltp-kpi .ltp-kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--ltp-navy); }
.ltp-chart-box { position: relative; height: 280px; }

@media (max-width: 767.98px) {
  .ltp-table-cards thead { display: none; }
  .ltp-table-cards tbody tr { display: block; border: 1px solid #e5e8ef; border-radius: 8px; margin-bottom: .75rem; background: #fff; }
  .ltp-table-cards tbody td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .75rem; }
  .ltp-table-cards tbody td::before { content: attr(data-label); font-weight: 600; color: #5b6275; }
}

/* ---------- Trang lỗi ---------- */
.ltp-error-page { min-height: 100vh; display: flex; align-items: center; }
.ltp-error-logo { height: 64px; width: auto; }
.ltp-search-box { max-width: 320px; }
.ltp-logo-preview { height: 48px; width: 96px; object-fit: contain; }
.ltp-notif-menu { width: 340px; max-height: 70vh; overflow-y: auto; }
.ltp-branch-btn { max-width: 220px; }
.ltp-kanban { overflow-x: auto; }
.ltp-kanban-col { min-width: 240px; max-width: 280px; flex: 0 0 auto; background: #f8f9fb; }
.ltp-kanban-card:hover { border-color: var(--ltp-sky); }
.ltp-timeline td { min-width: 14px; padding: 0; height: 22px; }
.ltp-timeline td.ltp-busy { background: var(--ltp-blue); }
.text-pre-wrap { white-space: pre-wrap; }
