* { box-sizing: border-box; }
:root {
    --bg: #f3f6fa;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #64748b;
    --line: #d8e0ec;
    --accent: #1d4ed8;
    --accent-dark: #173eab;
    --danger: #b91c1c;
    --success-bg: #e8f8ee;
    --success-ink: #176534;
    --error-bg: #fdecec;
    --error-ink: #9f1239;
}
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1500px, calc(100% - 28px)); margin: 0 auto; }
.narrow { width: min(780px, calc(100% - 28px)); }
.top { background: #0f1d35; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.16); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 18px; }
.brand-wrap { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo img { display: block; height: 40px; width: auto; }
.brand { color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.top nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top nav a { color: #dbeafe; font-weight: 600; }
.top .user { color: #bfdbfe; border-left: 1px solid rgba(255,255,255,.25); padding-left: 12px; }

.lang-switch { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 6px; background: #f4f6f9; border: 1px solid #d7dee8; border-radius: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; min-height: 38px; padding: 0 16px; color: #1f2937; background: transparent; border: 1px solid #cfd8e3; border-radius: 999px; font-size: 18px; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.lang-switch a:hover { background: #eef2f7; text-decoration: none; }
.lang-switch a.active { background: #0b1220; color: #ffffff; border-color: #0b1220; box-shadow: 0 2px 6px rgba(11,18,32,.28); }
.contact-line { padding: 0 0 13px; color: #dbeafe; font-size: 14px; font-weight: 650; }
.contact-line a { color: #ffffff; font-weight: 800; }
.header-actions { padding: 0 0 14px; }
.online-resources-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: #ffffff;
    color: #0f1d35;
    font-weight: 800;
    padding: 9px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.online-resources-button:hover {
    background: #dbeafe;
    color: #0f1d35;
    text-decoration: none;
}

.header-books { padding: 0 0 18px; }
.header-books-title { color: #dbeafe; font-size: 13px; font-weight: 700; margin: 4px 0 10px; text-transform: uppercase; letter-spacing: .04em; }
.header-books-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.book-card { display: flex; flex-direction: column; gap: 8px; color: #fff; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.book-card:hover { text-decoration: none; transform: translateY(-2px); background: rgba(255,255,255,.08); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.book-card img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,.22); }
.book-card span { color: #ffffff; font-size: 13px; font-weight: 700; line-height: 1.3; }
main.container { padding: 24px 0 18px; }
h1 { font-size: 28px; margin: 0 0 18px; }
h2 { font-size: 21px; margin: 28px 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(10,20,40,.04); }
.filters { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; color: #334155; font-weight: 650; font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 9px 10px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #60a5fa; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 750; padding: 9px 14px; cursor: pointer; font: inherit; }
button:hover, .button:hover { background: var(--accent-dark); text-decoration: none; }
.secondary { background: #e2e8f0; color: #1e293b; }
.secondary:hover { background: #cbd5e1; }
.small { padding: 5px 9px; border-radius: 7px; font-size: 13px; font-weight: 700; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #7f1d1d; }
.danger-box { margin: 18px 0 30px; text-align: right; }
.alert { border-radius: 12px; padding: 12px 14px; margin: 16px 0; border: 1px solid transparent; }
.success { background: var(--success-bg); color: var(--success-ink); border-color: #bbf7d0; }
.error { background: var(--error-bg); color: var(--error-ink); border-color: #fecdd3; }
.warning { color: #a16207; }
.summary { margin: 10px 0 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(10,20,40,.04); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { position: sticky; top: 0; background: #e8eef7; color: #172033; text-align: left; font-weight: 800; padding: 10px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 9px; border-bottom: 1px solid #edf2f7; vertical-align: top; }
.data tr:hover td { background: #f8fbff; }
.num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.side { font-weight: 800; }
.notes { min-width: 240px; max-width: 460px; }
.edit-col { white-space: nowrap; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 26px !important; }
.filter-actions, .actions { display: flex; align-items: center; gap: 8px; }
.pagination { display: flex; gap: 8px; margin: 16px 0 6px; }
.footer { color: var(--muted); font-size: 13px; padding: 12px 0 28px; }
@media (max-width: 1050px) { .filters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .header-books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    .top-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
    .brand-wrap { width: 100%; flex-wrap: wrap; gap: 10px; }
    .brand-logo img { height: 34px; }
    .lang-switch { margin-left: 0; }
    .header-books-grid { grid-template-columns: 1fr; }
    .filters, .form-grid { grid-template-columns: 1fr; }
    h1 { font-size: 24px; }
}
