/* =================== Reset & Base =================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #6b3a1f;
  --brand-light:  #a0522d;
  --brand-dark:   #4a2510;
  --gold:         #c8902a;
  --bg:           #faf8f4;
  --surface:      #ffffff;
  --border:       #e2d9cc;
  --text:         #2c1a0e;
  --muted:        #7a6555;
  --mark-bg:      #fff3cd;
  --mark-fg:      #7a4800;
  --green:        #1e7e4a;
  --green-bg:     #eaf7ef;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,.12);
  --radius:       10px;
  --nav-h:        58px;
}

body {
  font-family: 'Amiri', 'Segoe UI', 'Cairo', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Classic Arabic font on content elements ── */
.result-word, #modal-word, #modal-definition,
.result-snip, .book-title, .hero-title,
.dropdown-title, .nav-brand-text {
  font-family: 'Amiri', serif;
}

/* =================== Navbar =================== */
.navbar {
  background: var(--brand-dark);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.2rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.nav-brand-icon { font-size: 1.35rem; line-height: 1; }
.nav-brand-text  { font-size: 1.1rem; font-weight: 700; letter-spacing: .01em; }

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: .15rem;
  margin-right: auto;   /* push to left edge (RTL: right edge) */
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .3rem;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .45rem .85rem;
  border-radius: 7px;
  font-size: .9rem;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; }

/* Dropdown */
.nav-dropdown { position: relative; }
.chevron { transition: transform .2s; flex-shrink: 0; }
.nav-dropdown-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;          /* RTL: open from right */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  min-width: 220px;
  overflow: hidden;
  z-index: 300;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .7rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
  border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover,
.dropdown-item.active { background: var(--bg); }
.dropdown-title  { font-size: .9rem; font-weight: 600; color: var(--brand); }
.dropdown-author { font-size: .76rem; color: var(--muted); }

/* Hamburger (mobile only) */
/* Nav user / logout */
.nav-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-right: .5rem;
  flex-shrink: 0;
}
.nav-username {
  color: rgba(255,255,255,.7);
  font-size: .82rem;
}
.nav-logout-btn {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .82rem;
  padding: .3rem .7rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  transition: background .15s;
}
.nav-logout-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-mobile-logout {
  color: rgba(255,255,255,.6) !important;
  font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: .3rem;
  padding-top: .8rem;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  margin-right: auto;  /* RTL: push to left */
  border-radius: 6px;
  transition: background .15s;
}
.nav-hamburger:hover { background: rgba(255,255,255,.12); }
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--brand-dark);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .5rem 0 1rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile-link {
  padding: .7rem 1.4rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .95rem;
  transition: background .12s;
}
.nav-mobile-link:hover,
.nav-mobile-link.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-mobile-sub { padding-right: 2.4rem; font-size: .88rem; }
.nav-mobile-section {
  padding: .6rem 1.4rem .3rem;
  font-size: .76rem;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* =================== Hero strip =================== */
.hero-strip {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  padding: 1.8rem 1.5rem;
}
.hero-strip--book { padding: 1.4rem 1.5rem; }
.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero-title { font-size: 1.55rem; font-weight: 700; margin-bottom: .2rem; }
.hero-strip--book .hero-title { font-size: 1.35rem; }
.hero-sub { font-size: .9rem; opacity: .82; }
.hero-count {
  background: rgba(255,255,255,.2);
  border-radius: 20px;
  padding: .3rem 1rem;
  font-size: .85rem;
  white-space: nowrap;
}

/* =================== Main layout =================== */
.main-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* =================== Book abstract =================== */
.book-abstract {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.book-abstract summary {
  font-weight: 600; color: var(--brand); cursor: pointer; font-size: .95rem;
}
.book-abstract p { margin-top: .8rem; font-size: .9rem; color: var(--muted); line-height: 1.8; }

/* =================== Books grid =================== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .12s;
}
.book-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 18px rgba(107,58,31,.14);
  transform: translateY(-2px);
}
.book-icon { font-size: 2rem; flex-shrink: 0; }
.book-info { min-width: 0; }
.book-title  { font-size: 1rem; font-weight: 700; color: var(--brand); margin-bottom: .2rem; }
.book-author { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.book-count  { font-size: .8rem; color: var(--gold); font-weight: 600; }
.book-cat    {
  font-size: .76rem; color: var(--muted); margin-top: .25rem;
  background: var(--bg); border-radius: 10px; padding: .1rem .5rem;
  display: inline-block; border: 1px solid var(--border);
}

/* =================== Search =================== */
.search-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.6rem;
  margin-top: 1.8rem;
}
.search-box { display: flex; gap: .5rem; margin-bottom: .9rem; }
#search-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  direction: rtl;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s;
  outline: none;
}
#search-input:focus { border-color: var(--brand-light); background: #fff; }
#search-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .2s;
}
#search-btn:hover { background: var(--brand-light); }

