:root {
  --brand: #2563eb;         /* Professional Ocean/Royal Blue */
  --brand-dark: #1d4ed8;    /* Darker Ocean/Royal Blue for hover */
  --brand-light: #eff6ff;   /* Soft blue accent background */
  --ink: #000000;           /* Absolute black text for primary readability */
  --ink-muted: #374151;     /* Dark gray for descriptions / secondary labels */
  --muted: #6b7280;         /* Gray for placeholders/small notes */
  --line: #e5e7eb;          /* Clean line/border gray */
  --soft: #f9fafb;          /* Soft background grey */
  --panel: #ffffff;         /* Card background */
  --ok: #059669;            /* Success Green */
  --danger: #dc2626;        /* Danger Red */
  --warn: #d97706;          /* Warning Yellow */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
  box-sizing: border-box; 
}

html { 
  -webkit-text-size-adjust: 100%; 
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 500;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--ink);
  line-height: 25px;
  min-height: 100vh;
}

body.mo-menu { 
  overflow: hidden; 
}

a { 
  color: var(--brand); 
  text-decoration: none;
  transition: var(--transition);
}

a:hover { 
  color: var(--brand-dark);
  text-decoration: underline; 
}

img { 
  max-width: 100%; 
  height: auto; 
}

/* Header style improvements */
.thanh-tren {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.dieu-huong {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.thuong-hieu {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.thuong-hieu:hover {
  text-decoration: none;
  color: var(--brand);
}

.menu {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.dang-xuat { 
  font-weight: 600; 
  color: var(--ink-muted);
}
.dang-xuat:hover {
  color: var(--danger);
  text-decoration: none;
}

/* Layout structural spacing */
.khung {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.bo-cuc {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* Sidebar navigation improvements */
.canh-ben {
  position: sticky;
  top: 90px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.canh-ben a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.canh-ben a:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
  text-decoration: none;
}

.canh-ben a.dang-chon {
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.menu-mobile-head,
.nen-menu,
.nut-menu { 
  display: none; 
}

/* Grid layout enhancements */
.luoi { 
  display: grid; 
  gap: 20px; 
}
.hai-cot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ba-cot { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Card components styling */
.the {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.the:hover {
  box-shadow: var(--shadow-hover);
}

.tieu-de {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

/* Headers typography */
h1, h2, h3, h4 { 
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  margin-top: 0; 
  line-height: 1.3; 
  font-weight: 700;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 16px; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; margin-bottom: 14px; letter-spacing: -0.3px; }
h3 { font-size: 1.15rem; margin-bottom: 10px; }

/* Hero section animations & polish */
.anh-hung {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 40px;
  align-items: center;
  padding: 24px 0 48px;
}

.anh-hung h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.2;
  margin-bottom: 20px;
}

.anh-hung p { 
  color: var(--ink-muted); 
  font-size: 1.1rem; 
  line-height: 1.6;
  margin-bottom: 28px;
}

.so-lieu {
  color: var(--brand);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

/* Professional blue button styling with white text */
.nut, button, input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  background: var(--brand);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
  transition: var(--transition);
}

.nut:hover, button:hover, input[type=submit]:hover {
  background: var(--brand-dark);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.nut:active, button:active { 
  transform: translateY(1px); 
}

.nut.phu, button.phu { 
  background: #1f2937; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.nut.phu:hover, button.phu:hover {
  background: #111827;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nut.vien, button.vien { 
  background: #ffffff; 
  color: var(--ink-muted); 
  border: 1px solid var(--line); 
  box-shadow: none;
}
.nut.vien:hover, button.vien:hover {
  background: var(--soft);
  color: var(--ink);
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nut.do, button.do { 
  background: var(--danger); 
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}
.nut.do:hover, button.do:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.nho-gon { 
  min-height: 36px; 
  padding: 8px 14px; 
  font-size: 14px;
}

/* Professional Form fields styling */
form.xep { 
  display: grid; 
  gap: 16px; 
}

.dong {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea { 
  min-height: 132px; 
  resize: vertical; 
}
.wordpress-editor { 
  min-height: 430px; 
}
.tox-tinymce {
  border-radius: 8px !important;
  border-color: var(--line) !important;
}

/* Highly Professional Tables design */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--line);
}

tr:last-child td { 
  border-bottom: 0; 
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: var(--soft);
}

.hanh-dong {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nho { 
  color: var(--muted); 
  font-size: 13.5px; 
}

.nho-gon-tieu-de { 
  margin-bottom: 12px; 
}

/* Image library cards */
.thu-vien-picker {
  background: var(--soft);
}
.bo-loc-anh-soan {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .8fr) minmax(140px, .8fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.bo-loc-anh-soan button {
  min-height: 45px;
}
.luoi-anh-chon {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 14px;
  max-height: 450px;
  overflow: auto;
  padding: 4px;
}
.anh-chon-card,
.anh-card {
  min-width: 0;
  transition: var(--transition);
}

.anh-chon-card:hover,
.anh-card:hover {
  transform: translateY(-2px);
}

.anh-chon-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.anh-chon-card.dang-chon {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.anh-chon-card img,
.anh-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f1f5f9;
}
.anh-chon-card strong,
.anh-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.anh-chon-actions {
  display: grid;
  gap: 6px;
}
.anh-chon-actions button {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}
.anh-chon-actions label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.anh-chon-actions input {
  width: auto;
}
.luoi-anh-thu-vien {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  align-items: start;
}
.ngay-nhom-anh {
  grid-column: 1 / -1;
  margin: 12px 0 4px;
  padding: 8px 0;
  font-weight: 700;
  border-bottom: 1.5px solid var(--line);
}
.anh-card {
  display: grid;
  gap: 10px;
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.anh-card form,
.anh-card button {
  width: 100%;
}
.link-anh-day-du {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.khung-xem-truoc {
  min-width: min(620px, 76vw);
  max-width: 760px;
  max-height: 420px;
  overflow: auto;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  white-space: normal;
}
.khung-xem-truoc h3 {
  margin-bottom: 8px;
}
.noi-dung-xem-truoc {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bang-wp-rest {
  margin-top: 10px;
}
.wp-rest-list-title {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.wp-rest-list-title img {
  width: 64px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.wp-rest-list-title strong {
  display: inline-block;
  max-width: 100%;
}
.popup-xem-truoc {
  width: min(920px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
}
.popup-xem-truoc::backdrop {
  background: rgba(15, 23, 42, .56);
}
.popup-head,
.popup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.popup-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}
.popup-body {
  padding: 18px;
  max-height: calc(86vh - 132px);
  overflow: auto;
}
.popup-anh-dai-dien {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 8px 0 14px;
}
.popup-noi-dung {
  line-height: 25px;
}
.popup-noi-dung img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
}
.progress-overlay.dang-hien {
  display: grid;
}
.progress-box {
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.progress-title {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 8px;
}
.progress-percent {
  color: var(--brand);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 14px;
}
.progress-bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #22c55e);
  transition: width .35s ease;
}
.progress-meta {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 14px;
}
.progress-note {
  color: var(--muted);
}
button.dang-xu-ly,
a.dang-xu-ly {
  opacity: .72;
  cursor: wait;
}

/* Modern Status badges */
.huy-hieu {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #f3f4f6;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: capitalize;
}
.huy-hieu.ok { background: #d1fae5; color: var(--ok); }
.huy-hieu.loi { background: #fee2e2; color: var(--danger); }
.huy-hieu.cho { background: #fef3c7; color: var(--warn); }

/* Notifications / Alerts */
.thong-bao {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.thong-bao.ok { background: #ecfdf5; border-color: #a7f3d0; color: var(--ok); }
.thong-bao.loi { background: #fef2f2; border-color: #fca5a5; color: var(--danger); }

/* Professional Login Page Styling */
.the[style*="max-width:460px"] {
  max-width: 440px !important;
  margin: 80px auto !important;
  padding: 40px !important;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
}
.the[style*="max-width:460px"] h1 {
  text-align: center;
  font-size: 26px;
  margin-bottom: 30px;
  font-weight: 800;
}
.the[style*="max-width:460px"] button {
  width: 100%;
  margin-top: 10px;
  font-size: 16px;
  min-height: 46px;
}
.the[style*="max-width:460px"] .nho {
  text-align: center;
  margin-top: 20px;
  display: block;
}

/* Footer style */
.chan-trang {
  color: var(--muted);
  text-align: center;
  padding: 48px 20px;
  font-size: 13.5px;
}

/* Scroll Reveal Animations (used by app.js) */
.reveal-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Media Responsive Rules */
@media (max-width: 980px) {
  .dieu-huong { 
    grid-template-columns: auto auto 1fr; 
  }
  .nut-menu {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
  }
  .nut-menu span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px 0;
    background: var(--ink);
    border-radius: 99px;
  }
  .bo-cuc { 
    grid-template-columns: 1fr; 
  }
  .canh-ben {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(85vw, 300px);
    max-height: none;
    border-radius: 0;
    transform: translateX(-102%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.mo-menu .canh-ben { 
    transform: translateX(0); 
  }
  .nen-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
  }
  body.mo-menu .nen-menu {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }
  .nut-dong {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    background: #f3f4f6;
    color: var(--ink);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
  }
  .anh-hung, .hai-cot, .ba-cot, .dong { 
    grid-template-columns: 1fr; 
  }
  .bo-loc-anh-soan { 
    grid-template-columns: 1fr 1fr; 
  }
  .anh-hung { 
    min-height: auto; 
    padding: 10px 0 30px;
  }
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  td, th { 
    white-space: normal; 
    min-width: 140px; 
  }
}

@media (max-width: 640px) {
  .khung { padding: 24px 16px 48px; }
  .dieu-huong { padding: 12px 16px; gap: 10px; }
  .thuong-hieu { font-size: 1.05rem; }
  .menu .nho { display: none; }
  .the { padding: 18px; }
  .tieu-de { align-items: stretch; flex-direction: column; }
  .tieu-de .nut, .tieu-de button { width: 100%; }
  .hanh-dong > * { flex: 1 1 auto; }
  .bo-loc-anh-soan { grid-template-columns: 1fr; }
  .anh-hung h1 { font-size: 2.2rem; }
}
