/* ============================================================
   ROOT — DESIGN TOKENS
   ============================================================ */
:root {
  /* BRAND — MODERN LUXURY · NAVY & VÀNG ĐỒNG */
  --navy-ink:    #12212E;   /* header, chữ trên nền vàng đồng */
  --navy-deep:   #0D1B24;   /* đáy gradient navy */
  --gold:        #C9A24B;
  --gold-soft:   #E4C880;
  --gold-deep:   #8F6E2E;   /* vàng đồng đậm — chữ badge */
  --cream:       #F4EFE3;   /* chữ sáng trên navy */
  --beige:       #EDE7D6;   /* nền badge số lượng */
  --beige-2:     #F1EEE3;   /* nền badge ADMIN trên thẻ */

  /* Token cũ — GIỮ TÊN (được tham chiếu khắp file) nhưng trỏ sang bảng màu mới */
  --cyan-dark:   #1B3A4B;
  --cyan-mid:    #24465A;
  --cyan:        #2A4F73;
  --cyan-light:  #C9A24B;
  --cyan-xlight: #F6F1E4;

  /* NEUTRALS */
  --bg:          #F6F3EC;
  --surface:     #FFFFFF;
  --surface-2:   #FBF9F3;
  --border:      #F0EBDF;
  --border-dark: #ECE7D9;

  /* TEXT */
  --text-primary:   #1B2A33;
  --text-secondary: #6B7B85;
  --text-muted:     #9CA7AC;
  --text-inverse:   #FFFFFF;

  /* STATUS */
  --success-bg:     #F0FDF4;
  --success-fg:     #16A34A;
  --success-border: #BBF7D0;
  --warning-bg:     #FFFBEB;
  --warning-fg:     #D97706;
  --warning-border: #FDE68A;
  --info-bg:        #EEF2F7;
  --info-fg:        #2A4F73;
  --info-border:    #D4DEE9;
  --danger-bg:      #FEF2F2;
  --danger-fg:      #DC2626;
  --danger-border:  #FECACA;

  /* SPACING */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* SHADOW */
  --shadow-sm: 0 1px 3px rgba(18,33,46,.06);
  --shadow-md: 0 4px 16px rgba(18,33,46,.10), 0 2px 6px rgba(18,33,46,.05);
  --shadow-lg: 0 12px 40px rgba(18,33,46,.12), 0 4px 12px rgba(18,33,46,.06);

  /* TRANSITION */
  --transition: all 0.18s ease;
}

/* ============================================================
   BASE — RESET & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text-primary); }
p { margin: 0; }

/* ============================================================
   COMPONENTS — NAVBAR
   ============================================================ */
.navbar {
  /* Navy đậm + viền gradient vàng đồng 4px phía trên (vẽ bằng lớp background để không đổi chiều cao) */
  background:
    linear-gradient(90deg, #C9A24B 0%, #E4C880 50%, #C9A24B 100%) top / 100% 4px no-repeat,
    #12212E;
  height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(13,27,36,.35), inset 0 -1px 0 rgba(255,255,255,.06);
}

/* Logo area */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand:hover { text-decoration: none; }

.navbar-logo-box {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #1B3A4B 0%, #0D1B24 100%);
  border: 1px solid rgba(201,162,75,.30);
  border-radius:8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.navbar-logo-box img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.navbar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.navbar-brand-name {
  font-size: 15.3px;             /* 18px − 15% */
  font-weight: 800;
  color: #F4EFE3;
  letter-spacing: 0.4px;
}
.navbar-brand-unit {
  font-size: 11px;               /* 13px − 15% */
  font-weight: 600;
  color: #9CB0BE;
}

/* Nav links (center) */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.navbar-nav .nav-link {
  font-size: 12.1px;              /* 13px − 15%, +10% */
  font-weight: 500;
  color: #D9E2E8;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}
.navbar-nav .nav-link:hover {
  color: #E4C880;
  background: rgba(228,200,128,.08);
  text-decoration: none;
}
.navbar-nav .nav-link.active {
  color: #E4C880;
  background: rgba(228,200,128,.10);
}
.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: linear-gradient(90deg, #C9A24B, #E4C880);
  border-radius: 2px;
}

/* User area (right) */
.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
/* User chip + dropdown */
.user-menu { position: relative; flex-shrink: 0; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  transition: var(--transition);
  cursor: pointer;
}
.user-menu-trigger:hover {
  background: rgba(255,255,255,.15);
}
.user-menu.open .user-menu-trigger {
  background: rgba(255,255,255,.18);
}

.user-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A24B 0%, #8F6E2E 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  font-size: 13px;
  font-weight: 700;
  color: #12212E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-menu-id {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  text-align: left;
}
.user-menu-name {
  font-size: 12.1px;              /* 13px − 15%, +10% */
  font-weight: 600;
  color: #F4EFE3;
  max-width: 168px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-unit {
  font-size: 9.9px;               /* 10.5px − 15%, +10% */
  font-weight: 400;
  color: #9CB0BE;
  max-width: 168px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-caret {
  font-size: 13px;               /* 15px − 15% */
  color: #9CB0BE;
  margin-right: 2px;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.user-menu.open .user-menu-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 256px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 200;
}
.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
}
.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A24B 0%, #8F6E2E 100%);
  box-shadow: 0 2px 8px rgba(143,110,46,.32);
  font-size: 16px;
  font-weight: 700;
  color: #12212E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-dropdown-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-unit {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-sep { height: 1px; background: var(--border); margin: 0 6px 6px; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.user-dropdown-item i {
  font-size: 17px;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.user-dropdown-item:hover {
  background: var(--cyan-xlight);
  color: var(--cyan);
  text-decoration: none;
}
.user-dropdown-item:hover i { color: var(--cyan); }
.user-dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.user-dropdown-item.danger:hover i { color: var(--danger-fg); }

/* Navbar login link */
.navbar-login-link {
  font-size: 11px;               /* 13px − 15% */
  font-weight: 500;
  color: #D9E2E8;
  text-decoration: none;
  transition: var(--transition);
}
.navbar-login-link:hover {
  color: #E4C880;
  text-decoration: none;
}

/* ============================================================
   COMPONENTS — BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 18px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(201,162,75,.25); }

.btn-primary {
  background: var(--cyan-dark);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--cyan-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--text-inverse);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--cyan-dark);
  border: 1.5px solid var(--border-dark);
}
.btn-secondary:hover {
  background: var(--cyan-xlight);
  border-color: var(--cyan-light);
  color: var(--cyan-dark);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1.5px solid var(--danger-border);
}
.btn-danger:hover {
  background: #FEE2E2;
  color: var(--danger-fg);
}

.btn-sm { height: 32px; font-size: 12px; padding: 0 12px; }
.btn-block { width: 100%; height: 46px; font-size: 14px; font-weight: 600; }

/* Nút submit trang Login — font to hơn 20% (14px → 17px) */
.login-form-wrap .btn-block { font-size: 17px; }

/* ============================================================
   COMPONENTS — FORM INPUTS
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.field:last-of-type { margin-bottom: 0; }

.field label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: #FDFCF8;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.field textarea { height: auto; padding: 12px 14px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }

.field input:hover,
.field select:hover { border-color: #D8CBA6; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(201,162,75,.12);
}

/* Password wrapper with toggle */
.input-password-wrap {
  position: relative;
}
.input-password-wrap input {
  padding-right: 44px;
}
.input-password-wrap .toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  font-size: 16px;
  transition: color .15s;
}
.input-password-wrap .toggle-pwd:hover { color: var(--cyan); }
.input-password-wrap .toggle-pwd:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(201,162,75,.25);
  border-radius: 4px;
}

/* ============================================================
   COMPONENTS — BADGES & ALERTS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-info    { background: var(--info-bg);    color: var(--info-fg);    border: 1px solid var(--info-border); }
.badge-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-fg);  border: 1px solid var(--danger-border); }
.badge-muted   { background: #F0EDE4; color: var(--text-muted); border: 1px solid #E4DFD2; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-fg);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-fg);
}
.alert-warn {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-fg);
}
.alert > i { flex: none; font-size: 18px; line-height: 1.45; }

/* ============================================================
   ADMIN — PHIÊN ĐĂNG NHẬP (Sessions)
   ============================================================ */
.sess-machine { display: flex; flex-direction: column; gap: 3px; }
.sess-machine .u-sub { display: inline-flex; align-items: center; gap: 4px; }
.sess-apps { display: flex; flex-wrap: wrap; gap: 4px; }
.sess-ago { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   COMPONENTS — CARD
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

/* ============================================================
   COMPONENTS — TABLE
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  background: #FBF9F3;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #FBF9F3; }

/* ============================================================
   COMPONENTS — TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ============================================================
   PAGE — LOGIN  (gradient shell + white floating card)
   ============================================================ */
.login-shell {
  display: flex;
  min-height: 100vh;    
  position: relative;
  overflow: hidden;
}

/* ── Decorative orbs — trên nền gradient ── */
.login-deco-1 {
  position: absolute;
  bottom: -160px;
  left: -130px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  pointer-events: none;
  z-index: 0;
}
.login-deco-2 {
  position: absolute;
  top: -90px;
  left: 100px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
  z-index: 0;
}

/* ── Left panel — căn giữa card, stretch theo chiều cao form card ── */
.login-panel-brand {
  flex: 1;
  padding: 40px 40px 40px 64px;
  display: flex;
  align-items: center;        /* căn giữa dọc */
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  background: transparent;
  overflow: hidden;
}
/* Xóa accent bar cũ */
.login-panel-brand::before { display: none; }

/* Card bọc nội dung trái — border nhẹ + glassmorphism nhẹ */
.login-brand-card {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 20px;
  padding: 40px 40px;
  width: 100%;
  max-width: 480px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

/* Brand top row */
.login-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.login-brand-logo {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.login-brand-logo img { width: 34px; height: 34px; object-fit: contain; }
.login-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.login-brand-name { font-size: 13px; font-weight: 600; color: #fff; }
.login-brand-unit { font-size: 10px; color: rgba(255,255,255,.55); margin-top: 1px; }

/* Hero text — uppercase bold như mockup */
.login-hero {
  position: relative;
  z-index: 1;
}
.login-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  white-space: nowrap;   /* chặn xuống dòng */
}
.login-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,.62);
  line-height: 1.7;
  max-width: 320px;
  margin-bottom: 28px;
}
.login-feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.login-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: rgba(255,255,255,.82);
}
.login-feature-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #34D399;
  flex-shrink: 0;
}

