:root {
  --brand-teal: #31aab3;
  --brand-blue: #2d5e97;
  --brand-gradient: linear-gradient(135deg, var(--brand-teal), var(--brand-blue));
  --text: #1c2530;
  --text-muted: #4a5768;
  --border: #d3dae3;
  --bg: #f7fafd;
  --error: #c0392b;
  --success: #147a44;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text);
}

/* Shared nav header */
.app-header {
  background: var(--brand-gradient);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.app-header .brand img {
  height: 32px; width: 32px; display: block;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
}
.app-header nav { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.app-header nav a { color: #fff; text-decoration: none; opacity: 0.9; }
.app-header nav a:hover { opacity: 1; text-decoration: underline; }
.app-header form.logout { display: inline; margin: 0; }
.app-header form.logout button {
  background: none; border: none; color: #fff; opacity: 0.9;
  cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0;
}
.app-header .email { font-size: 13px; opacity: 0.9; }

.page { padding: 32px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  max-width: 640px;
  margin: 0 auto 24px;
}
.card.narrow { max-width: 480px; }
.card.wide { max-width: 960px; }

h1, h2 { color: #0b1f33; margin-top: 0; }
h1 { font-size: 18px; }

label { display: block; font-size: 13px; color: var(--text-muted); margin: 12px 0 4px; }

input[type="email"], input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

button.primary {
  margin-top: 16px;
  padding: 10px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
}
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.button-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 16px;
  padding: 10px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  box-sizing: border-box;
}

button.secondary {
  padding: 4px 10px;
  background: #fff;
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
button.danger {
  padding: 4px 10px;
  background: #fff;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: #eaf2fb; cursor: pointer; user-select: none; }
th.sortable::after { content: ' \2195'; color: var(--text-muted); font-size: 11px; }

.error { color: var(--error); margin-top: 12px; font-size: 13px; }
.success { color: var(--success); margin-top: 12px; font-size: 13px; }
.status-message { color: var(--text-muted); margin-top: 12px; font-size: 13px; }

.edit-form { display: none; margin-top: 8px; padding: 8px; background: var(--bg); border-radius: 4px; }
.edit-form.open { display: block; }

.filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filter-form > div { flex: 1; min-width: 140px; }
.filter-form label { margin: 0 0 4px; }
.filter-form button { margin-top: 0; width: auto; padding: 8px 16px; }

.quota { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--text-muted); }

/* Login page centers its card in the viewport */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
body.login-page { display: flex; flex-direction: column; min-height: 100vh; }
