/* FTree — shared style for new module pages */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Times New Roman", serif;
  background: #f4f1ea;
  color: #2b2b2b;
}
a { color: #8a1f1f; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Điều hướng dạng SIDEBAR trái (desktop) + top-bar ☰ (mobile), không JS ===== */
.nav {
  background: #5b1a1a;
  color: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.nav .brand { font-weight: bold; font-size: 19px; color: #fff; padding: 16px; display: block; white-space: nowrap; }
.nav .brand:hover { text-decoration: none; color: #fff; }

.nav-toggle { display: none; }
.nav-burger { display: none; }

.nav-menu { display: flex; flex-direction: column; }

/* nhóm = tiêu đề + danh sách mục luôn hiển thị */
.nav .dd > summary {
  list-style: none; cursor: default; padding: 12px 16px 4px;
  color: #e7c9a0; font-size: 11px; font-weight: bold; letter-spacing: .6px; text-transform: uppercase;
}
.nav .dd > summary::-webkit-details-marker { display: none; }
.nav .dd-panel { display: block; }
.nav .dd-panel a { display: block; padding: 9px 16px 9px 26px; color: #f3e7c9; font-size: 14px; }
.nav .dd-panel a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }

.nav-logout { display: block; padding: 12px 16px; color: #ffd0d0; font-weight: 600;
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 8px; }
.nav-logout:hover { color: #fff; text-decoration: none; }

@media (min-width: 901px) {
  body:has(.nav) { padding-left: 240px; } /* chỉ dời nội dung khi có sidebar */
  .nav { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; height: 100vh; overflow-y: auto; }
}

@media (max-width: 900px) {
  .nav { position: sticky; top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 52px; }
  .nav .brand { padding: 14px 16px; }
  .nav-burger { display: block; margin-left: auto; color: #fff; font-size: 24px; cursor: pointer; padding: 8px 14px; user-select: none; }
  .nav-menu { display: none; width: 100%; }
  .nav-toggle:checked ~ .nav-menu { display: flex; }
}

@media print { body { padding-left: 0 !important; } .nav { display: none !important; } }

.wrap { max-width: 1000px; margin: 22px auto; padding: 0 16px; }
.card {
  background: #fff;
  border: 1px solid #e0d8c5;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
h1 { font-size: 24px; margin: 6px 0 16px; color: #5b1a1a; }
h2 { font-size: 18px; margin: 0 0 12px; color: #5b1a1a; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fbf7ee; border: 1px solid #e8dec8; border-radius: 10px; padding: 16px; text-align: center; }
.stat .num { font-size: 28px; font-weight: bold; color: #8a1f1f; }
.stat .lbl { font-size: 13px; color: #666; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; }
th { background: #f6f0e3; color: #5b1a1a; }
tr:hover td { background: #fbf9f3; }

input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid #ccc; border-radius: 7px;
  font-size: 14px; font-family: inherit; margin: 4px 0 12px;
}
label { font-weight: 600; font-size: 14px; }
.btn {
  display: inline-block; background: #8a1f1f; color: #fff; border: none;
  padding: 9px 18px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.btn:hover { background: #6f1717; text-decoration: none; }
.btn.gray { background: #777; }
.btn.green { background: #2e7d32; }
.btn.sm { padding: 5px 12px; font-size: 13px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.pill.pending { background: #fff3cd; color: #8a6d00; }
.pill.approved { background: #d4edda; color: #1e6b2a; }
.pill.rejected { background: #f8d7da; color: #8a1f1f; }
.muted { color: #888; font-size: 13px; }
.ok { color: #2e7d32; font-weight: 600; }
.err { color: #b00020; font-weight: 600; }
.center { text-align: center; }
.comment { border-left: 3px solid #d8c9a0; padding: 6px 12px; margin: 10px 0; background: #fbf7ee; border-radius: 0 8px 8px 0; }
.comment .meta { font-size: 12px; color: #888; }
