/* LFCBD — quiet-premium design system */

/* Inter variable font */
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --ink: #18181B;
  --ink-muted: #6E6E73;
  --border: #E4E4E0;
  --accent: #4F46E5;

  --blue: #2563EB;
  --green: #16A34A;
  --red: #DC2626;
  --amber: #D97706;

  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-badge: 999px;

  --font-xs: 12px;
  --font-ui: 13px;
  --font-secondary: 14px;
  --font-body: 15px;
  --font-card-title: 18px;
  --font-page-title: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: var(--font-card-title);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-ui);
}

.nav-username {
  font-weight: 600;
  color: var(--ink);
}

.nav-role {
  font-size: var(--font-xs);
  color: var(--ink-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  border: 1px solid var(--border);
}

.nav-logout {
  display: flex;
}

/* ---- Main ---- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ---- Auth card ---- */
.auth-card {
  max-width: 400px;
  margin: 80px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-wordmark {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 4px;
}

.auth-sublabel {
  font-size: var(--font-secondary);
  color: var(--ink-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error {
  font-size: var(--font-ui);
  color: var(--red);
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.15s;
}

.auth-error.visible {
  opacity: 1;
}

/* ---- Fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: var(--font-ui);
  font-weight: 500;
  color: var(--ink-muted);
}

.input {
  font-family: inherit;
  font-size: var(--font-body);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s;
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

select.input {
  cursor: pointer;
}

/* ---- Buttons ---- */
.btn {
  font-family: inherit;
  font-size: var(--font-secondary);
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-full {
  width: 100%;
}

.btn-ghost {
  font-family: inherit;
  font-size: var(--font-ui);
  font-weight: 500;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--ink);
}

.btn-danger {
  color: var(--red);
}

.btn-danger:hover {
  background: #FEF2F2;
  color: var(--red);
}

.btn-sm {
  font-size: var(--font-xs);
  padding: 4px 10px;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}

.card-title {
  font-size: var(--font-card-title);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ---- Table ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-secondary);
}

.table th {
  text-align: left;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.td-name {
  font-weight: 600;
}

.td-email {
  color: var(--ink-muted);
}

.td-date {
  font-size: var(--font-xs);
  color: var(--ink-muted);
}

.td-actions {
  white-space: nowrap;
}

.action-group {
  display: flex;
  gap: 4px;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-badge);
}

.badge-admin {
  background: #EEF2FF;
  color: var(--accent);
}

.badge-member {
  background: var(--bg);
  color: var(--ink-muted);
}

.badge-active {
  background: #F0FDF4;
  color: var(--green);
}

.badge-inactive {
  background: #FEF2F2;
  color: var(--red);
}

/* ---- Admin ---- */
.admin-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-add-card {
  /* inherits card styles */
}

.admin-add-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .admin-add-form .form-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* ---- Flash messages ---- */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: var(--font-ui);
  font-weight: 500;
}

.flash-error {
  background: #FEF2F2;
  color: var(--red);
  border: 1px solid #FECACA;
}

.flash-success {
  background: #F0FDF4;
  color: var(--green);
  border: 1px solid #BBF7D0;
}

/* ---- Feed ---- */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-empty {
  text-align: center;
  padding: 64px 16px;
}

.feed-empty-text {
  font-size: var(--font-body);
  color: var(--ink-muted);
}

/* ---- Page title ---- */
.page-title {
  font-size: var(--font-page-title);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
