/* =============================================
   RATU SAMUDRA - Admin Stylesheet
   ============================================= */

:root {
  --navy:      #0B4F8A;
  --navy-dark: #072a4e;
  --gold:      #C9A227;
  --gold-dark: #a07d1a;
  --sidebar-w: 260px;
  --topbar-h:  64px;
  --white:     #ffffff;
  --gray-100:  #f4f7fb;
  --gray-200:  #e8edf5;
  --gray-300:  #d0d9e8;
  --gray-500:  #8095b5;
  --gray-700:  #4a5a7a;
  --text:      #1a2a4a;
  --text-light:#5a6a8a;
  --radius:    10px;
  --radius-sm: 7px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.1);
  --transition:.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Source Sans Pro', sans-serif; color: var(--text); background: var(--gray-100); line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--navy); text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-body { background: var(--navy-dark); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--white); border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; z-index: 1; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { margin: 0 auto 1rem; }
.auth-header h1 { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--navy); }
.auth-header p { font-size: .88rem; color: var(--text-light); }
.auth-form .form-group { margin-bottom: 1.2rem; }
.auth-form label { display: flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-control { width: 100%; padding: .7rem 1rem; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .95rem; font-family: inherit; color: var(--text); background: var(--white); transition: border-color var(--transition); outline: none; }
.form-control:focus { border-color: var(--navy); }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 3rem; }
.toggle-pass { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--gray-500); font-size: .95rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; }
.auth-back { font-size: .88rem; color: var(--text-light); display: inline-flex; align-items: center; gap: .4rem; }
.auth-back:hover { color: var(--navy); }

