:root {
  --bg: #efefef;
  --surface: #ffffff;
  --border: #d8d8d8;
  --border-strong: #b0b0b0;
  --text: #000000;
  --text-muted: #4a4a4a;
  --text-subtle: #7a7a7a;
  --hover: #e8e8e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* TOP BAR */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: #d4d4d4;
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
  width: 100%;
}

.topnav .links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  margin-right: 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.topnav .links a:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.08);
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* MAIN CONTENT WRAPPER */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

/* TYPOGRAPHY */
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #000;
}

h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 16px;
}

/* TABLES */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th {
  text-align: left;
  padding: 12px 16px;
  background: #d4d4d4;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover {
  background: var(--hover);
}

/* BUTTONS */
.btn {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
  font-family: inherit;
}

.btn:hover {
  background: #1f1f1f;
}

.btn:active {
  transform: translateY(1px);
}

.btn-danger {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-danger:hover {
  color: #fff;
  background: #000;
  border-color: #000;
}

/* FORMS */
.form {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.form h2 {
  width: 100%;
  margin-bottom: 12px;
}

.form input, .form select {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  flex: 1 1 160px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form input:focus, .form select:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.form input::placeholder {
  color: var(--text-subtle);
}

/* CONTROLS BAR */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.controls input[type="file"] {
  font-size: 12px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
}

.controls form {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* PAGER */
.pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 13px;
  align-items: center;
}

.pager a {
  color: var(--text);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.15s ease;
}

.pager a:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* LOGIN */
.login-card {
  max-width: 380px;
  margin: 80px auto;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.login-card h2 {
  font-size: 18px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 24px;
  text-align: center;
}

.login-card input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* DASHBOARD LAYOUT */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
  width: 100%;
}

.dashboard-half {
  min-width: 0;
}

.dashboard-half h2,
.dashboard-section h2 {
  margin-bottom: 12px;
}

.dashboard-section {
  margin-bottom: 32px;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.table-wrap table {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.dashboard-half table,
.dashboard-section table {
  font-size: 12px;
}

/* Hide ID (first column) and delete button (last column) on all dashboard tables */
.dashboard-row table td:first-child,
.dashboard-row table th:first-child,
.dashboard-row table td:last-child,
.dashboard-row table th:last-child,
.dashboard-section table td:first-child,
.dashboard-section table th:first-child,
.dashboard-section table td:last-child,
.dashboard-section table th:last-child {
  display: none;
}

/* Hide Phone and Email columns specifically on dashboard notes table */
.dashboard-section table tr td:nth-child(4),
.dashboard-section table tr td:nth-child(5),
.dashboard-section table tr th:nth-child(4),
.dashboard-section table tr th:nth-child(5) {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* MISC */
.error {
  color: #8b1f1f;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  font-weight: 500;
}

ul {
  padding-left: 20px;
  color: var(--text);
}

ul li {
  margin-bottom: 6px;
  font-weight: 500;
}

p {
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* SELECTION */
::selection {
  background: #000;
  color: #fff;
}

/* SORT-ABLE HEADERS */
th {
  cursor: pointer;
  user-select: none;
}

th:hover {
  background: #c4c4c4;
}

/* PAGER */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text);
}

.pager-info {
  font-weight: 500;
  min-width: 100px;
  text-align: center;
}

.pager-placeholder {
  display: inline-block;
  /* Same width as a button so the "Page X of Y" stays centered */
  width: 72px;
}

/* SEARCH BAR */
.search {
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  flex: 1 1 auto;
  max-width: 280px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* CONTROLS BAR — wrap when narrow */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}