/* Web TUp v1 — giao dien don gian, giong tinh than T Review (teal). */
:root {
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --navy: #0a0f1e;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f8fafc;
    --danger: #dc2626;
    --ok: #059669;
    --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--teal-dark); }
.topbar { background: var(--navy); color: #fff; padding: 12px 20px;
          display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar .brand { font-weight: 800; font-size: 18px; color: #fff;
                 text-decoration: none; letter-spacing: .3px; }
.topbar .brand span { color: #2dd4bf; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #cbd5e1; text-decoration: none; padding: 6px 10px;
                border-radius: 6px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { background: #1e293b; color: #fff; }
.topbar .user { margin-left: auto; font-size: 13px; color: #94a3b8;
                display: flex; align-items: center; gap: 10px; }
.topbar .user button { background: none; border: 1px solid #475569; color: #e2e8f0;
                       border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.container { max-width: 960px; margin: 24px auto; padding: 0 16px 60px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px;
        padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 6px; font-size: 19px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
input[type=text], input[type=email], input[type=password],
input[type=datetime-local], textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
input[type=file] { width: 100%; padding: 8px 0; }
.btn { display: inline-block; background: var(--teal); color: #fff; border: none;
       border-radius: 8px; padding: 10px 20px; font-size: 15px; font-weight: 600;
       cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--teal-dark); }
.btn.secondary { background: #e5e7eb; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 600;
                margin: 0; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px;
         font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.uploading { background: #fef3c7; color: #92400e; }
.badge.scheduled { background: #dbeafe; color: #1e40af; }
.badge.published { background: #d1fae5; color: #065f46; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.file-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
            margin: 8px 0; background: #f9fafb; }
.blog-body p { margin: 0 0 14px; }
.blog-body img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.blog-body a { word-break: break-word; }
/* Video YouTube nhung trong bai viet: khung 16:9, rong het cot
   noi dung. Iframe khong tu chay (khong autoplay). */
.yt-embed { position: relative; padding-bottom: 56.25%; height: 0;
            overflow: hidden; margin: 0 0 14px; border-radius: 8px; }
.yt-embed iframe { position: absolute; top: 0; left: 0; width: 100%;
                   height: 100%; border: 0; }
.comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comment p { margin: 0 0 6px; }
img { max-width: 100%; }
/* Khung quang cao co dinh 2 ben trang Bai viet: rong 160px, dinh
   theo khi cuon, chi hien tren man hinh rong (>=1360px: 960px
   noi dung + 2 khung 160px + khoang cach). min-height 250px de
   khung luon du dien tich toi thieu cho banner adaptive cua AADS
   (120x25 px) ngay ca khi ma quang cao chua render xong. */
.ad-slot { display: none; }
@media (min-width: 1360px) {
  .ad-slot { display: block; position: fixed; top: 90px; width: 160px; min-height: 250px; z-index: 5; }
  .ad-slot.ad-left { right: calc(50% + 500px); }
  .ad-slot.ad-right { left: calc(50% + 500px); }
  .ad-slot img, .ad-slot ins { max-width: 100%; }
  .ad-slot.ad-empty { border: 1px dashed #94a3b8; border-radius: 8px;
                      padding: 12px; text-align: center; opacity: .7; }
  .ad-slot.ad-empty a { color: #64748b; font-size: 13px; }
}
/* Quang cao tu chen trong noi dung bai viet (giua bai + cuoi bai). */
.ad-inline { margin: 20px 0; text-align: center; }
.ad-inline img, .ad-inline ins { max-width: 100%; }
.file-row .fname { font-weight: 700; }
.file-row .fmeta { color: var(--muted); font-size: 13px; }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
        padding: 10px 14px; font-size: 13px; margin: 12px 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.chat-msg { padding: 12px 0; border-bottom: 1px solid var(--line); }
.chat-msg.chat-assistant { background: #f8fafc; margin: 0 -12px; padding: 12px; border-radius: 8px; }
.chat-history { max-height: 60vh; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 10px; }
.chat-row { display: flex; }
.chat-row.chat-user { justify-content: flex-end; }
.chat-row.chat-assistant { justify-content: flex-start; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; overflow-wrap: break-word; }
.chat-user .chat-bubble { background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.chat-assistant .chat-bubble { background: #f1f5f9; color: #0f172a; border-bottom-left-radius: 4px; }
.chat-label { font-size: 12px; font-weight: 700; color: #b45309; margin-bottom: 4px; }
.chat-time { font-size: 11px; opacity: 0.7; margin-top: 4px; text-align: right; }
.chat-assistant .chat-time { text-align: left; }
.chat-typing .chat-text { color: #64748b; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.chip:hover { background: #f1f5f9; }
.chat-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#chat-input { width: 100%; }
