:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #d9dee3;
  --text: #1f2a37;
  --muted: #596573;
  --primary: #0b5ed7;
  --primary-hover: #0a4fb0;
  --danger: #b42318;
  --danger-bg: #fde8e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 1.5rem;
  background: #fd0f64;
  color: #fff;
}

.nav { display: flex; gap: 1rem; align-items: center; flex: 1; }
.nav a { color: #fff; text-decoration: none; }
.nav a:hover { color: rgba(255, 255, 255, 0.8); }
.nav .user { color: rgba(255, 255, 255, 0.82); font-size: 0.9rem; margin-left: auto; }
.nav .logout { color: #fff; }

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.container.container-wide {
  max-width: none;
  margin: 1.25rem 0;
  padding: 0 1rem;
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f5b9b3;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

.login-card {
  max-width: 360px;
  margin: 3rem auto;
}

.login-form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.login-form input {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}
.login-form button {
  padding: 0.6rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.login-form button:hover { background: var(--primary-hover); }

.section-list { padding-left: 1.2rem; }
.section-list a { color: var(--primary); }

.note { color: var(--muted); }

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
table.data th, table.data td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
table.data th:last-child, table.data td:last-child { border-right: none; }
table.data th { background: #eef2f6; font-weight: 600; font-size: 0.9rem; }
table.data tr:last-child td { border-bottom: none; }

table.data th.col-mail,
table.data td.col-mail {
  white-space: normal;
  overflow-wrap: anywhere;
}

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.nav-dropdown-toggle:hover { color: rgba(255, 255, 255, 0.8); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  margin: 0;
  padding: 0.3rem 0;
  list-style: none;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  min-width: 240px;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
  display: block;
  padding: 0.5rem 0.9rem;
  color: #e2e8f0;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-menu li a:hover { background: #334155; color: #fff; }

.filter-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}
.filter-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.filter-form input[type="text"] {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
}
.filter-actions { display: flex; gap: 0.6rem; align-items: center; }
.filter-actions button {
  padding: 0.5rem 1.1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.filter-actions button:hover { background: var(--primary-hover); }
.btn-secondary {
  padding: 0.5rem 0.9rem;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-secondary:hover { background: #f1f5f9; color: var(--text); }

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.result-count { color: var(--muted); font-size: 0.9rem; margin: 0; }
.table-wrapper { overflow-x: auto; }