/* Copyright */
.login-copy {
  font-size: 11px;
  color: rgba(255,255,255,.30);
  position: relative;
  z-index: 1;
}

/* ── Right panel — container căn giữa white card ── */
.login-panel-form {
  flex: 0 0 48%;
  background: transparent;
  padding: 40px 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* White floating card */
.login-form-wrap {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.24), 0 8px 20px rgba(0,0,0,.12);
  padding: 44px 40px;
  max-width: 390px;
  width: 100%;
}

/* ── Back to home link ── */
.login-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0;
  margin-bottom: 24px;
  transition: var(--transition);
}
.login-back-link:hover {
  color: #2A4F73;
  text-decoration: none;
  gap: 8px;          /* icon lùi nhẹ khi hover */
}
.login-back-link i { font-size: 14px; transition: var(--transition); }

/* Mobile logo (ẩn trên desktop) */
.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-mobile-logo {
  width: 36px; height: 36px;
  background: var(--cyan-dark);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.login-mobile-logo img { width: 28px; height: 28px; object-fit: contain; }
.login-mobile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.login-mobile-unit { font-size: 10px; color: var(--text-muted); }

/* Form heading */
.login-form-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.login-form-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Input fields — bo góc nhiều hơn */
.login-form-wrap .field input,
.login-form-wrap .input-password-wrap input {
  border-radius: 10px;
}

/* Submit button — pill-like như mockup */
.login-form-wrap .btn-block {
  height: 50px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.login-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 22px;
  gap: 8px;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.login-remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: #2A4F73;
  cursor: pointer;
  margin: 0;
}
.login-forgot {
  font-size: 13px;
  font-weight: 500;
  color: #2A4F73;
}
.login-forgot:hover { text-decoration: underline; }

/* ============================================================
   LOGIN — XÁC THỰC "TÔI KHÔNG PHẢI LÀ NGƯỜI MÁY"
   (widget tự host, trạng thái điều khiển qua #human-check[data-state])
   ============================================================ */
.human-check { margin: 4px 0 14px; }

.hc-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.hc-box:hover { border-color: var(--gold); background: #FFFDF7; }

.hc-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.hc-mark {
  flex: none;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF;
  border: 2px solid #B9C3CB;
  border-radius: 6px;
  transition: var(--transition);
}
.hc-mark i { font-size: 16px; color: #FFFFFF; opacity: 0; transition: var(--transition); }

.hc-spin {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(201, 162, 75, .25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: hc-spin .7s linear infinite;
}
@keyframes hc-spin { to { transform: rotate(360deg); } }

.hc-input:focus-visible + .hc-mark {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, .35);
}

.hc-text { font-size: 14px; font-weight: 500; color: var(--text-primary); }

.hc-brand {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.15; text-align: center;
}
.hc-brand i { font-size: 18px; color: var(--gold); }
.hc-brand-name { font-size: 9px; font-weight: 700; letter-spacing: .4px; color: var(--text-secondary); }
.hc-brand-sub  { font-size: 8px; color: var(--text-muted); }

.hc-msg {
  margin: 6px 2px 0;
  min-height: 15px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Đang kiểm tra --- */
#human-check[data-state="checking"] .hc-box  { cursor: progress; border-color: var(--gold); }
#human-check[data-state="checking"] .hc-mark { border-color: var(--gold); }
#human-check[data-state="checking"] .hc-mark i { display: none; }
#human-check[data-state="checking"] .hc-spin { display: block; }

/* --- Đã xác thực --- */
#human-check[data-state="ok"] .hc-box  { cursor: default; background: var(--success-bg); border-color: var(--success-border); }
#human-check[data-state="ok"] .hc-mark { background: var(--success-fg); border-color: var(--success-fg); }
#human-check[data-state="ok"] .hc-mark i { opacity: 1; }
#human-check[data-state="ok"] .hc-msg  { color: var(--success-fg); font-weight: 500; }

/* --- Lỗi / chưa tick --- */
#human-check[data-state="error"] .hc-box  { background: var(--danger-bg); border-color: var(--danger-border); animation: hc-shake .3s ease; }
#human-check[data-state="error"] .hc-mark { border-color: var(--danger-fg); }
#human-check[data-state="error"] .hc-msg  { color: var(--danger-fg); }
@keyframes hc-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Màn hình hẹp: bỏ chữ ở khối thương hiệu, chừa chỗ cho dòng "Tôi không phải là người máy" */
@media (max-width: 420px) {
  .hc-box  { padding: 11px 12px; gap: 10px; }
  .hc-text { font-size: 13px; }
  .hc-brand-name, .hc-brand-sub { display: none; }
}

/* Honeypot — đẩy khỏi khung nhìn, người dùng & trình đọc màn hình không thấy, bot đọc DOM thì thấy */
.hc-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.login-support {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.login-support a {
  font-weight: 500;
  color: #2A4F73;
}

/* ============================================================
   PAGE — HOME (unauthenticated)
   ============================================================ */
.home-body {
  min-height: calc(100vh - 56px - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden; 
}


/* Giữ class phòng dùng sau */
.home-shapes { display: none; }
.hs { display: none; }

.home-center-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(18,33,46,.14), 0 0 0 1px rgba(255,255,255,.50) inset;
  position: relative;
  z-index: 1;
}

/* Nút đăng nhập — to hơn 20% (40px → 48px) */
.home-center-card .btn {
  height: 48px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.1px;
}

.home-icon {
  width: 56px; height: 56px;
  background: var(--cyan-dark);
  border-radius: 16px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-icon svg { width: 28px; height: 28px; }
.home-center-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.home-center-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 300px;
  margin: 0 auto 28px;
}

/* ============================================================
   HOME — PUBLIC APPS (Kỷ yếu & các trang công khai)
   ============================================================ */
.home-public-row { margin-top: 20px; }

.home-public-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.home-public-divider::before,
.home-public-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dark);
}

.home-public-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, .60);
  text-decoration: none;
  transition: var(--transition);
}
.home-public-app:hover {
  background: rgba(255, 255, 255, .85);
  border-color: rgba(156,59,74,.45);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(156,59,74,.15);
}

.hpa-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #9C3B4A, #722B36);
  color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hpa-text { flex: 1; line-height: 1.3; }
.hpa-name { display: block; font-size: 18px; font-weight: 600; color: var(--text-primary); }
.hpa-sub  { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.hpa-ext  { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }

/* ============================================================
   PAGE — DASHBOARD (authenticated)
   ============================================================ */
.dashboard-body {
  padding: 32px 40px;
  min-height: calc(100vh - 56px - 48px);
  max-width: 1100px;
  margin: 0 auto;
}

/* Welcome banner */
.welcome-banner {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-left: 5px solid #C9A24B;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.welcome-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #C9A24B 0%, #8F6E2E 100%);
  font-size: 18px;
  font-weight: 700;
  color: #12212E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.welcome-name {
  font-size: 15px;
  font-weight: 700;
  color: #1B2A33;
  margin-bottom: 3px;
}
.welcome-sub { font-size: 12px; color: var(--text-secondary); }

/* Section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.section-count {
  background: #EDE7D6;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  color: #8F6E2E;
  font-weight: 600;
}

/* App grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* App card */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;

  /* per-card accent defaults */
  --card-color: var(--gold);
  --card-icon-bg: linear-gradient(135deg, #C9A24B, #8F6E2E);
  --card-icon-fg: #12212E;
}
.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--card-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  text-decoration: none;
  color: inherit;
}
.app-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(201,162,75,.25); }

