/* Bouqin — UI rétro bibliothèque (inspiré Windows 2000, thème bordeaux) */

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

body {
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: #1a1008;
    background: #6e5a48 url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='3' height='3' fill='%23604c3c'/%3E%3Crect x='3' y='3' width='3' height='3' fill='%23604c3c'/%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #6b1d1d; }
a:visited { color: #4a1540; }
a:hover { color: #b33a00; }

.banner {
    background: linear-gradient(90deg, #3b0f14, #8b2e2e 55%, #a65c2a);
    border-bottom: 2px inset #1a0508;
    padding: 14px 12px;
    text-align: center;
}

.logo-lockup { display: inline-block; text-decoration: none; }
.logo-text {
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1;
}
.logo-bou { color: #f7e7c7; }
.logo-qin { color: #ffd27a; }

.navbar {
    background: #e8dcc8;
    border-bottom: 1px solid #7a6a55;
    padding: 4px 8px;
    text-align: center;
    font-size: 11px;
}
.navbar a { font-weight: bold; text-decoration: none; color: #3b0f14; }
.navbar a:hover { color: #b33a00; }
.navbar span { color: #8a7a66; margin: 0 4px; }

.site-main {
    flex: 1;
    padding: 8px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.site-main.single { max-width: 520px; }

.site-main.layout-biblio {
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.lib-layout {
    display: grid;
    grid-template-columns: 80% 20%;
    gap: 8px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    height: calc(100vh - 150px);
}
.col-left, .col-right {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.box-catalog,
.box-desc {
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.box-catalog .box-body,
.box-desc .box-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.table-wrap { overflow: visible; }

.badge-air {
    background: #2a4a2a !important;
    color: #ffd27a !important;
    margin-left: 4px;
}

.cover-wrap { text-align: center; margin-bottom: 8px; }
.cover-img {
    max-width: 160px;
    max-height: 240px;
    border: 2px inset #7a6a55;
    background: #fff;
}

.synopsis {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.45;
    max-height: none;
    overflow: visible;
    background: #fffdf6;
    border: 1px inset #7a6a55;
    padding: 6px;
}

.actions .btn-bevel { margin-bottom: 2px; }

.preview-frame {
    width: 100%;
    height: 75vh;
    border: 2px inset #7a6a55;
    background: #fff;
}
.epub-area {
    width: 100%;
    height: 70vh;
    border: 2px inset #7a6a55;
    background: #fffdf6;
}

.desc-titre {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    color: #3b0f14;
    margin: 0 0 8px;
    line-height: 1.25;
}

.meta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1px;
    background: #7a6a55;
    font-size: 10px;
}
.meta-table th {
    width: 72px;
    background: #3b0f14;
    color: #ffd27a;
    text-align: left;
    padding: 3px 5px;
    vertical-align: top;
}
.meta-table td {
    background: #fffdf6;
    padding: 3px 5px;
    vertical-align: top;
    word-break: break-word;
}

.books-table tr.book-row { cursor: pointer; }
.books-table tr.book-row.selected td {
    background: #ffd27a !important;
    outline: 1px solid #3b0f14;
}

.box {
    background: #e8dcc8;
    border: 2px outset #fff8ea;
    margin-bottom: 8px;
}
.box-title {
    background: linear-gradient(90deg, #3b0f14, #8b2e2e);
    color: #fff8ea;
    font-weight: bold;
    font-size: 11px;
    padding: 4px 7px;
    border-bottom: 1px solid #1a0508;
}
.box-body { padding: 8px; }
.box-body p { margin-bottom: 6px; }
.box-body p:last-child { margin-bottom: 0; }

.btn-bevel {
    display: inline-block;
    background: #e8dcc8;
    border: 2px outset #fff8ea;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: bold;
    color: #1a1008;
    text-decoration: none;
    cursor: pointer;
    margin-right: 4px;
    font-family: Tahoma, Verdana, Arial, sans-serif;
}
.btn-bevel:hover { color: #1a1008; }
.btn-bevel:active { border-style: inset; }
.btn-go { background: #ffe9b0; color: #3b0f14; }
.btn-ok { background: #cfe8cf; color: #1e4d1e; }
.btn-danger { background: #f0c8c8; color: #6b1d1d; }
.btn-dl {
    background: #2a4a2a;
    color: #f0e6c8 !important;
    border: 2px outset #4a7a4a;
}
.btn-dl:hover { color: #fff !important; }
.btn-dl:active { border-style: inset; }
.btn-sm { padding: 2px 6px; font-size: 10px; }

.books-table, .data-table {
    width: 100%;
    background: #7a6a55;
    font-size: 10px;
    border-collapse: separate;
    border-spacing: 1px;
}
.books-table th, .data-table th {
    background: #3b0f14;
    color: #ffd27a;
    font-weight: bold;
    text-align: left;
    padding: 3px 5px;
}
.books-table td, .data-table td {
    background: #fffdf6;
    padding: 3px 5px;
    vertical-align: middle;
}
.books-table tr.row-a td { background: #f3e6d0; }
.books-table tr.row-b td { background: #e7f0e0; }
.books-table tr:hover td, .data-table tr:hover td { background: #ffe9b0 !important; }

.badge {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #7a6a55;
    font-size: 9px;
    font-weight: bold;
    font-family: "Courier New", monospace;
    background: #1a1008;
    color: #cfe8cf;
}

.form-group { margin-bottom: 8px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 2px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 3px 4px;
    border: 2px inset #fff8ea;
    background: #fffdf6;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-size: 11px;
}

.alert {
    padding: 6px 8px;
    margin-bottom: 8px;
    border: 2px outset #fff8ea;
    font-weight: bold;
}
.alert-error { background: #f0c8c8; color: #6b1d1d; }
.alert-success { background: #cfe8cf; color: #1e4d1e; }

.auth-box { max-width: 420px; margin: 16px auto; }

.footer {
    background: #e8dcc8;
    border-top: 2px inset #7a6a55;
    padding: 6px 12px;
    font-size: 9px;
    color: #5a4a38;
}
.footer a { font-size: 9px; }
.footer table { width: 100%; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}
.stat-box {
    background: #e8dcc8;
    border: 2px outset #fff8ea;
    padding: 8px;
    text-align: center;
}
.stat-box .num {
    font-size: 18px;
    font-weight: bold;
    color: #3b0f14;
    font-family: Georgia, "Times New Roman", serif;
}
.stat-box .lbl {
    font-size: 9px;
    color: #5a4a38;
    font-weight: bold;
    margin-top: 2px;
}

.search-row {
    display: flex;
    gap: 6px;
    align-items: end;
    flex-wrap: wrap;
}
.search-row .form-group { flex: 1; min-width: 180px; margin-bottom: 0; }
.petit { font-size: 9px; color: #5a4a38; }
.code {
    font-family: "Courier New", monospace;
    font-size: 10px;
    background: #fffdf6;
    padding: 1px 3px;
    border: 1px inset #7a6a55;
}
.pre-box {
    background: #1a1008;
    color: #cfe8cf;
    font-family: "Courier New", monospace;
    font-size: 10px;
    padding: 8px;
    border: 2px inset #7a6a55;
    overflow: auto;
    max-height: 280px;
    white-space: pre-wrap;
}

@media (max-width: 700px) {
    .logo-text { font-size: 28px; }
    .search-row { flex-direction: column; align-items: stretch; }
    .lib-layout {
        grid-template-columns: 1fr;
        height: auto;
        flex: none;
    }
    .site-main.layout-biblio { overflow: auto; }
    .box-catalog .box-body { max-height: 55vh; }
    .box-desc .box-body { max-height: none; }
}
