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

:root {
  --black: #111;
  --white: #fff;
  --gray-100: #f9f9f9;
  --gray-200: #f0f0f0;
  --gray-400: #bbb;
  --gray-600: #555;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, monospace;
  --max-w: 1100px;
  --spacing: 1rem;
}

body { font-family: var(--font-sans); color: var(--black); background: var(--white); line-height: 1.6; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.site-header { border-bottom: 1.5px solid var(--black); padding: 0 var(--spacing); }
.nav { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { font-weight: 700; letter-spacing: -0.5px; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; font-size: 0.875rem; }
.btn-logout { margin-left: auto; padding-left: 1.5rem; border-left: 1.5px solid var(--gray-200); color: var(--gray-600); font-size: 0.8rem; letter-spacing: 0.3px; }
.btn-logout:hover { color: var(--black); text-decoration: none; }

/* Buttons */
.btn-primary { background: var(--black); color: var(--white); padding: 0.4rem 1rem; border-radius: 3px; font-size: 0.875rem; border: none; cursor: pointer; }
.btn-primary:hover { background: var(--gray-600); text-decoration: none; }
.btn-secondary { border: 1.5px solid var(--black); padding: 0.35rem 0.9rem; border-radius: 3px; font-size: 0.875rem; }
.btn-outline { border: 1.5px solid var(--black); background: var(--white); padding: 0.4rem 1rem; border-radius: 3px; cursor: pointer; font-size: 0.875rem; }

/* Main */
.main-content { max-width: var(--max-w); margin: 0 auto; padding: 2rem var(--spacing); }
.site-footer { border-top: 1px solid var(--gray-200); padding: 1.5rem var(--spacing); text-align: center; font-size: 0.8rem; color: var(--gray-400); }

/* Book grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.book-card { display: flex; flex-direction: column; gap: 0.5rem; }
.book-card__cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--gray-200); }
.book-card__title { font-weight: 600; font-size: 0.95rem; }
.book-card__price { font-family: var(--font-mono); font-size: 0.875rem; }
.book-card__category { font-size: 0.75rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 1px; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
label { font-size: 0.875rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  border: 1.5px solid var(--black); padding: 0.5rem 0.75rem; font-size: 0.95rem;
  font-family: var(--font-sans); border-radius: 3px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 2px rgba(17,17,17,0.1); }
.form-errors { color: #c0392b; font-size: 0.85rem; margin-bottom: 1rem; }

/* Messages */
.messages { list-style: none; margin-bottom: 1rem; }
.message { padding: 0.75rem 1rem; border-radius: 3px; font-size: 0.9rem; margin-bottom: 0.5rem; }
.message--success { background: #d4edda; color: #155724; }
.message--error { background: #f8d7da; color: #721c24; }
.message--info { background: #d1ecf1; color: #0c5460; }

/* Misc */
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.5px; }
.badge { display: inline-block; background: var(--gray-200); padding: 0.2rem 0.5rem; border-radius: 3px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }
.price-tag { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; }

/* Dashboard */
.stats-bar { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 140px; border: 1.5px solid var(--gray-200); padding: 1rem; border-radius: 6px; }
.stat-card__value { font-size: 1.75rem; font-weight: 700; }
.stat-card__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-600); }