/* Card as button reset */
button.app-card {
  width: 100%;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: inherit;
}

/* Card color themes — tông "modern luxury":
   vàng đồng #C9A24B · ngọc lục bảo #2E6E5E · navy #2A4F73 · rượu vang #9C3B4A · mận trầm #5E4B79 · cam đất #B5651D */
.app-card.theme-amber      { --card-color: #C9A24B; --card-icon-bg: linear-gradient(135deg, #C9A24B, #8F6E2E); --card-icon-fg: #12212E; }
.app-card.theme-emerald    { --card-color: #2E6E5E; --card-icon-bg: linear-gradient(135deg, #2E6E5E, #1E4C40); --card-icon-fg: #FFFFFF; }
.app-card.theme-cyan       { --card-color: #2A4F73; --card-icon-bg: linear-gradient(135deg, #2A4F73, #1B3A4B); --card-icon-fg: #FFFFFF; }
.app-card.theme-violet     { --card-color: #5E4B79; --card-icon-bg: linear-gradient(135deg, #5E4B79, #453659); --card-icon-fg: #FFFFFF; }
.app-card.theme-rose       { --card-color: #9C3B4A; --card-icon-bg: linear-gradient(135deg, #9C3B4A, #722B36); --card-icon-fg: #FFFFFF; }
.app-card.theme-indigo     { --card-color: #2A4F73; --card-icon-bg: linear-gradient(135deg, #2A4F73, #1B3A4B); --card-icon-fg: #FFFFFF; }
.app-card.theme-teal       { --card-color: #2E6E5E; --card-icon-bg: linear-gradient(135deg, #2E6E5E, #1E4C40); --card-icon-fg: #FFFFFF; }
.app-card.theme-terracotta { --card-color: #B5651D; --card-icon-bg: linear-gradient(135deg, #B5651D, #8A4A15); --card-icon-fg: #FFFFFF; }

/* Legacy theme names — cam → vàng đồng, xanh lá → ngọc lục bảo, xanh dương → navy */
.app-card.theme-dark-amber   { --card-color: #2E6E5E; --card-icon-bg: linear-gradient(135deg, #2E6E5E, #1E4C40); --card-icon-fg: #FFFFFF; }
.app-card.theme-dark-burnt   { --card-color: #2A4F73; --card-icon-bg: linear-gradient(135deg, #2A4F73, #1B3A4B); --card-icon-fg: #FFFFFF; }

/* App icon */
.app-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--card-icon-bg);
  font-size: 16px;
  font-weight: 700;
  color: var(--card-icon-fg, var(--text-inverse));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Card name */
.app-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.35;
  flex: 1;
}

/* Role badge on card */
.app-card-badge {
  display: inline-flex;
  align-items: center;
  background: #F1EEE3;
  border: 1px solid #E4DCC4;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #8F6E2E;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  width: fit-content;
}
.app-card-badge.muted {
  background: #F0EDE4;
  color: var(--text-muted);
  border-color: #E4DFD2;
}

/* No-access card */
.app-card.no-access {
  filter: grayscale(50%);
  opacity: 0.75;
  cursor: not-allowed;
}
.app-card.no-access:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-dark);
}

/* Access denied toast bar */
.access-denied-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--danger-fg);
  box-shadow: var(--shadow-sm);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease, margin-top .25s ease,
              padding .25s ease, border-width .25s ease;
  border-width: 0;
}
.access-denied-bar.show {
  max-height: 60px;
  opacity: 1;
  margin-top: 14px;
  padding: 12px 16px;
  border-width: 1px;
}

/* Empty state */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   ADMIN — SEARCH BAR & PAGINATION
   ============================================================ */

/* Search bar */
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
}
.admin-search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
}
.admin-search-icon {
  position: absolute;
  left: 12px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.admin-search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 38px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}
.admin-search-input:focus {
  border-color: var(--cyan-light);
  box-shadow: 0 0 0 3px rgba(201,162,75,.12);
}
.admin-search-input::placeholder { color: var(--text-muted); }
.admin-search-clear {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 4px;
  transition: var(--transition);
}
.admin-search-clear:hover { color: var(--danger-fg); text-decoration: none; }

/* Result meta line */
.admin-table-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.admin-table-meta strong { color: var(--text-primary); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-dark);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.page-btn:hover {
  border-color: var(--cyan-light);
  color: var(--cyan-dark);
  background: var(--cyan-xlight);
  text-decoration: none;
}
.page-btn.active {
  background: var(--cyan-dark);
  border-color: var(--cyan-dark);
  color: #fff;
  font-weight: 700;
  cursor: default;
}
.page-btn.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 34px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   COMPONENTS — BACKWARD COMPAT (standalone btn classes, .success, details, code)
   ============================================================ */

/* Standalone button classes (admin pages use without .btn parent) */
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary  { background: var(--cyan-dark); color: var(--text-inverse); }
.btn-primary:hover  { background: var(--cyan-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--text-inverse); text-decoration: none; }
.btn-primary.btn-block { width: 100%; height: 46px; font-size: 14px; }

.btn-secondary { background: var(--surface); color: var(--cyan-dark); border: 1.5px solid var(--border-dark); }
.btn-secondary:hover { background: var(--cyan-xlight); border-color: var(--cyan-light); color: var(--cyan-dark); text-decoration: none; }

.btn-danger { background: var(--danger-bg); color: var(--danger-fg); border: 1.5px solid var(--danger-border); height: 32px; font-size: 12px; padding: 0 10px; }
.btn-danger:hover { background: #FEE2E2; color: var(--danger-fg); text-decoration: none; }

/* .success — success alert (admin pages) */
.success {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success-fg);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* details / summary */
details { margin: 16px 0; }
details > summary {
  cursor: pointer;
  padding: 9px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  color: var(--cyan-dark);
  list-style: none;
  user-select: none;
  transition: var(--transition);
}
details > summary::-webkit-details-marker { display: none; }
details > summary:hover { background: var(--cyan-xlight); border-color: var(--cyan-light); }
details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }

/* inline code */
code {
  background: var(--cyan-xlight);
  color: var(--cyan);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

/* Admin page container */
.page-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ============================================================
   PAGE — CHANGE PASSWORD (uses shared card)
   ============================================================ */
.change-pwd-wrap {
  max-width: 480px;
  margin: 32px auto;
}

/* ============================================================
   PAGE — ADMIN TABLES
   ============================================================ */
.admin-page { padding: 24px; }

/* ============================================================
   LAYOUT — FOOTER
   ============================================================ */
.site-footer {
  background: transparent;
  border-top: 1px solid #E6E0D0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #9CA7AC;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
  /* Login: hide left panel, show mobile brand */
  .login-panel-brand { display: none; }
  .login-panel-form  {
    flex: 1; padding: 32px 20px; min-height: 100vh;
    /* Shell đã có gradient, panel chỉ cần padding đứng */
    align-items: flex-start;
    padding-top: 48px;
  }
  .login-mobile-brand { display: flex; }
  .login-form-wrap   { max-width: 100%; border-radius: 16px; padding: 36px 28px; }

  /* Navbar */
  .navbar { padding: 0 16px; }
  .navbar-nav { display: none; }
  .user-menu-id { display: none; }
  .user-menu-trigger { max-width: none; padding: 4px; gap: 0; }
  .user-menu-caret { display: none; }

  /* Dashboard */
  .dashboard-body { padding: 16px; }
  .app-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 480px) {
  .app-grid { grid-template-columns: 1fr; }
  .home-center-card { padding: 32px 24px; }
  .welcome-banner { padding: 14px 16px; gap: 12px; }
}

/* ============================================================
   PAGE — USER EDIT · "Thông tin tài khoản" card (compact)
   ============================================================ */
.info-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  margin-bottom: 16px;
}
.info-card-title i { color: var(--cyan-light); font-size: 19px; }

.info-form { display: flex; flex-direction: column; gap: 14px; }

/* Họ tên + Email cạnh nhau để giảm chiều cao */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-grid .field { margin-bottom: 0; }

/* Hai toggle trên cùng một hàng */
.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: #FDFCF8;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.toggle:hover { border-color: var(--cyan-light); }
.toggle:has(input:checked) { border-color: var(--cyan-light); background: var(--cyan-xlight); }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.toggle-label i { color: var(--text-muted); font-size: 16px; }
.toggle:has(input:checked) .toggle-label i { color: var(--cyan-light); }

/* Toggle switch */
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 42px;
  height: 24px;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #CBD5E1;
  transition: var(--transition);
  pointer-events: none;
}
.switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
  transition: var(--transition);
}
.switch input:checked + .switch-track { background: var(--cyan-light); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(201,162,75,.25); }

