:root {
  --bg: #f5f7fb;
  --card: #fff;
  --accent: #2563eb;
  --danger: #ef4444;
  --muted: #6b7280;
}
body {
  font-family: system-ui, Arial;
  background: var(--bg);
  /* padding: 24px; */
}
/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid #eef2f7;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  /* max-width: 1400px; */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.header-logo {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-decoration: none;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: flex-end;
}

.header-nav {
  display: flex;
  gap: 24px;
  list-style: none;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--accent);
}

.header-nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.header-user-menu {
  position: relative;
}

.header-user-menu button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  font-family: system-ui, Arial;
}

.header-user-menu button:hover {
  color: var(--accent);
}

.dropdown-menu, .tools-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid #eef2f7;
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  margin-top: 8px;
}

.tools-dropdown { right: auto; left: 0; min-width: 220px; }

.dropdown-menu.active, .tools-dropdown.active {
  display: block;
}

.dropdown-menu a, .tools-dropdown.a {
  display: block;
  padding: 10px 16px;
  color: #111;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

.dropdown-menu a:last-child, .tools-dropdown a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover, .tools-dropdown a:hover {
  background: #f9fafb;
}

.dropdown-menu a.danger {
  color: var(--danger);
}

/* Tools menu parent in desktop nav */
.tools-menu {
  position: relative;
  display: inline-block;
}
.tools-menu .tools-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.container {
  /* max-width: 1100px; */
  padding: 20px;
  /* padding-bottom: 20px; */
  margin: 0 auto;
}
.card {
  background: var(--card);
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
h2 {
  margin: 0 0 12px 0;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
button.btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
button.btn.primary {
  background: var(--accent);
  color: #fff;
}
button.btn.ghost {
  background: transparent;
  border: 1px solid #e5e7eb;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.actions button {
  margin-right: 6px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #f3f4f6;
  color: #111;
}
/* modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
}
.modal {
  background: var(--card);
  width: 620px;
  max-width: 96%;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.4);
}
.modal h3 {
  margin-top: 0;
}
.form-row {
  margin-bottom: 12px;
}
label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
input[type="text"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 6px;
  box-sizing: border-box;
}
input[type="password"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 6px;
  box-sizing: border-box;
}
input[type="number"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 6px;
  box-sizing: border-box;
}
input[type="email"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #e6eef7;
  border-radius: 6px;
  box-sizing: border-box;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
}
/* Mobile hamburger menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--accent);
  font-size: 24px;
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  top: 64px;
  width: 100%;
  background: var(--card);
  border-bottom: 1px solid #eef2f7;
  z-index: 41;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border-radius: 8px;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav-backdrop.active {
  display: block;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.mobile-nav li {
  border-bottom: 1px solid #f3f4f6;
}

.mobile-nav a {
  display: block;
  padding: 16px;
  color: #111;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.mobile-nav a:hover {
  background: #f9fafb;
}

.mobile-nav a.active {
  color: var(--accent);
  background: #f9fafb;
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

/* Footer */
footer.site-footer {
  margin-top: auto;
  background: transparent;
  border-top: 1px solid #eef2f7;
  padding: 14px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .modal {
    width: 94%;
  }
  .header-nav {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .header-container {
    height: 56px;
  }
  .header-title {
    display: none;
  }
  .header-right {
    gap: 12px;
  }
}
