:root {
    --green-dark: #1f4d3a;
    --green-soft: #2f7d5a;
    --green-pale: #e7f0ea;
    --cream: #faf7f0;
    --gold: #c8a44d;
    --text-dark: #23291f;
    --text-muted: #6b7568;
    --border: #e1ddd0;
    --white: #ffffff;
    --danger: #b3423c;
    --radius: 10px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', 'Poppins', Arial, sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.5;
}
a { color: var(--green-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ===== Navbar ===== */
.navbar {
    background: var(--green-dark);
    color: var(--white);
    padding: 12px 0;
    position: sticky; top: 0; z-index: 50;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--white); font-size: 1.05rem; }
.navbar .brand span.badge { background: var(--gold); color: var(--green-dark); font-size: .65rem; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.navbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.navbar nav a { color: #dfeee5; font-size: .92rem; }
.navbar nav a.active { color: var(--gold); font-weight: 600; }
.navbar .user-chip { background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 20px; font-size: .85rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius); border: none;
    font-size: .9rem; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-primary { background: var(--green-soft); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--green-dark); }
.btn-outline { background: transparent; border: 1px solid var(--green-soft); color: var(--green-soft); }
.btn-outline:hover { background: var(--green-pale); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Cards ===== */
.card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
}
.book-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(31,77,58,.12); }
.book-card .cover {
    aspect-ratio: 3/4; background: var(--green-pale); display: flex; align-items: center; justify-content: center;
    color: var(--green-soft); font-size: 2.2rem; overflow: hidden;
}
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.book-card .tag { font-size: .68rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.book-card .title { font-weight: 700; font-size: .95rem; color: var(--text-dark); }
.book-card .meta { font-size: .78rem; color: var(--text-muted); }
.book-card .actions { display: flex; gap: 8px; padding: 0 14px 14px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .grid { grid-template-columns: 1fr; } }

/* ===== Forms ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.form-control, select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: .92rem; font-family: inherit; background: var(--white);
}
.form-control:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ===== Table ===== */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: .88rem; }
th { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }
tr:hover td { background: #fafcf9; }

/* ===== Layout dashboard ===== */
.dash-wrap { display: flex; min-height: calc(100vh - 58px); }
.sidebar { width: 230px; background: var(--white); border-right: 1px solid var(--border); padding: 18px 0; }
.sidebar h4 { padding: 0 18px; color: var(--text-muted); font-size: .72rem; text-transform: uppercase; margin: 16px 0 6px; }
.sidebar a { display: block; padding: 9px 18px; color: var(--text-dark); font-size: .88rem; }
.sidebar a:hover, .sidebar a.active { background: var(--green-pale); color: var(--green-dark); text-decoration: none; border-right: 3px solid var(--green-soft); }
.main-content { flex: 1; padding: 24px; max-width: calc(100% - 230px); }
@media (max-width: 860px) { .dash-wrap { flex-direction: column; } .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 8px; } .sidebar h4 { display: none; } .sidebar a { white-space: nowrap; border-right: none !important; } .main-content { max-width: 100%; } }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 1.35rem; margin: 0; color: var(--green-dark); }
.page-header h1 small { display: block; font-size: .78rem; color: var(--text-muted); font-weight: 400; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-box { background: var(--white); border-radius: var(--radius); padding: 16px; border-left: 4px solid var(--green-soft); }
.stat-box .num { font-size: 1.6rem; font-weight: 800; color: var(--green-dark); }
.stat-box .lbl { font-size: .8rem; color: var(--text-muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-green { background: var(--green-pale); color: var(--green-dark); }
.badge-gold { background: #f5ecd7; color: #8a6d20; }
.badge-red { background: #fbe6e4; color: var(--danger); }
.badge-gray { background: #eee; color: #777; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #e6f4ea; color: #1e6b3a; border: 1px solid #bfe3c9; }
.alert-error { background: #fbe6e4; color: #8f2c26; border: 1px solid #f1c1bc; }
.alert-info { background: #e6f0fb; color: #275a8f; border: 1px solid #c2dbf3; }

.hero { background: linear-gradient(135deg, var(--green-dark), var(--green-soft)); color: var(--white); padding: 46px 0; text-align: center; }
.hero h1 { font-size: 1.9rem; margin-bottom: 6px; }
.hero p.tagline { color: #dcefe3; margin-bottom: 22px; }
.search-box { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.search-box input { flex: 1; padding: 13px 18px; border-radius: 30px; border: none; font-size: .95rem; }
.search-box button { padding: 0 22px; border-radius: 30px; }

.cat-chip-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.cat-chip { background: rgba(255,255,255,.14); color: var(--white); padding: 8px 16px; border-radius: 20px; font-size: .85rem; }
.cat-chip:hover { background: rgba(255,255,255,.24); text-decoration: none; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 16px; }
.section-title h2 { font-size: 1.15rem; color: var(--green-dark); margin: 0; }

.footer { background: var(--green-dark); color: #cfe6d8; padding: 26px 0; margin-top: 40px; text-align: center; font-size: .85rem; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: 6px; border: 1px solid var(--border); font-size: .85rem; }
.pagination a.active, .pagination span.active { background: var(--green-soft); color: #fff; border-color: var(--green-soft); }

.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; background: var(--white); padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); }
.filters-bar select, .filters-bar input { min-width: 150px; }

.id-card {
    width: 340px; border-radius: 14px; overflow: hidden;
    background: linear-gradient(145deg, var(--green-dark), var(--green-soft)); color: #fff;
    padding: 16px; font-family: sans-serif;
}
.id-card .school { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.id-card .photo { width: 74px; height: 90px; background: rgba(255,255,255,.15); border-radius: 6px; margin: 10px 0; }
.id-card .name { font-size: 1.05rem; font-weight: 800; }
.id-card .role { font-size: .8rem; opacity: .9; margin-bottom: 8px; }
.id-card .code { font-size: .72rem; opacity: .8; margin-top: 8px; }

@media print { .no-print { display: none !important; } }
