:root {
  --bam-navy: #0060A9;
  --bam-teal: #009D3E;
  --bam-gold: #FDB813;
  --admin-sidebar-w: 250px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
}
html { -webkit-text-size-adjust: 100%; }
body { background: #f4f7fb; color: #334155; font-family: var(--font); }
.admin-app { min-height: 100vh; display: flex; flex-direction: column; }
.admin-top-header {
  background: linear-gradient(to bottom, #fff, #f0f7fc);
  border-bottom: 1px solid #c5d8f0;
  box-shadow: 0 3px 0 0 rgba(13,148,136,.35);
  padding-top: .75rem; padding-bottom: .75rem;
}
.admin-brand-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.admin-brand-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.admin-brand-line {
  font-family: var(--font);
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.admin-brand-line .c-blue { color: #0060A9; }
.admin-brand-line .c-green { color: #009D3E; }
.admin-brand-slogan {
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  color: #0060A9;
}
.login-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.login-brand-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.login-brand-text { display: flex; flex-direction: column; gap: 4px; }
.login-brand-line {
  font-family: var(--font);
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.login-brand-line .c-blue { color: #0060A9; }
.login-brand-line .c-green { color: #009D3E; }
.login-brand-slogan {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0060A9;
}
.admin-dev-footer .admin-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}
.admin-dev-footer .admin-footer-box {
  background: #fff;
  border: 1px solid #e2eaf5;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(11,61,145,.05);
}
.admin-dev-footer .box-label {
  margin: 0;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.admin-dev-footer .box-title { margin: 0; font-size: .9rem; font-weight: 800; color: #0b3d91; }
.admin-dev-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none !important;
  color: #0b3d91;
}
.admin-dev-logo, .login-dev .dev-logo {
  height: 48px;
  width: auto;
  max-width: min(280px, 90%);
  object-fit: contain;
}
.admin-dev-name, .login-dev .dev-name { font-size: .78rem; font-weight: 800; }
.login-dev .dev-label {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}
@media (max-width: 991.98px) {
  .admin-brand-logo { height: 52px; }
  .admin-brand-line { font-size: .92rem; }
}
@media (max-width: 640px) {
  .admin-dev-footer .admin-footer-grid { grid-template-columns: 1fr; }
  .admin-brand-slogan { display: none; }
}
.admin-layout-row { display: flex; flex: 1; min-height: 0; }
.sidebar {
  flex: 0 0 var(--admin-sidebar-w);
  background: linear-gradient(172deg, #f4f8fc, #e2edf8);
  border-right: 1px solid #d5e3f7;
  padding: 1rem .5rem;
}
.sidebar .nav-link { color: #1347a0; font-weight: 600; border-radius: 10px; padding: .55rem .85rem; }
.sidebar .nav-link:hover { background: rgba(13,148,136,.12); color: var(--bam-navy); }
.sidebar .nav-link.active { background: rgba(11,61,145,.14); color: var(--bam-navy); }
.admin-main { flex: 1; min-width: 0; padding: 1rem 1.25rem 5rem; }
.admin-dev-footer { color: #64748b; font-size: .85rem; border-top: 1px solid #e2eaf5; padding-top: 1rem; }
.kpi { background: #fff; border: 1px solid #e2eaf5; border-radius: 14px; padding: 1rem 1.15rem; box-shadow: 0 4px 12px rgba(11,61,145,.05); }
.kpi .num { font-size: 1.6rem; font-weight: 800; color: var(--bam-navy); }
.kpi.danger .num { color: #b91c1c; }
.table-bam { background: #fff; border-radius: 12px; overflow: hidden; }
.table-bam th { background: #0B3D91; color: #fff; font-weight: 600; white-space: nowrap; }
.badge-sla { font-weight: 700; }
.admin-mobile-menu-btn { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid #c5d8f0; background: #fff; color: var(--bam-navy); }
.admin-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; border: 0; }
.admin-sidebar-backdrop.is-on { display: block; }
.admin-bottom-nav { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.35rem; font-weight: 800; color: var(--bam-navy); margin: 0; }
.page-kicker { margin: 0 0 .25rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bam-teal); }
.bam-form-card { background: #fff; border: 1px solid #e2eaf5; border-radius: 16px; padding: 1rem 1.1rem; box-shadow: 0 6px 16px rgba(11,61,145,.05); }
.bam-publish {
  background: #fff;
  border: 1px solid #c5d8f0;
  border-radius: 16px;
  padding: 1rem 1.15rem;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(11,61,145,.06);
}
.bam-schedule-on { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: .75rem 1rem; }
.badge-tt { display: inline-block; font-size: .75rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px; }
.badge-tt-Nhap { background: #e2e8f0; color: #475569; }
.badge-tt-HenGio { background: #fef3c7; color: #92400e; }
.badge-tt-DaCongKhai { background: #dcfce7; color: #166534; }
.badge-tt-ThuHoi { background: #fee2e2; color: #991b1b; }
.pub-ticks { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pub-ticks span { font-size: .68rem; font-weight: 800; padding: .12rem .4rem; border-radius: 999px; background: #e2e8f0; color: #64748b; }
.pub-ticks span.on { background: #dcfce7; color: #166534; }
.kpi-link:hover { box-shadow: 0 10px 24px rgba(11,61,145,.12); transform: translateY(-2px); }
.kpi { transition: transform .15s ease, box-shadow .15s ease; }
.xdsoft_datetimepicker { z-index: 10050 !important; box-shadow: 0 12px 32px rgba(15,23,42,.18); border-radius: 12px; border: 1px solid #e2e8f0; }
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time.xdsoft_current { background: #0B3D91 !important; box-shadow: none !important; }
.login-wrap { min-height: 100vh; display: grid; justify-items: center; align-content: start; padding: 10vh 12px 24px;
  background: radial-gradient(900px 500px at 10% 10%, rgba(11,61,145,.1), transparent 60%), linear-gradient(180deg, #f8fbff, #eef6f5); }
.login-card { width: min(920px, 100%); border-radius: 20px; background: rgba(255,255,255,.94); border: 1px solid rgba(11,61,145,.14); box-shadow: 0 20px 60px rgba(15,23,42,.12); overflow: hidden; }
.btn-login { background: var(--bam-navy) !important; border-color: var(--bam-navy) !important; font-weight: 800; border-radius: 14px; padding: .7rem 1rem; }
@media (max-width: 991.98px) {
  .admin-mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar { position: fixed; z-index: 1040; top: 0; bottom: 0; left: 0; transform: translateX(-105%); transition: transform .25s ease; }
  .sidebar.is-mobile-open { transform: none; }
  .admin-bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff;
    border-top: 1px solid #d5e3f7; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .admin-bottom-nav a, .admin-bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 0; background: transparent;
    color: #5b6b7c; font-size: .68rem; font-weight: 700; text-decoration: none; min-height: 52px;
  }
  .admin-bottom-nav a.active, .admin-bottom-nav a.is-primary { color: var(--bam-navy); }
}

.pub-combo { position: relative; }
.pub-combo-native {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.pub-combo-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80;
  margin: 0; padding: 6px 0; list-style: none; max-height: 260px; overflow: auto;
  background: #fff; border: 1px solid #dbeafe; border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15,23,42,.14);
}
.pub-combo.is-open .pub-combo-list { display: block; }
.pub-combo-list li { padding: .45rem .75rem; cursor: pointer; font-size: .92rem; color: #1e293b; }
.pub-combo-list li:hover, .pub-combo-list li.is-active { background: #eff6ff; color: #0060A9; }
.pub-combo-list li.is-selected { font-weight: 700; color: #0060A9; }
.pub-combo-list .pub-combo-empty { color: #64748b; cursor: default; font-style: italic; }

.bam-rowform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: .45rem;
}
.bam-rowform .bam-grow { flex: 1 1 160px; min-width: 0; }
.bam-rowform .pub-combo { flex: 1 1 180px; min-width: 140px; }
.bam-rowform .bam-w-kl { flex: 0 0 86px; width: 86px; }
.bam-rowform .bam-w-nhom { flex: 0 0 96px; width: 96px; }
.bam-rowform .bam-w-sohd { flex: 0 0 118px; width: 118px; }
.bam-rowform .bam-w-date { flex: 0 0 146px; width: 146px; }
.bam-rowform .bam-w-note { flex: 1 1 140px; max-width: 240px; min-width: 120px; }
.bam-rowform .bam-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.bam-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #c5d8f0;
  background: #f8fbff;
  flex: 0 0 72px;
  display: none;
  align-items: center;
  justify-content: center;
}
.bam-preview.is-on { display: flex; }
.bam-preview img { width: 100%; height: 100%; object-fit: cover; }
.bam-preview-file { font-size: .68rem; text-align: center; padding: 4px; color: #0B3D91; word-break: break-all; line-height: 1.2; }
.bam-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2eaf5;
  display: block;
}
.bam-hd-item, .bam-nl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .4rem 0;
  border-bottom: 1px solid #eef2f7;
}
.bam-hd-item:last-child, .bam-nl-item:last-child { border-bottom: 0; }