.info-actions { display: flex; }

.info-sep { margin: 16px 0 14px; }

.info-secondary { display: flex; flex-direction: column; gap: 12px; }

/* Mật khẩu mới + nút Reset trên cùng một hàng */
.reset-row { display: flex; align-items: flex-end; gap: 10px; }
.reset-row .field { flex: 1 1 auto; margin-bottom: 0; }
.reset-row .btn-secondary { height: 46px; flex: none; }

.unlock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.unlock-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex: 1 1 200px;
}
.btn-sm { height: 32px; font-size: 12.5px; padding: 0 12px; flex: none; }

/* ---- Bố cục 2 cột của trang User Edit ---- */
.useredit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ---- Card phải · "Quyền vào ứng dụng" (đồng bộ với card trái) ---- */
.subsection-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.subsection-title i { color: var(--cyan-light); font-size: 16px; }

.grant-form { display: flex; flex-direction: column; gap: 14px; }
.grant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grant-grid .field { margin-bottom: 0; }
.grant-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.role-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger-fg);
}

/* Bảng grants trong card */
.grants-table { margin-bottom: 2px; }
.grants-table th:last-child,
.grants-table td.ta-right { text-align: right; }
.grants-table td { vertical-align: middle; }
.muted-code { color: var(--text-muted); font-size: 12px; }
.role-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--cyan-xlight);
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* Badge trạng thái (pill có chấm màu) — tên riêng để không đụng .badge gốc */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.status-on  { background: var(--success-bg); color: var(--success-fg); }
.status-on::before  { background: var(--success-fg); }
.status-off { background: #F0EDE4; color: var(--text-muted); }
.status-off::before { background: var(--text-muted); }
.status-lock { background: var(--danger-bg); color: var(--danger-fg); }
.status-lock::before { background: var(--danger-fg); }

/* Empty state khi chưa có quyền */
.empty-grants {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 14px;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-md);
  background: #FDFCF8;
  color: var(--text-muted);
  font-size: 13px;
}
.empty-grants i { font-size: 18px; color: var(--border-dark); }

