/* Tool Content AI — giao diện web.
   Viết tay, không dùng framework, không có bước build (CONTEXT.md §2.65).
   Ưu tiên: đọc được trên điện thoại, nút đủ to để bấm bằng ngón tay. */

:root {
  --nen: #0f172a;
  --nen-the: #1e293b;
  --nen-the-nhat: #334155;
  --vien: #334155;
  --chu: #e2e8f0;
  --chu-mo: #94a3b8;
  --xanh: #3b82f6;
  --xanh-dam: #2563eb;
  --luc: #22c55e;
  --do: #ef4444;
  --cam: #f59e0b;
  --bo-goc: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--nen);
  color: var(--chu);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--xanh); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Thanh trên cùng ─────────────────────────────────────────── */
.thanh-tren {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--nen-the);
  border-bottom: 1px solid var(--vien);
  position: sticky; top: 0; z-index: 10;
}
.thanh-tren .ten { font-weight: 600; font-size: 1.05rem; }
.thanh-tren nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.thanh-tren nav a { color: var(--chu-mo); font-size: .92rem; }
.thanh-tren nav a:hover, .thanh-tren nav a.dang-xem { color: var(--chu); }

.trang { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* ── Thẻ ─────────────────────────────────────────────────────── */
.the {
  background: var(--nen-the);
  border: 1px solid var(--vien);
  border-radius: var(--bo-goc);
  padding: 18px;
  margin-bottom: 16px;
}
.the h2 { margin: 0 0 12px; font-size: 1.05rem; }

/* ── Nút ─────────────────────────────────────────────────────── */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  min-height: 42px;                 /* đủ to để bấm bằng ngón tay */
  border: 1px solid var(--vien);
  border-radius: 8px;
  background: var(--nen-the-nhat);
  color: var(--chu);
  font-size: .95rem; font-family: inherit;
  cursor: pointer;
}
.nut:hover { filter: brightness(1.15); }
.nut:disabled { opacity: .5; cursor: not-allowed; }
.nut-chinh { background: var(--xanh-dam); border-color: var(--xanh-dam); font-weight: 600; }
.nut-chinh:hover { background: var(--xanh); }
.nut-chay { background: var(--luc); border-color: var(--luc); color: #052e16; font-weight: 600; }
.nut-dung { background: var(--do); border-color: var(--do); font-weight: 600; }

/* ── Ô nhập ──────────────────────────────────────────────────── */
label { display: block; margin-bottom: 6px; font-size: .9rem; color: var(--chu-mo); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 11px 12px;
  min-height: 44px;
  background: var(--nen);
  border: 1px solid var(--vien);
  border-radius: 8px;
  color: var(--chu);
  font-family: inherit;
  font-size: 16px;                  /* < 16px thì iPhone tự phóng to trang khi bấm vào ô */
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--xanh);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }

/* ── Bảng ────────────────────────────────────────────────────── */
.bang-cuon { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--vien); }
th { color: var(--chu-mo); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: rgba(255,255,255,.03); }

/* ── Nhãn trạng thái ─────────────────────────────────────────── */
.nhan {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.nhan-chay { background: rgba(34,197,94,.15); color: var(--luc); }
.nhan-dung { background: rgba(148,163,184,.15); color: var(--chu-mo); }
.nhan-loi  { background: rgba(239,68,68,.15); color: var(--do); }
.nhan-cho  { background: rgba(245,158,11,.15); color: var(--cam); }

/* ── Thông báo ───────────────────────────────────────────────── */
.bao-loi, .bao-ok {
  padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem;
}
.bao-loi { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }
.bao-ok  { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #86efac; }

.mo { color: var(--chu-mo); font-size: .88rem; }

/* ── Trang đăng nhập ─────────────────────────────────────────── */
.khung-dang-nhap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.hop-dang-nhap {
  width: 100%; max-width: 380px;
  background: var(--nen-the); border: 1px solid var(--vien);
  border-radius: 14px; padding: 30px;
}
.hop-dang-nhap h1 { margin: 0 0 6px; font-size: 1.25rem; text-align: center; }
.hop-dang-nhap .phu { text-align: center; color: var(--chu-mo); font-size: .88rem; margin-bottom: 22px; }
.hop-dang-nhap .o { margin-bottom: 14px; }
.hop-dang-nhap .nut { width: 100%; }

/* ── Màn hình nhỏ ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .trang { padding: 12px; }
  .the { padding: 14px; }
  .thanh-tren { padding: 10px 14px; gap: 10px; }
  .thanh-tren .ten { font-size: .95rem; }
  th, td { padding: 9px 8px; }
}
