/* ===== SHELL LOGIN & LOADING (unscoped — outside any container) ===== */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

#man_hinh_tai {
  position: fixed;
  inset: 0;
  background: #025b48;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease;
}
#man_hinh_tai.an_di {
  opacity: 0;
  pointer-events: none;
}

.vong_quay {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: quay 0.8s linear infinite;
  margin-bottom: 16px;
}

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

#man_hinh_tai p {
  color: white;
  font-size: 16px;
  opacity: 0.9;
}

#man_hinh_dang_nhap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #013d30 0%, #025b48 45%, #04604e 75%, #00875a 100%);
  z-index: 99999;
  padding: 24px;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, sans-serif;
}
#man_hinh_dang_nhap.an {
  display: none !important;
}

.hop_dang_nhap {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.dau_hop_dang_nhap {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 32px 32px 24px;
  background: linear-gradient(135deg, #025b48, #04604e);
  text-align: center;
}

.logo_dang_nhap {
  width: 72px;
  height: 72px;
  max-width: 72px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
  display: block;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.title-top, .title-main {
  color: #ffffff;
  white-space: normal;
  overflow: visible;
  text-align: center;
}

.title-top {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.78;
}

.title-main {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.than_hop_dang_nhap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 28px 32px 32px;
  background: #ffffff;
}

.nhom_nhap_lieu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.nhom_nhap_lieu label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
}

.nhom_nhap_lieu input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1.5px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.nhom_nhap_lieu input:focus {
  border-color: #025b48;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 91, 72, 0.12);
}

.vung_nhap_mat_khau {
  width: 100%;
  position: relative;
}

.vung_nhap_mat_khau input[type="password"] {
  padding-right: 44px;
}

.eye-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
}

.nut_hien_mat_khau {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #6b7280;
  line-height: 1;
  cursor: pointer;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

.nut_hien_mat_khau:hover {
  background: #eef4f1;
  color: #025b48;
}

.nut_dang_nhap {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #025b48;
  box-shadow: 0 2px 8px rgba(2, 91, 72, 0.30);
  color: #ffffff;
  font-weight: 800;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.15;
}

.nut_dang_nhap:hover {
  background: #014d3c;
  box-shadow: 0 4px 16px rgba(2, 91, 72, 0.40);
}

.thong_bao_loi {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  font-weight: 900;
  display: none;
}

.thong_bao_loi.hien {
  display: block;
}

/* ===== MOBILE LOGIN ===== */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  #man_hinh_dang_nhap { padding: 18px; }
  .hop_dang_nhap { width: min(420px, 100%); }
  .dau_hop_dang_nhap { padding: 28px 24px 22px; }
  .logo_dang_nhap { width: 64px; height: 64px; max-width: 64px; }
  .title-top { font-size: 12px; }
  .title-main { font-size: 18px; }
  .than_hop_dang_nhap { padding: 24px; gap: 14px; }
  .nhom_nhap_lieu input, .nut_dang_nhap { min-height: 42px; }
}

/* ===== SHELL HEADER ===== */
#shell-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #ffffff;
  z-index: 10001;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.shell-header-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, sans-serif;
}

.shell-header-top {
  color: #025b48;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.shell-header-sub {
  color: #047a60;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shell-header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.shell-header-logo {
  height: 95%;
  width: auto;
  object-fit: contain;
}

/* ===== SHELL TAB BAR ===== */
.shell-tab-bar {
  display: flex;
  align-items: center;
  background: #025b48;
  padding: 0 16px;
  min-height: 52px;
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  z-index: 10000;
  gap: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.shell-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.shell-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.shell-tab.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.shell-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.shell-tab-label {
  line-height: 1.2;
}

.shell-user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shell-user-name {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-logout-btn {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Manulife JH Sans', 'ManulifeJHSans', 'Segoe UI', -apple-system, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.shell-logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Content containers */
.shell-content {
  position: relative;
}

.hl-container, .mod-container, .thunhap-container {
  width: 100%;
  min-height: calc(100vh - 100px);
}

.hl-container #ung_dung {
  display: flex;
  min-height: calc(100vh - 100px);
}

.mod-container {
  overflow-x: hidden;
}

.thunhap-container {
  overflow-x: hidden;
  background: #f5f5f5;
  padding-top: 100px;
}

/* ===== TABLET ===== */
@media (max-width: 1024px) {
  .shell-tab-bar {
    padding: 0 6px;
    min-height: 44px;
    gap: 2px;
  }
  .shell-tab {
    padding: 6px 10px;
    font-size: 11px;
    gap: 3px;
  }
  .shell-tab-icon { font-size: 13px; }
  .shell-tab-label { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  .shell-user-name { max-width: 100px; font-size: 11px; }
  .shell-logout-btn { padding: 4px 8px; font-size: 10px; }
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .shell-tab-bar {
    padding: 0 4px;
    min-height: 40px;
    gap: 1px;
  }
  .shell-tab {
    padding: 5px 6px;
    font-size: 10px;
    gap: 2px;
    border-radius: 4px;
  }
  .shell-tab-icon { font-size: 12px; }
  .shell-tab-label { max-width: 55px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell-user-name { display: none; }
  .shell-logout-btn { padding: 4px 6px; font-size: 9px; }
  .shell-header-top { font-size: 11px; }
  .shell-header-sub { font-size: 9px; }
  .shell-header-logo { height: 85%; }
}