@media (max-width: 860px) {
  .useredit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .info-grid,
  .toggle-grid,
  .grant-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PAGE — ADMIN · USERS (header, create panel, table)
   ============================================================ */
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.admin-header-titles { display: flex; flex-direction: column; gap: 3px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); }
.admin-header-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  background: var(--cyan-xlight);
  border: 1px solid var(--border-dark);
  white-space: nowrap;
  flex: none;
}
.admin-header-stat .stat-num { font-size: 20px; font-weight: 700; color: var(--cyan-dark); }
.admin-header-stat .stat-lbl { font-size: 12px; color: var(--text-secondary); }

/* Create user panel */
.create-details { margin: 16px 0 4px; }
.create-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
  color: var(--cyan-dark);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: var(--transition);
}
.create-summary::-webkit-details-marker { display: none; }
.create-summary:hover { background: var(--cyan-xlight); border-color: var(--cyan-light); }
.create-summary i { font-size: 16px; transition: transform .2s ease; }
.create-details[open] > .create-summary {
  border-radius: var(--radius-md);
  border-bottom-color: var(--border-dark);
}
.create-details[open] > .create-summary i { transform: rotate(45deg); }
.create-card {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.create-form { display: flex; flex-direction: column; gap: 14px; }
.create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.create-grid .field { margin-bottom: 0; }
.create-toggle { max-width: 320px; }
.field .req { color: var(--danger-fg); font-weight: 700; }

/* Toolbar: search + meta on one row */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  flex-wrap: wrap;
}
.admin-toolbar .admin-search-bar { margin: 0; flex: 1 1 320px; }
.admin-toolbar .admin-table-meta { margin: 0; white-space: nowrap; }

/* Users table */
.users-table td { vertical-align: middle; }
.users-table td.ta-right, .users-table th:last-child { text-align: right; }
.id-cell { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.u-email { color: var(--text-secondary); }

.u-cell { display: flex; align-items: center; gap: 11px; }
.u-avatar {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2A4F73, #1B3A4B);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.u-avatar.is-admin { background: linear-gradient(135deg, #C9A24B, #8F6E2E); color: #12212E; }
.u-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.u-name {
  display: flex; align-items: center; gap: 7px;
  font-weight: 600; color: var(--text-primary); font-size: 13.5px;
}
.u-sub { font-size: 12px; color: var(--text-muted); }
.chip-admin {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase;
  background: #F1EEE3; color: #8F6E2E;
}
.chip-admin i { font-size: 11px; }

.last-login { font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.last-login.never { color: var(--text-muted); font-style: italic; }

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.table-empty i { font-size: 34px; color: var(--border-dark); }

/* ============================================================
   PAGE — ADMIN · APPLICATIONS & AUDIT (dùng lại header/table)
   ============================================================ */
/* Avatar ứng dụng (vuông bo góc, phân biệt với avatar user) */
.app-avatar {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2A4F73, #1B3A4B);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

/* Link Base URL */
.u-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cyan-light);
  font-size: 13px;
  word-break: break-all;
}
.u-link i { font-size: 14px; flex: none; }

/* Hộp hiển thị ClientSecret */
.secret-box { align-items: flex-start; }
.secret-box > i { font-size: 18px; margin-top: 1px; }
.secret-code {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 10px;
  background: #fff;
  border: 1px dashed var(--success-fg);
  color: var(--text-primary);
  font-size: 13px;
  word-break: break-all;
}

/* Bảng Audit */
.audit-table td { vertical-align: middle; }
.mono-cell {
  font-family: 'SF Mono','Cascadia Code','Consolas',monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.audit-details {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

@media (max-width: 700px) {
  .admin-header { flex-direction: column; }
  .create-grid { grid-template-columns: 1fr; }
  .users-table .id-cell,
  .users-table thead th:first-child { display: none; }
}

/* ============================================================
   PAGE — LOGIN (redesign: card căn giữa, brand đưa vào card)
   Khối này đặt cuối file để override layout 2 cột cũ.
   ============================================================ */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #12212E;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  position: relative;
  overflow: hidden;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Modern luxury — vầng vàng đồng dịu góc trên + vầng navy sáng góc dưới. */
  background:
    radial-gradient(900px 620px at 85% -12%, rgba(228,200,128,.14) 0%, rgba(228,200,128,0) 55%),
    radial-gradient(760px 640px at 10% 112%, rgba(42,79,115,.50) 0%, rgba(42,79,115,0) 60%);
  z-index: 0;
}
.login-main {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-form-wrap {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,.30), 0 8px 22px rgba(0,0,0,.16);
  padding: 34px 38px 32px;
  max-width: 420px;
  width: 100%;
}

/* Brand lockup (logo + tên hệ thống) trong card */
.login-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 4px 0 22px;
}
.login-card-logo {
  width: 50px; height: 50px;
  flex: none;
  border-radius: 14px;
  background: var(--cyan-xlight);
  border: 1px solid var(--border-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.login-card-logo img { width: 38px; height: 38px; object-fit: contain; }
.login-card-brandtext { display: flex; flex-direction: column; line-height: 1.25; }
.login-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.login-card-unit { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* Căn giữa tiêu đề + mô tả trong card */
.login-form-title { text-align: center; font-size: 24px; margin-bottom: 6px; }
.login-form-sub   { text-align: center; }

@media (max-width: 480px) {
  .login-form-wrap { padding: 28px 22px 24px; border-radius: 16px; }
}

/* ============================================================
   INDEX — Đồng bộ hình nền với Login (bghome.jpg)
   Đặt cuối file để override .home-body và .dashboard-body cũ.
   ============================================================ */

/* Unauthenticated home: đổi sang bghome.jpg + dark overlay giống Login */
 
.home-body::before {
  content: "";
  position: absolute;
  inset: 0; 
  z-index: 0;
}

/* Authenticated dashboard: nền be kem phẳng, vầng vàng đồng rất nhẹ góc trên phải */
.dashboard-wrap {
  /* navbar 58px + footer 48px — trừ đúng để trang vừa khít viewport, không scroll */
  min-height: calc(100vh - 58px - 48px);
  background: var(--bg);
  position: relative;
}
.dashboard-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1000px 480px at 88% -8%, rgba(201,162,75,.10) 0%, rgba(201,162,75,0) 60%);
  z-index: 0;
}
 
/* Content bên trong nổi lên trên overlay */
.dashboard-body {
  min-height: unset;
  position: relative;
  z-index: 1;
}

/* Section header text — trên nền be kem */
.dashboard-wrap .section-label { color: var(--text-secondary); }
.dashboard-wrap .section-count {
  background: #EDE7D6;
  color: #8F6E2E;
  border-color: transparent;
}

/* ============================================================
   PAGE — ACCESS DENIED (403)
   Layout 2 cột: hero (trái, dark glassmorphism) + panel (phải, white card)
   Đồng bộ visual với login-shell, dùng chung bg.png
   ============================================================ */

/* Full-page shell — mirror .login-shell */
.auth-shell {
  display: flex;
  min-height: 100vh;
  background: #12212E;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 36, 0.58);
  z-index: 0;
}

/* Decorative orbs */
.auth-bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.auth-bubble.b1 {
  width: 580px; height: 580px;
  bottom: -210px; left: -150px;
  background: radial-gradient(circle, rgba(201,162,75,.12) 0%, transparent 68%);
}
.auth-bubble.b2 {
  width: 380px; height: 380px;
  top: -110px; right: 70px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
}
.auth-bubble.b3 {
  width: 230px; height: 230px;
  top: 42%; right: 46%;
  background: radial-gradient(circle, rgba(201,162,75,.10) 0%, transparent 70%);
}

/* LEFT — hero info panel */
.auth-hero {
  flex: 1;
  padding: 60px 60px 60px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* Brand row (logo + tên hệ thống) */
.auth-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 52px;
}
.auth-hero-logo {
  width: 54px; height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
  flex: none;
}
.auth-hero-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .6px;
}
.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.50);
  margin-top: 2px;
}