/* Flash */
.admin-flash { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.2rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1.2rem; position: relative; }
.admin-flash--success { background: #e8f8f0; color: #1a7a40; border-left: 4px solid #2ecc71; }
.admin-flash--error   { background: #fdecea; color: #922b21; border-left: 4px solid #e74c3c; }
.flash-x { margin-left: auto; background: none; border: none; cursor: pointer; opacity: .6; font-size: .9rem; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-body { display: flex; min-height: 100vh; background: var(--gray-100); }

/* SIDEBAR */
.admin-sidebar { width: var(--sidebar-w); background: var(--navy-dark); position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 500; display: flex; flex-direction: column; transition: transform .3s ease; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.2rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo { display: flex; align-items: center; gap: .6rem; color: white; font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; }
.sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,.6); font-size: 1.1rem; cursor: pointer; }
.sidebar-admin-info { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-avatar i { font-size: 2.2rem; color: rgba(255,255,255,.4); }
.admin-name { font-size: .9rem; font-weight: 700; color: white; line-height: 1.2; }
.admin-role { font-size: .75rem; color: var(--gold-light, #e8c547); text-transform: capitalize; }
.sidebar-nav { padding: .8rem 0 2rem; flex: 1; }
.nav-section { margin-bottom: 1.2rem; }
.nav-label { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.35); padding: .4rem 1.2rem; margin-bottom: .3rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.2rem; color: rgba(255,255,255,.7); font-size: .9rem; font-weight: 600; transition: all var(--transition); position: relative; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(255,255,255,.1); border-left: 3px solid var(--gold); }
.nav-item i { width: 18px; text-align: center; font-size: .95rem; }
.nav-logout { color: #e74c3c !important; margin-top: .5rem; }
.badge-count { background: #e74c3c; color: white; font-size: .7rem; padding: .1rem .4rem; border-radius: 10px; margin-left: auto; }

/* MAIN */
.admin-main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* TOPBAR */
.admin-topbar { height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); gap: 1rem; }
.topbar-toggle { background: none; border: none; font-size: 1.1rem; color: var(--navy); cursor: pointer; display: none; padding: .4rem; border-radius: var(--radius-sm); }
.topbar-toggle:hover { background: var(--gray-100); }
.topbar-breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text-light); flex: 1; }
.topbar-breadcrumb a { color: var(--navy); }
.topbar-breadcrumb .current { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.topbar-icon { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; color: var(--navy); font-size: .9rem; transition: all var(--transition); }
.topbar-icon:hover { background: var(--navy); color: white; }
.dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; background: #e74c3c; border-radius: 50%; border: 2px solid white; }

.admin-content { padding: 1.5rem; flex: 1; }

/* SIDEBAR OVERLAY */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 400; }

/* ============================================================
   ADMIN COMPONENTS
   ============================================================ */
.admin-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.admin-page-header h1 { font-size: 1.5rem; color: var(--navy-dark); font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.admin-page-header h1 i { color: var(--gold); }
.admin-page-header p { font-size: .88rem; color: var(--text-light); margin-top: .2rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { border-radius: var(--radius); padding: 1.4rem; display: flex; align-items: center; gap: 1rem; color: white; box-shadow: var(--shadow-sm); }
.stat-card--navy   { background: linear-gradient(135deg, var(--navy), var(--navy-dark)); }
.stat-card--gold   { background: linear-gradient(135deg, #b8901e, #d4a82a); }
.stat-card--teal   { background: linear-gradient(135deg, #0e7c61, #0a5c47); }
.stat-card--purple { background: linear-gradient(135deg, #6c3d8f, #4a2063); }
.stat-card--red    { background: linear-gradient(135deg, #c0392b, #8e1a14); }
.stat-icon { font-size: 1.8rem; opacity: .75; }
.stat-number { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; opacity: .8; }

/* Dashboard Row */
.dashboard-row { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; }
.dashboard-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); overflow: hidden; }
.dashboard-card--wide {}
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--gray-200); }
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--navy-dark); display: flex; align-items: center; gap: .5rem; }
.card-header h3 i { color: var(--gold); }
.card-header-link { font-size: .85rem; color: var(--navy); font-weight: 600; }
.card-body { padding: 1.2rem; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: 1rem; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .5rem; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--navy); text-align: center; font-size: .8rem; font-weight: 600; transition: all var(--transition); border: 1px solid var(--gray-200); }
.quick-action-btn i { font-size: 1.2rem; }
.quick-action-btn:hover { background: var(--navy); color: white; border-color: var(--navy); }

/* Admin Card */
.admin-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); margin-bottom: 1.5rem; overflow: hidden; }
.admin-card .card-header { background: none; }
.admin-card .card-body { padding: 1.5rem; }

/* Toolbar */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; flex-wrap: wrap; }
.search-bar { display: flex; background: var(--white); border: 2px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; transition: border-color var(--transition); }
.search-bar:focus-within { border-color: var(--navy); }
.search-bar input { border: none; padding: .5rem 1rem; font-size: .9rem; flex: 1; outline: none; font-family: inherit; }
.search-bar button { background: var(--navy); border: none; color: white; padding: .5rem 1rem; cursor: pointer; }

/* Table */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table thead tr { background: var(--gray-100); border-bottom: 2px solid var(--gray-200); }
.admin-table th { padding: .8rem 1rem; text-align: left; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-700); white-space: nowrap; }
.admin-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:hover td { background: var(--gray-100); }
.admin-table .empty-row { text-align: center; color: var(--text-light); padding: 3rem; }
.admin-table .empty-row i { margin-right: .5rem; }

.table-book { display: flex; align-items: center; gap: .75rem; }
.table-book img { width: 36px; height: 50px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.table-book-placeholder { width: 36px; height: 50px; background: var(--gray-200); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--gray-500); flex-shrink: 0; }
.table-book-title { font-weight: 700; color: var(--navy-dark); font-size: .9rem; }
.table-book-author { font-size: .8rem; color: var(--text-light); }

.status-badge { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 4px; display: inline-block; }
.status-active   { background: #e8f8f0; color: #1a7a40; }
.status-inactive { background: #fdecea; color: #922b21; }
.status-featured { background: #fff3cd; color: #a07d1a; }
.status-new      { background: #e3f2fd; color: #0d47a1; }
.badge-group { display: flex; flex-direction: column; gap: .25rem; }
.text-success { color: #27ae60; font-weight: 600; }
.text-danger  { color: #e74c3c; font-weight: 600; }

.action-btns { display: flex; gap: .35rem; }
.btn-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: .85rem; cursor: pointer; border: 1px solid; transition: all var(--transition); }
.btn-view   { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.btn-view:hover   { background: #1565c0; color: white; }
.btn-edit   { background: #fff8e1; color: #e65100; border-color: #ffcc80; }
.btn-edit:hover   { background: #e65100; color: white; }
.btn-delete { background: #fdecea; color: #c62828; border-color: #ef9a9a; }
.btn-delete:hover { background: #c62828; color: white; }
.btn-xs { width: 24px; height: 24px; font-size: .75rem; }

/* Admin Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); text-decoration: none; font-family: inherit; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-navy { background: var(--navy); color: white; border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-dark); color: white; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--gray-300); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.w-full { width: 100%; justify-content: center; }
.mt-2 { margin-top: .5rem; }
.d-inline { display: inline; }

/* ============================================================
   BOOK FORM
   ============================================================ */
.form-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 1.5rem; }
.form-side { display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 80px; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-label.required::after { content: ' *'; color: #e74c3c; }
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--text-light); display: block; margin-top: .3rem; }

/* Cover Upload */
.cover-upload-area { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 1.5rem; text-align: center; cursor: pointer; transition: border-color var(--transition); }
.cover-upload-area:hover { border-color: var(--navy); }
.cover-placeholder i { font-size: 2.5rem; color: var(--gray-300); margin-bottom: .5rem; display: block; }
.cover-placeholder span { font-size: .9rem; font-weight: 600; color: var(--text-light); display: block; margin-bottom: .3rem; }
.cover-placeholder small { font-size: .78rem; color: var(--gray-500); }
.cover-preview { max-height: 220px; margin: 0 auto; border-radius: var(--radius-sm); object-fit: contain; }
.file-input { display: none; }

/* Author Checkboxes */
.author-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; max-height: 200px; overflow-y: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .75rem; }
.checkbox-item { display: flex; flex-direction: column; gap: .1rem; padding: .4rem .6rem; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; transition: all var(--transition); }
.checkbox-item:hover { border-color: var(--navy); background: var(--gray-100); }
.checkbox-item input { margin-bottom: .3rem; accent-color: var(--navy); }
.checkbox-item span { font-size: .85rem; font-weight: 600; color: var(--text); }
.checkbox-item small { font-size: .75rem; color: var(--text-light); }

/* Toggle */
.toggle-group { display: flex; flex-direction: column; gap: .8rem; }
.toggle-item { display: flex; align-items: center; gap: .8rem; cursor: pointer; }
.toggle-item input { display: none; }
.toggle-switch { width: 40px; height: 22px; background: var(--gray-300); border-radius: 11px; position: relative; flex-shrink: 0; transition: background var(--transition); }
.toggle-switch::after { content: ''; position: absolute; width: 16px; height: 16px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-item input:checked + .toggle-switch { background: var(--navy); }
.toggle-item input:checked + .toggle-switch::after { transform: translateX(18px); }
.toggle-label { font-size: .88rem; font-weight: 600; color: var(--text); }

.form-submit-wrap { display: flex; flex-direction: column; gap: .75rem; }

/* ============================================================
   MODAL
   ============================================================ */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.open { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-content { position: relative; background: white; border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: fadeDown .2s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy-dark); }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--text-light); cursor: pointer; padding: .3rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; }

/* ============================================================
   MESSAGES
   ============================================================ */
.messages-list { padding: .5rem; }
.message-item { display: flex; gap: 1rem; padding: 1.2rem; border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
.message-item:hover { background: var(--gray-100); }
.message-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.message-body { flex: 1; }
.message-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .3rem; flex-wrap: wrap; gap: .5rem; }
.message-from { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.message-from strong { color: var(--navy-dark); font-size: .95rem; }
.message-email, .message-from span { font-size: .82rem; color: var(--text-light); }
.message-meta { display: flex; align-items: center; gap: .75rem; }
.message-time { font-size: .8rem; color: var(--text-light); }
.message-subject { font-size: .82rem; font-weight: 600; color: var(--gold-dark); display: flex; align-items: center; gap: .35rem; margin-bottom: .4rem; }
.message-content { font-size: .9rem; color: var(--text); line-height: 1.7; white-space: pre-wrap; margin-bottom: .75rem; }
.message-reply { display: flex; gap: .5rem; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-submit-footer { text-align: right; padding: 1rem 0; }

/* ============================================================
   RESPONSIVE ADMIN
   ============================================================ */
@media (max-width: 1024px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-side { position: static; }
  .dashboard-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .topbar-toggle { display: flex; }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .author-checkboxes { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
}

/* PAGINATION (admin) */
.pagination { display: flex; justify-content: center; padding: 1.2rem; }
.pagination ul { display: flex; gap: .35rem; list-style: none; }
.page-link { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 7px; background: var(--gray-100); color: var(--text); font-weight: 600; font-size: .88rem; border: 1px solid var(--gray-200); transition: all var(--transition); }
.page-item.active .page-link { background: var(--navy); color: white; border-color: var(--navy); }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-light); }
.empty-state i { font-size: 3rem; color: var(--gray-300); display: block; margin-bottom: 1rem; }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

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

/* ============================================================
   AUTHOR TAGGER — search + tag/chip UI
   ============================================================ */
.author-tagger {
  position: relative;
}
.author-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  min-height: 46px;
  padding: .4rem .6rem;
  border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  cursor: text;
  transition: border-color .2s;
}
.author-tags:focus-within {
  border-color: var(--navy, #0B4F8A);
  box-shadow: 0 0 0 3px rgba(11,79,138,.1);
}
.author-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--navy, #0B4F8A);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .55rem .25rem .65rem;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: tagIn .15s ease;
}
@keyframes tagIn {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
.author-tag-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.author-tag-remove:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.author-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: .88rem;
  min-width: 160px;
  flex: 1;
  padding: .2rem .2rem;
  color: var(--text, #1f2937);
}
.author-search-input::placeholder { color: var(--gray-400, #9ca3af); }

/* Dropdown suggestions */
.author-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--navy, #0B4F8A);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 220px;
  overflow-y: auto;
  z-index: 500;
  list-style: none;
  padding: .3rem 0;
  margin: 0;
}
.author-suggestions.show { display: block; }
.author-suggestions li {
  padding: .55rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  transition: background .12s;
}
.author-suggestions li:hover,
.author-suggestions li.active {
  background: #f0f5fb;
}
.author-suggestions li.already-added {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}
.author-suggestions li .sug-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text, #1f2937);
}
.author-suggestions li .sug-name mark {
  background: transparent;
  color: var(--navy, #0B4F8A);
  font-weight: 700;
}
.author-suggestions li .sug-inst {
  font-size: .75rem;
  color: var(--text-light, #6b7280);
}
.author-suggestions li.no-result {
  color: var(--text-light, #6b7280);
  font-size: .85rem;
  pointer-events: none;
}
/* Remove old checkbox grid */
.author-checkboxes { display: none !important; }

/* ============================================================
   REPLY MESSAGE FORM
   ============================================================ */
.message-reply-wrap { margin-top: .85rem; }
.reply-form-box {
  margin-top: .85rem;
  background: #f0f5fb;
  border: 1.5px solid #c7daf0;
  border-radius: var(--radius-sm, 8px);
  padding: 1rem 1.1rem;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.reply-to-info {
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid #d1e4f6;
}
.reply-to-info strong { color: var(--navy); }
.reply-textarea {
  resize: vertical;
  min-height: 110px;
  font-size: .88rem;
  margin-bottom: .75rem;
}
.reply-actions { display: flex; gap: .6rem; }
