/* AI Agent Viết Bài - flat design, Be Vietnam Pro, chỉ bold/normal, không đổ bóng */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: #1c2733;
  background: #f4f6f8;
}
a { color: #0068ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
h2 { font-size: 16px; font-weight: 700; margin: 22px 0 10px; }
p { margin: 0 0 10px; }

/* Topbar */
.topbar { background: #ffffff; border-bottom: 1px solid #e2e7ec; }
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 17px; color: #0b3d91; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 6px; color: #33475b; }
.nav a:hover { background: #eef3f9; text-decoration: none; }
.nav a.active { background: #0068ff; color: #fff; font-weight: 700; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.uname { color: #5a6b7c; font-size: 14px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }

/* Card */
.card {
  background: #fff; border: 1px solid #e2e7ec; border-radius: 10px;
  padding: 26px 28px; margin-bottom: 20px;
}

/* Flash */
.flash { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; }
.flash-ok { background: #e8f7ee; border-color: #9fd8b4; color: #146c2e; }
.flash-error { background: #fdecec; border-color: #f3b1b1; color: #9c1c1c; }

/* Form */
label.lbl { display: block; font-weight: 700; font-size: 14.5px; margin: 14px 0 6px; }
label.lbl:first-child { margin-top: 0; }
.hint { color: #68798a; font-size: 13.5px; margin-top: 4px; }
input[type="text"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1px solid #c3cedb; border-radius: 8px; background: #fff; color: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc2ff; border-color: #0068ff; }
.checkline { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkline input { width: auto; }

/* Button */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px; border: 1px solid #0068ff;
  background: #0068ff; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: #0053cc; text-decoration: none; }
.btn-small { padding: 6px 14px; font-size: 14px; background: #fff; color: #33475b; border-color: #c3cedb; font-weight: 400; }
.btn-small:hover { background: #eef3f9; }
.btn-secondary { background: #fff; color: #0068ff; }
.btn-secondary:hover { background: #eaf2ff; }
.btn-danger { background: #fff; color: #b3261e; border-color: #e0a49f; }
.btn-danger:hover { background: #fdecec; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Table */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e8edf2; vertical-align: top; }
table.tbl th { font-weight: 700; font-size: 14px; color: #43566b; background: #f7fafc; }
table.tbl tr:last-child td { border-bottom: none; }

/* Badge trạng thái */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; border: 1px solid; white-space: nowrap; }
.badge-cho { background: #eef1f4; border-color: #c9d3dd; color: #43566b; }
.badge-dang_viet { background: #fff4d6; border-color: #ecd28a; color: #7a5b00; }
.badge-cho_duyet { background: #e3ecff; border-color: #a9c2f5; color: #0b3d91; }
.badge-da_duyet { background: #e8f7ee; border-color: #9fd8b4; color: #146c2e; }
.badge-da_dang { background: #0068ff; border-color: #0068ff; color: #fff; }
.badge-loi { background: #fdecec; border-color: #f3b1b1; color: #9c1c1c; }
.badge-hoan_tat { background: #e8f7ee; border-color: #9fd8b4; color: #146c2e; }

/* Lưới thống kê */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid #e2e7ec; border-radius: 10px; padding: 18px; }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .cap { color: #68798a; font-size: 14px; }

/* Bộ lọc trạng thái */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filterbar a { padding: 5px 14px; border: 1px solid #c3cedb; border-radius: 999px; color: #33475b; background: #fff; }
.filterbar a:hover { text-decoration: none; background: #eef3f9; }
.filterbar a.active { background: #0068ff; border-color: #0068ff; color: #fff; font-weight: 700; }

/* Xem trước nội dung bài */
.article-preview { border: 1px solid #e2e7ec; border-radius: 8px; padding: 20px 24px; background: #fff; }
.article-preview h2 { font-size: 19px; margin: 20px 0 8px; }
.article-preview h3 { font-size: 16px; margin: 16px 0 6px; }
.cover-img { max-width: 100%; border-radius: 8px; border: 1px solid #e2e7ec; }
.meta-line { color: #68798a; font-size: 14px; }
.err-text { color: #9c1c1c; }
code.inline { background: #eef1f4; padding: 1px 6px; border-radius: 4px; font-size: 13.5px; }

/* Đăng nhập */
.login-wrap { max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.login-wrap .card { padding: 30px 32px; }
.login-title { text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: #68798a; margin-bottom: 10px; }

@media (max-width: 720px) {
  .card { padding: 20px; }
  .topbar-in { gap: 10px; padding: 8px 14px; }
  .wrap { padding: 16px 12px 40px; }
  table.tbl { font-size: 14px; }
}