/* Giant error code */
.auth-hero-title {
  font-size: 130px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  margin: 0 0 10px !important;
  letter-spacing: -6px;
  background: linear-gradient(140deg, #ffffff 25%, rgba(201,162,75,.80) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #fff !important;
}

.auth-hero-subtitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan-light);
  letter-spacing: 3px;
  margin-bottom: 22px;
  text-transform: uppercase;
}

.auth-hero-tagline {
  font-size: 14px;
  color: rgba(255,255,255,.58);
  line-height: 1.80;
  max-width: 400px;
  margin: 0;
}

/* RIGHT — white card panel */
.auth-panel {
  flex: 0 0 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px 48px 20px;
  position: relative;
  z-index: 1;
}

.auth-form-wrap {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 8px 22px rgba(0,0,0,.14);
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 360px;
}

/* Error icon badge (SVG inline via background-image) */
.auth-form-wrap::before {
  content: "";
  display: block;
  width: 62px; height: 62px;
  margin: 0 auto 22px;
  border-radius: 16px;
  background-color: var(--danger-bg);
  border: 2px solid var(--danger-border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23DC2626' d='M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2zm0 18a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 34px;
  background-position: center;
}

/* Heading "Không có quyền" */
.auth-form-wrap h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--danger-fg) !important;
  margin: 0 0 10px !important;
  text-align: center;
}

.auth-form-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 28px;
  text-align: center;
}
.auth-form-subtitle b { color: var(--text-primary); }