.filter-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .88rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.filter-row select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .32rem .65rem;
  font-family: inherit;
  font-size: .88rem;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  max-width: 210px;
}
.filter-row select:focus { outline: 2px solid var(--brand-light); }

/* =================== Welcome =================== */
.welcome-msg { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.welcome-msg p { margin-bottom: .4rem; font-size: 1rem; }

/* =================== Results =================== */
.results-header {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.results-header strong { color: var(--brand); }
.results-legend {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: .78rem;
}
.legend-item { display: flex; align-items: center; gap: .3rem; }

.result-list { list-style: none; display: flex; flex-direction: column; gap: .65rem; }

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.2rem;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .12s;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid transparent;
}
.result-card:hover {
  box-shadow: 0 4px 14px rgba(107,58,31,.13);
  transform: translateY(-1px);
}
.result-card.match-headword {
  border-right-color: var(--green);
}
.result-card.match-definition {
  border-right-color: var(--gold);
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
  flex-wrap: wrap;
}
.result-word { font-size: 1.15rem; font-weight: 700; color: var(--brand); }

.result-badges { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; }

/* Match type badge */
.match-badge {
  font-size: .7rem;
  padding: .15rem .55rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.match-badge--headword {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #b2dfca;
}
.match-badge--definition {
  background: var(--mark-bg);
  color: var(--mark-fg);
  border: 1px solid #f0d98a;
}

/* Book badge */
.result-book-badge {
  font-size: .72rem;
  background: var(--brand);
  color: #fff;
  padding: .15rem .55rem;
  border-radius: 10px;
  white-space: nowrap;
}
.result-meta { font-size: .76rem; color: var(--muted); margin-bottom: .4rem; }
.result-snip {
  font-size: .9rem;
  color: #4a3322;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-snip mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: .05em .2em;
  border-radius: 3px;
  font-weight: 600;
}

/* =================== Pagination =================== */
#pagination {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}
.page-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: .38rem .85rem;
  font-family: inherit;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  min-width: 2.4rem;
}
.page-btn:hover { background: var(--bg); border-color: var(--brand-light); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); pointer-events: none; }
.page-btn:disabled { opacity: .35; pointer-events: none; }

/* =================== No results =================== */
.no-results { text-align: center; padding: 2.5rem; color: var(--muted); }

/* =================== Loading =================== */
.loading {
  display: flex; justify-content: center; align-items: center;
  gap: .6rem; padding: 2rem; color: var(--muted);
}
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== Modal =================== */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
#modal-overlay.hidden { display: none; }
#modal {
  background: var(--surface);
  border-radius: 14px;
  max-width: 700px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.8rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: .5rem;
}
.modal-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.modal-book-badge {
  font-size: .75rem;
  background: var(--brand);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: 12px;
}
#modal-breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  background: var(--bg);
  padding: .2rem .6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.modal-close {
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  color: var(--muted); padding: .2rem .4rem;
  border-radius: 4px; transition: color .15s; flex-shrink: 0;
}
.modal-close:hover { color: var(--brand); }
#modal-word {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--border);
}
#modal-definition {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
}
.modal-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  gap: .5rem;
}
.modal-nav button {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .45rem .9rem;
  font-family: inherit;
  font-size: .88rem;
  cursor: pointer;
  color: var(--brand);
  transition: background .15s;
}
.modal-nav button:hover { background: var(--border); }
.modal-nav button:disabled { opacity: .35; pointer-events: none; }

