:root {
    --primary: #2c5f8a;
    --primary-dark: #1e4360;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #222;
    --muted: #666;
    --border: #e1e4e8;
    --danger: #c0392b;
    --success: #2e7d32;
    --radius: 8px;
}

* { box-sizing: border-box; }

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: var(--primary-dark);
    color: #fff;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 20px;
}

.logo {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

nav a {
    color: #dce6f0;
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}

nav a:hover { color: #fff; }

.user-info { color: #b8c9db; margin-left: 18px; }

main.container { padding-top: 24px; padding-bottom: 60px; min-height: 60vh; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.alert-error   { background: #fdecea; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #e9f7ef; color: var(--success); border: 1px solid #c3e6cb; }

h1 { font-size: 1.6rem; margin-bottom: 20px; }
h2 { font-size: 1.3rem; }

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease;
}
.book-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

.book-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    background: #eef1f4;
}
.book-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #b7c1cc;
}

.book-info { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.book-title { font-weight: 600; margin: 0 0 4px; font-size: 1rem; }
.book-author { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.book-meta { font-size: 0.8rem; color: var(--muted); margin-top: auto; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #96281f; }
.btn-secondary { background: #7d8a97; }
.btn-secondary:hover { background: #616d78; }

form.card, .card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 520px;
}

.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=file],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }

table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: #eef2f6; }

.actions-row { display: flex; gap: 8px; margin-bottom: 18px; }

.pagination { display: flex; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
}
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

.site-footer {
    text-align: center;
    padding: 20px 0;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}