/* Button "Về trang chủ" */
.auth-form-wrap a.btn-primary {
  display: flex !important;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  letter-spacing: .2px;
  transition: background .18s ease, transform .15s ease, box-shadow .15s ease;
}
.auth-form-wrap a.btn-primary:hover {
  background: var(--cyan-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: #fff;
}

/* Responsive — tablet */
@media (max-width: 900px) {
  .auth-hero { padding: 48px 36px 48px 40px; }
  .auth-hero-title { font-size: 100px !important; letter-spacing: -4px; }
  .auth-panel { flex: 0 0 380px; padding: 40px 32px 40px 16px; }
}

/* Responsive — mobile */
@media (max-width: 640px) {
  .auth-shell { flex-direction: column; }
  .auth-hero {
    flex: 0 0 auto;
    padding: 32px 24px 20px;
  }
  .auth-hero-top { margin-bottom: 28px; }
  .auth-hero-title { font-size: 80px !important; letter-spacing: -3px; }
  .auth-hero-subtitle { font-size: 12px; letter-spacing: 2px; margin-bottom: 12px; }
  .auth-hero-tagline { font-size: 13px; }
  .auth-panel {
    flex: 1;
    padding: 16px 20px 40px;
    align-items: flex-start;
    padding-top: 24px;
  }
  .auth-form-wrap { max-width: 100%; padding: 28px 24px 24px; }
}

/* ============================================================
   LOGIN — CHOOSER (2 thẻ chọn ứng dụng, bước đầu tiên)
   ============================================================ */
.lc-chooser {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  width: 460px;
  max-width: 100%;
  padding: 32px 32px 26px;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(4,30,40,.28),
    0 6px 18px rgba(4,30,40,.10);
  animation: portalRise .6s cubic-bezier(.16,.84,.44,1) both;
}

/* ============================================================
   PA3 — CHOOSER CARD (Lam thương hiệu)
   Header lockup + 2 mục truy cập (1 chính cyan / 1 phụ ghost)
   ============================================================ */
.lc-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lc-seal {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cyan-xlight);
  border: 1.5px solid rgba(201,162,75,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lc-seal img { width: 40px; height: 40px; object-fit: contain; }
.lc-head-text { display: flex; flex-direction: column; line-height: 1.25; }
.lc-head-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.25;
}
.lc-head-unit {
  font-size: 12.5px;
  font-weight: 600;
  color: #8F6E2E;
  margin-top: 4px;
}

.lc-rule {
  height: 1px;
  background: rgba(12,26,46,.1);
  margin: 22px 0;
}

.lc-overline {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* Mục truy cập — hàng dùng chung */
.lc-access {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 14px;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.lc-access:focus-visible {
  outline: 3px solid var(--cyan-light);
  outline-offset: 3px;
}
.lc-access-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
}
.lc-access-body { flex: 1; min-width: 0; }
.lc-access-name { display: block; font-size: 15.5px; font-weight: 700; }
.lc-access-desc { display: block; font-size: 12.5px; margin-top: 3px; }
.lc-access-arrow { flex-shrink: 0; }

/* Mục chính — SSO (navy sang trọng, viền vàng đồng mờ) */
.lc-access-primary {
  background: linear-gradient(135deg, #1B3A4B 0%, #0D1B24 100%);
  box-shadow: 0 10px 26px rgba(13,27,36,.28);
  margin-bottom: 12px;
}
.lc-access-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(13,27,36,.36);
}
.lc-access-primary .lc-access-icon {
  background: rgba(228,200,128,.14);
  border: 1px solid rgba(228,200,128,.35);
  color: #E4C880;
}
.lc-access-primary .lc-access-name { color: #F4EFE3; }
.lc-access-primary .lc-access-desc { color: rgba(244,239,227,.72); }
.lc-access-primary .lc-access-arrow { color: #E4C880; font-size: 19px; }

/* Mục phụ — Kỷ yếu (ghost be kem) */
.lc-access-ghost {
  background: #F6F1E4;
}
.lc-access-ghost:hover {
  transform: translateY(-2px);
  background: #F1EAD8;
  box-shadow: 0 10px 24px rgba(143,110,46,.12);
}
.lc-access-ghost .lc-access-icon {
  background: #F1EAD8;
  border: 1px solid rgba(201,162,75,.28);
  color: #8F6E2E;
}
.lc-access-ghost .lc-access-name { color: var(--text-primary); }
.lc-access-ghost .lc-access-desc { color: #6B7B85; }
.lc-access-ghost .lc-access-arrow { color: var(--gold); font-size: 18px; }

/* Hỗ trợ */
.lc-support {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(12,26,46,.1);
  font-size: 12.5px;
  color: #5B6B72;
}
.lc-support a {
  color: var(--cyan);
  font-weight: 600;
}
/* Bỏ gạch chân mọi link trong thẻ (đè rule a:hover toàn cục) */
.lc-chooser a,
.lc-chooser a:hover,
.lc-chooser a:focus { text-decoration: none; }

/* Animations chooser ↔ form */
.lc-out {
  animation: lcOut 0.22s ease forwards;
}
.lc-in {
  animation: lcIn 0.34s ease forwards;
}
.lf-in {
  animation: lfIn 0.32s ease forwards;
}
.lf-out {
  animation: lfOut 0.20s ease forwards;
}

@keyframes lcOut {
  to { opacity: 0; transform: scale(.95) translateY(-12px); }
}
@keyframes lcIn {
  from { opacity: 0; transform: scale(.95) translateY(-12px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
@keyframes lfIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lfOut {
  to { opacity: 0; transform: translateY(14px); }
}

/* Panel cổng dịch vụ xuất hiện mượt khi tải trang */
@keyframes portalRise {
  from { opacity: 0; transform: translateY(22px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Đổi nút back trong form thành button (từ <a>) */
button.login-back-link {
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}

/* Responsive — mobile */
@media (max-width: 560px) {
  .lc-chooser { width: 100%; padding: 26px 20px 22px; border-radius: 14px; }
  .lc-head-name { font-size: 14px; }
  .lc-access { padding: 16px 16px; gap: 13px; }
  .lc-access-icon { width: 42px; height: 42px; font-size: 21px; }
}

/* ============================================================
   LOGIN — THEME VARIANTS (2 diện mạo + nút chuyển)
   data-theme đặt trên .login-shell (#login-shell)
   sage = Đồng Nội (Sage & Earth) | sky = Thiên Thanh (Sky Blue)
   ============================================================ */

/* Bộ chọn giao diện — pill cố định góc trên phải */
.theme-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 40;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(13,20,38,.5);
  border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,.30);
}
.theme-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.8);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}
.theme-opt:hover { color: #fff; background: rgba(255,255,255,.1); }
.theme-opt.is-active { background: #fff; color: #0B1020; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.theme-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.td-sage { background: linear-gradient(135deg,#C9B59C,#8A7758); }
.td-sky  { background: linear-gradient(135deg,#4D869C,#7AB2B2); }

@media (max-width: 600px) {
  .theme-switch { top: 10px; right: 10px; left: 10px; justify-content: center; flex-wrap: wrap; }
  .theme-opt { padding: 6px 10px; font-size: 12px; }
}

/* ---------- THEME "sage" · SAND (Warm Beige / Greige neutral) ----------
   Palette: #C9B59C cát (màu chính) · #D9CFC7 taupe · #EFE9E3 kem · #F9F8F6 trắng ngà
   Cặp thẻ tương phản: SSO mocha chữ trắng / Kỷ yếu nền cát nhạt chữ nâu.
   ---------------------------------------------------------------- */
.login-shell[data-theme="sage"] { background: #292319; }
.login-shell[data-theme="sage"]::before {
  background:
    radial-gradient(1000px 520px at 88% -8%, rgba(201,181,156,.26) 0%, rgba(201,181,156,0) 60%),
    radial-gradient(900px 560px at 2% 112%, rgba(138,119,88,.34) 0%, rgba(138,119,88,0) 62%),
    linear-gradient(135deg, rgba(41,35,25,.9) 0%, rgba(107,90,64,.74) 55%, rgba(138,119,88,.62) 100%);
}
.login-shell[data-theme="sage"] .lc-chooser {
  background: linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(249,248,246,.92) 100%);
  border: 1px solid rgba(201,181,156,.5);
  box-shadow: 0 32px 80px rgba(90,75,55,.2), 0 10px 24px rgba(90,75,55,.12), inset 0 1px 0 rgba(255,255,255,.85);
}
.login-shell[data-theme="sage"] .lc-logo {
  background: linear-gradient(155deg,#FFFFFF,#EFE9E3);
  border: 1px solid rgba(201,181,156,.55);
  box-shadow: 0 8px 20px rgba(138,119,88,.2), inset 0 1px 0 rgba(255,255,255,.9);
}
.login-shell[data-theme="sage"] .lc-brand-name { color: #4A3F2E; }
.login-shell[data-theme="sage"] .lc-brand-unit { color: #8A7758; }
.login-shell[data-theme="sage"] .lc-header-hint {
  background: rgba(201,181,156,.2); border-color: rgba(201,181,156,.42); color: #6B5A40;
}
.login-shell[data-theme="sage"] .lac-sso {
  background: linear-gradient(155deg, #A8946F 0%, #8A7758 45%, #6B5A40 100%);
  box-shadow: 0 18px 40px rgba(107,90,64,.32), 0 4px 12px rgba(74,63,46,.22);
}
.login-shell[data-theme="sage"] .lac-kyy {
  background: linear-gradient(155deg, #E8E1D9 0%, #D9CFC7 50%, #C4B6A8 100%);
  box-shadow: 0 18px 40px rgba(150,130,108,.3), 0 4px 12px rgba(120,103,82,.2);
}
.login-shell[data-theme="sage"] .lac-kyy .lac-name { color: #4A3F2E; }
.login-shell[data-theme="sage"] .lac-kyy .lac-desc { color: #5A4D3A; }
.login-shell[data-theme="sage"] .lac-kyy .lac-icon {
  background: rgba(138,119,88,.16); border-color: rgba(138,119,88,.34); color: #6B5A40;
}
.login-shell[data-theme="sage"] .lac-sso .lac-cta { color: #6B5A40; }
.login-shell[data-theme="sage"] .lac-kyy .lac-cta {
  background: #8A7758; color: #FFFFFF; box-shadow: 0 6px 16px rgba(138,119,88,.4);
}

/* ---------- THEME "sky" · LAGOON (Teal / Aqua) ----------
   Palette: #4D869C teal đậm (màu chính) · #7AB2B2 teal · #CDE8E5 aqua nhạt · #EEF7FF trắng xanh
   Cặp thẻ tương phản: SSO teal chữ trắng / Kỷ yếu nền aqua chữ teal.
   ----------------------------------------------------------- */
.login-shell[data-theme="sky"] { background: #1E3A44; }
.login-shell[data-theme="sky"]::before {
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(122,178,178,.28) 0%, rgba(122,178,178,0) 60%),
    radial-gradient(900px 560px at 2% 112%, rgba(77,134,156,.30) 0%, rgba(77,134,156,0) 62%),
    linear-gradient(135deg, rgba(30,58,68,.88) 0%, rgba(63,113,134,.72) 55%, rgba(77,134,156,.64) 100%);
}
.login-shell[data-theme="sky"] .lc-chooser {
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(238,247,255,.9) 100%);
  border: 1px solid rgba(77,134,156,.32);
  box-shadow: 0 32px 80px rgba(40,80,95,.22), 0 10px 24px rgba(40,80,95,.12), inset 0 1px 0 rgba(255,255,255,.9);
}
.login-shell[data-theme="sky"] .lc-logo {
  background: linear-gradient(155deg,#FFFFFF,#CDE8E5);
  border: 1px solid rgba(77,134,156,.32);
  box-shadow: 0 8px 20px rgba(77,134,156,.22), inset 0 1px 0 rgba(255,255,255,.9);
}
.login-shell[data-theme="sky"] .lc-brand-name { color: #2E5263; }
.login-shell[data-theme="sky"] .lc-brand-unit { color: #4D869C; }
.login-shell[data-theme="sky"] .lc-header-hint {
  background: rgba(77,134,156,.12); border-color: rgba(77,134,156,.3); color: #3A6678;
}
.login-shell[data-theme="sky"] .lac-sso {
  background: linear-gradient(155deg, #589AA6 0%, #4D869C 45%, #356076 100%);
  box-shadow: 0 18px 42px rgba(45,85,100,.4), 0 4px 12px rgba(40,75,90,.24);
}
.login-shell[data-theme="sky"] .lac-kyy {
  background: linear-gradient(155deg, #DCF0EE 0%, #CDE8E5 50%, #ACD6D2 100%);
  box-shadow: 0 18px 42px rgba(90,150,150,.32), 0 4px 12px rgba(77,134,156,.2);
}
.login-shell[data-theme="sky"] .lac-kyy .lac-name { color: #2E5263; }
.login-shell[data-theme="sky"] .lac-kyy .lac-desc { color: #3A6678; }
.login-shell[data-theme="sky"] .lac-kyy .lac-icon {
  background: rgba(77,134,156,.14); border-color: rgba(77,134,156,.32); color: #3A6E82;
}
.login-shell[data-theme="sky"] .lac-sso .lac-cta { color: #356076; }
.login-shell[data-theme="sky"] .lac-kyy .lac-cta {
  background: #4D869C; color: #FFFFFF; box-shadow: 0 6px 16px rgba(77,134,156,.4);
}

/* ============================================================
   THEME — ĐỒNG BỘ SAU ĐĂNG NHẬP (navbar, dashboard, nút, avatar…)
   data-theme đặt trên <html> (set sớm trong <head> _Layout từ localStorage).
   Đè token --cyan* để màu lan toàn site + đè các bề mặt hardcode.
   Dashboard giữ nền tối (thẻ trắng + chữ trắng đọc tốt), chỉ đổi tông màu.
   ============================================================ */

/* ---------- SAGE → SAND: cát/mocha là tông chính, nền sau đăng nhập nâu trầm ---------- */
html[data-theme="sage"] {
  --cyan-dark:   #6B5A40;
  --cyan-mid:    #7C6A4C;
  --cyan:        #8A7758;
  --cyan-light:  #A8946F;
  --cyan-xlight: #F0EAE2;
}
html[data-theme="sage"] .navbar {
  background: linear-gradient(100deg, #4A3F2E 0%, #6B5A40 52%, #8A7758 100%);
  box-shadow: 0 2px 14px rgba(58,48,34,.32), inset 0 -1px 0 rgba(255,255,255,.12);
}
html[data-theme="sage"] .navbar-nav .nav-link.active::after { background: #EFE9E3; }
html[data-theme="sage"] .user-menu-avatar,
html[data-theme="sage"] .user-dropdown-avatar {
  background: linear-gradient(135deg, #A8946F 0%, #6B5A40 100%);
}
html[data-theme="sage"] .dashboard-wrap { background: #F9F8F6; }
html[data-theme="sage"] .dashboard-wrap::before {
  background:
    radial-gradient(1000px 580px at 85% -10%, rgba(201,181,156,.42) 0%, rgba(201,181,156,0) 58%),
    radial-gradient(950px 620px at 0% 112%, rgba(217,207,199,.55) 0%, rgba(217,207,199,0) 60%),
    linear-gradient(160deg, #F9F8F6 0%, #EFE9E3 100%);
}

/* ---------- SKY → nhận diện "modern luxury" navy & vàng đồng (data-theme="sky" vẫn gắn trên <html>) ---------- */
html[data-theme="sky"] {
  --cyan-dark:   #1B3A4B;
  --cyan-mid:    #24465A;
  --cyan:        #2A4F73;
  --cyan-light:  #C9A24B;
  --cyan-xlight: #F6F1E4;
}
html[data-theme="sky"] .navbar {
  background:
    linear-gradient(90deg, #C9A24B 0%, #E4C880 50%, #C9A24B 100%) top / 100% 4px no-repeat,
    #12212E;
  box-shadow: 0 2px 14px rgba(13,27,36,.35), inset 0 -1px 0 rgba(255,255,255,.06);
}
html[data-theme="sky"] .navbar-nav .nav-link.active::after { background: linear-gradient(90deg, #C9A24B, #E4C880); }
html[data-theme="sky"] .user-menu-avatar,
html[data-theme="sky"] .user-dropdown-avatar {
  background: linear-gradient(135deg, #C9A24B 0%, #8F6E2E 100%);
}
html[data-theme="sky"] .dashboard-wrap { background: var(--bg); }
html[data-theme="sky"] .dashboard-wrap::before {
  background: radial-gradient(1000px 480px at 88% -8%, rgba(201,162,75,.10) 0%, rgba(201,162,75,0) 60%);
}

/* ============================================================
   THẺ LOGIN — THIẾT KẾ PHẲNG (bỏ hiệu nổi khối: bóng đổ + nhấc hover)
   Đặt sau các khối theme; cùng độ đặc hiệu nên thắng theo thứ tự nguồn.
   Thay bóng bằng viền mảnh để 2 thẻ vẫn tách nền mà không bị "nổi".
   ============================================================ */
.login-shell[data-theme] .lac-sso,
.login-shell[data-theme] .lac-kyy,
.login-shell[data-theme] .lac-kyy .lac-cta { box-shadow: none; }
.lac { border: 1px solid rgba(0,0,0,.08); }
.lac:hover { transform: none; }
.lac-icon { box-shadow: none; }
.lac-cta { box-shadow: none; }
.lac:hover .lac-cta { transform: none; box-shadow: none; }

/* ============================================================
   LOGIN — BUTTON LOADING STATE
   ============================================================ */
.btn-loading {
  pointer-events: none;
  opacity: .85;
}
.login-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.40);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin-btn 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 2px;
}
@keyframes spin-btn {
  to { transform: rotate(360deg); }
}

/* ============================================================
   USERS TABLE — HỌ TÊN COLUMN
   ============================================================ */
.u-fullname {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