/* =================== Modal definition — highlight & lists =================== */
#modal-definition {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text);
  white-space: normal;   /* override pre-wrap so lists render */
}
#modal-definition mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: .05em .25em;
  border-radius: 3px;
  font-weight: 700;
}
#modal-definition ul {
  list-style: disc;
  padding-right: 1.6rem;
  margin: .6rem 0;
}
#modal-definition ul li {
  margin-bottom: .3rem;
  line-height: 1.8;
}

/* =================== Flash messages =================== */
.flash-container {
  position: fixed;
  top: calc(var(--nav-h) + .6rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 280px;
  max-width: 500px;
}
.flash {
  padding: .7rem 1.2rem;
  border-radius: 8px;
  font-size: .9rem;
  box-shadow: var(--shadow-md);
  animation: fadeIn .25s ease;
}
.flash--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* =================== Login page =================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem 2.2rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: .5rem; }
.login-title {
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  color: var(--brand);
  margin-bottom: .2rem;
}
.login-sub { font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }
.login-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: .55rem .9rem;
  font-size: .87rem;
  margin-bottom: 1rem;
}
.login-form { text-align: right; }
.login-label {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .25rem;
  font-weight: 600;
}
.login-input {
  display: block;
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: .62rem .9rem;
  font-size: .95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
  transition: border-color .2s;
  outline: none;
}
.login-input:focus { border-color: var(--brand-light); background: #fff; }
.login-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .75rem;
  font-size: 1rem;
  font-family: 'Amiri', serif;
  cursor: pointer;
  margin-top: .4rem;
  transition: background .2s;
  letter-spacing: .02em;
}
.login-btn:hover { background: var(--brand-light); }

/* =================== Admin panel =================== */
.admin-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.admin-header { margin-bottom: 1.8rem; }
.admin-title {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  color: var(--brand);
}
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.admin-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.admin-section-icon { font-size: 1.2rem; }
.admin-subsection-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .8rem;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.admin-table th {
  background: var(--bg);
  text-align: right;
  padding: .65rem .9rem;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-disabled td { opacity: .55; }
.admin-book-id { font-size: .72rem; color: var(--muted); display: block; margin-top: .15rem; }

/* Status badges */
.status-badge {
  font-size: .72rem;
  padding: .15rem .6rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.status-on    { background: var(--green-bg); color: var(--green); border: 1px solid #b2dfca; }
.status-off   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-admin { background: #e8e0f4; color: #5c3d9e; border: 1px solid #c9b8e8; }
.status-user  { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-you    { font-size: .72rem; color: var(--muted); }

/* Admin action buttons */
.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.admin-btn {
  font-size: .78rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s, filter .15s;
  white-space: nowrap;
}
.admin-btn:hover { filter: brightness(.9); }
.btn-enable  { background: var(--green-bg); color: var(--green); border-color: #b2dfca; }
.btn-disable { background: #fff3cd; color: #856404; border-color: #ffc107; }
.btn-delete  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.btn-add     { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-secondary { background: var(--bg); color: var(--muted); border-color: var(--border); }

/* Add user form */
.admin-add-user {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
}
.admin-user-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.admin-input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .4rem .75rem;
  font-family: inherit;
  font-size: .88rem;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.admin-input:focus { border-color: var(--brand-light); }
.admin-input-sm { width: 160px; }
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.reset-form {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-top: .4rem;
  flex-wrap: wrap;
}

/* =================== Utilities =================== */
.hidden { display: none !important; }

/* =================== Responsive =================== */
@media (max-width: 800px) {
  .nav-links    { display: none; }
  .nav-hamburger{ display: flex; }
  .nav-user     { display: none; }
  .hero-title   { font-size: 1.25rem; }
  .main-content { padding: 1rem 1rem 3rem; }
  .books-grid   { grid-template-columns: 1fr 1fr; }
  #modal { padding: 1.2rem; }
  #modal-word   { font-size: 1.35rem; }
  .admin-wrap   { padding: 1rem 1rem 3rem; }
  .admin-section { padding: 1rem 1rem; }
}
@media (max-width: 480px) {
  .nav-brand-text { display: none; }
  .books-grid     { grid-template-columns: 1fr; }
  .hero-strip     { padding: 1.2rem 1rem; }
  .result-top     { flex-direction: column; align-items: flex-start; }
  .login-card     { padding: 2rem 1.3rem; margin: 1rem; }
  .admin-user-form { flex-direction: column; align-items: stretch; }
}
