:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --brand: #1e293b;
  --danger: #b91c1c;
  --ok: #4ade80;
  --fail: #f87171;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; }

a { color: #60a5fa; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0.7rem 1.25rem;
  background: var(--brand);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.topbar-link { white-space: nowrap; color: var(--text-muted); }

.content {
  min-width: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: end;
}

label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--text-muted); }

input, select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

input:disabled { opacity: 0.7; }

button {
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:hover { background: var(--accent-hover); }

.own-log-note { font-size: 0.8rem; color: var(--text-muted); align-self: center; }

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; }
th { color: var(--text-muted); position: sticky; top: 0; background: var(--bg); }
tr:hover { background: var(--surface); }
.fail { color: var(--fail); }
.ok { color: var(--ok); }
.meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 10px; }

pre {
  background: var(--surface);
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
}

.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--surface);
}
.report-delete { margin: 0; }
.report-delete button { background: var(--danger); padding: 4px 10px; font-size: 0.8rem; }

/* --- Dang nhap --- */
.login-shell { max-width: 360px; margin: 80px auto; padding: 0 16px; }
.login-shell h1 { margin-bottom: 4px; }
.login-shell .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.login-shell label { display: block; margin-top: 12px; font-size: 14px; color: var(--text); }
.login-shell input { width: 100%; padding: 8px; margin-top: 4px; box-sizing: border-box; }
.login-shell button { margin-top: 18px; padding: 8px 16px; width: 100%; }
.login-error { color: var(--fail); font-size: 14px; margin-top: 12px; }

/* --- Thanh nhan vien dang dang nhap --- */
.member-bar { background: var(--brand); color: var(--text); border-top: 1px solid var(--border); }
.member-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.member-bar-name { display: flex; align-items: center; gap: 8px; }
.badge-role {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
}
.member-bar-logout { margin: 0; }
.member-bar-logout button { padding: 4px 12px; font-size: 0.8rem; background: var(--surface); }

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* --- Phan trang (cung skeleton voi crmpywebmd) --- */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.page-numbers { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.page-link {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.page-link:hover { border-color: var(--accent); }
.page-link.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.page-link.disabled { color: var(--text-muted); cursor: default; opacity: 0.5; }
.page-ellipsis { padding: 0.35rem 0.2rem; color: var(--text-muted); }
.pagination-compact { flex-wrap: nowrap; justify-content: flex-start; gap: 0.25rem; overflow-x: auto; }
