:root {
  --navy: #1a365d;
  --teal: #2c5282;
  --ink: #2d3748;
  --muted: #718096;
  --line: #e2e8f0;
  --paper: #f7fafc;
  --bg: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font: 21px/1.6 "Times New Roman", Times, Georgia, serif;
  background: var(--bg);
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.mast {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}
.journal-logo { width: 64px; height: 64px; flex-shrink: 0; }
.journal-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  margin: 0;
  white-space: nowrap;
}
.journal-title a { color: inherit; text-decoration: none; }
.journal-title a:hover { text-decoration: none; }
.nav-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-account a {
  font-size: 15px;
  padding: 8px 10px;
}
.nav-account a + a::before {
  content: "|";
  color: #a0aec0;
  margin-right: 10px;
  font-weight: 400;
}
.nav-account i { margin-right: 5px; font-size: 13px; }

/* Nav */
nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.navrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  flex-wrap: wrap;
}
.navrow > a, .navrow summary {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  white-space: nowrap;
}
.navrow details { position: relative; }
.navrow summary { cursor: pointer; list-style: none; }
.navrow summary::-webkit-details-marker { display: none; }
.drop {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 6px 0;
  z-index: 10;
}
.drop a { display: block; padding: 8px 14px; color: var(--ink); font-size: 16px; }
.drop a:hover { background: var(--paper); text-decoration: none; }
.btn {
  background: var(--navy);
  color: white;
  border: 1px solid var(--navy);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 500;
  display: inline-block;
  text-decoration: none !important;
}
.btn:hover { background: #2a4365; color: white; }
.btn.secondary, .btn-outline {
  background: #fff;
  color: var(--navy);
  border-color: #cbd5e0;
}
.btn-outline:hover { background: var(--paper); color: var(--navy); }
.btn-sm { padding: 5px 12px; font-size: 14px; }
.btn-lg { padding: 12px 20px; font-size: 16px; }
.btn-danger { background: #c53030; border-color: #c53030; color: #fff; }
.btn-danger:hover { background: #9b2c2c; color: #fff; }
.w-100 { width: 100%; text-align: center; }
.navrow > .btn { margin-left: auto; }
.mobile { display: none; background: none; border: 1px solid var(--line); padding: 6px 12px; border-radius: 4px; }

/* Hero */
.hero { background: #f4f7f9; padding: 40px 0; }
.hero-inner { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: center; }
.hero h1 { font-size: 30px; font-weight: 600; color: var(--navy); margin: 0 0 12px; line-height: 1.25; }
.hero p { color: #5a6570; margin: 0 0 20px; font-size: 0.95em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cover { width: 280px; height: auto; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,0.08); display: block; margin-left: auto; margin-right: -8px; }

/* Content layout */
.content {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 40px 0;
}
h2 { font-size: 26px; font-weight: 600; color: var(--navy); margin: 0 0 16px; }
h3 { font-size: 20px; font-weight: 600; color: var(--navy); margin: 24px 0 10px; }
.intro { color: var(--muted); margin-top: 0; }
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.subject {
  display: block;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.subject strong { font-weight: 600; display: block; }
.subject span { display: block; font-size: 16px; color: var(--muted); margin-top: 2px; }
.aside-box { border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; background: white; }
.aside-box.submit { text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #cbd5e0; }
.aside-box.submit h3 { margin-bottom: 8px; }
.aside-box.submit p { font-size: 16px; margin: 0 0 14px; color: var(--muted); }
.aside-box h3 { margin-top: 0; font-size: 18px; }
.aside-box a { display: block; padding: 6px 0; font-size: 16px; border-top: 1px solid var(--line); }
.aside-box a:first-of-type { border-top: 0; }
.search { display: flex; gap: 8px; margin: 16px 0; }
.search input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 4px; }
.article-item { padding: 12px 0; border-top: 1px solid var(--line); }
.article-item a { font-weight: 600; color: var(--ink); }
.article-meta { font-size: 16px; color: var(--muted); margin-top: 4px; }
.empty { border: 1px dashed #cbd5e0; padding: 20px; color: var(--muted); font-size: 16px; }

/* Footer */
footer { background: var(--navy); color: #a0aec0; padding: 32px 0 16px; font-size: 16px; margin-top: 40px; }
.footgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand .journal-logo { width: 48px; height: 48px; }
footer h3 { color: white; font-size: 18px; margin: 0 0 6px; }
footer a { display: block; color: #cbd5e0; margin: 6px 0; }
.footbottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 24px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; }
.footbottom span { white-space: nowrap; }
.footbottom a { display: inline; color: #a0aec0; margin: 0; text-decoration: underline; }

/* Forms & tables */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 14px; font-weight: 500; }
.badge-info { background: #ebf8ff; color: #2b6cb0; }
.badge-warning { background: #fffaf0; color: #c05621; }
.badge-orange { background: #fff5eb; color: #c05621; }
.badge-success { background: #f0fff4; color: #276749; }
.badge-danger { background: #fff5f5; color: #c53030; }
.badge-primary { background: #ebf8ff; color: #2b6cb0; }
.badge-secondary { background: #edf2f7; color: #4a5568; }
.form-box {
  max-width: 420px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 24px;
}
.form-box h2 { margin-top: 0; text-align: center; }
.form-box .form-group { margin-bottom: 12px; }
.form-box label { font-size: 15px; }
.form-box input, .form-box select, .form-box textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 15px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 12px; }
.profile-form { max-width: 780px; margin: 0; }
.profile-form h3 { text-align: left; margin: 4px 0 12px; font-size: 18px; }
.profile-form .btn { width: auto; min-width: 150px; }
.static-field {
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  color: var(--ink);
}
.form-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.required { color: #c53030; }
.form-note { text-align: center; font-size: 14px; color: var(--muted); margin-top: 12px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 16px; }
th { background: var(--paper); font-weight: 500; }

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--navy);
  color: white;
  flex-shrink: 0;
  padding: 16px 0;
}
.admin-sidebar .brand { padding: 0 16px 16px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px; }
.admin-sidebar ul { list-style: none; margin: 0; padding: 0; }
.admin-sidebar a { color: #cbd5e0; display: block; padding: 8px 16px; font-size: 16px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); text-decoration: none; color: white; }
.admin-sidebar .nav-section { padding: 12px 16px 4px; font-size: 13px; text-transform: uppercase; color: #718096; letter-spacing: 0.5px; }
.admin-main { flex: 1; padding: 0 24px 24px; background: var(--paper); min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  margin: 0 -24px 20px;
  padding-left: 24px;
  padding-right: 24px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.admin-topbar h1 { margin: 0; font-size: 20px; color: var(--navy); font-weight: 600; }
.admin-top-meta { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.admin-top-meta span { font-size: 14px; color: var(--muted); white-space: nowrap; }
.page-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.page-card h3 { margin: 0 0 14px; color: var(--navy); font-size: 17px; }
.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 15px;
  background: white;
  color: var(--ink);
}
.form-control:focus { outline: 2px solid rgba(26,54,93,0.2); border-color: var(--navy); }
.form-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; font-size: 15px; }
.alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.alert-error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.data-table th { background: var(--paper); font-weight: 600; color: var(--navy); }
.data-table tr:hover td { background: #fafbfc; }
.table-wrapper { background: white; border: 1px solid var(--line); overflow-x: auto; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.admin-card { background: white; padding: 14px; border-left: 3px solid var(--navy); }
.admin-card h3 { margin: 0; font-size: 24px; color: var(--navy); }
.admin-card p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.admin-toggle { display: none; background: none; border: 1px solid var(--line); padding: 6px 12px; border-radius: 4px; margin-bottom: 12px; }

/* Page content */
.page-content { padding: 32px 0; }
.page-content .wrap { max-width: 720px; }

/* Responsive */
@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; gap: 24px; }
  .hero-inner { grid-template-columns: 1fr; }
  .cover { width: 220px; margin: 0 auto; }
  .footgrid { grid-template-columns: 1fr 1fr; }
  .footgrid > div:first-child { grid-column: 1 / -1; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 8px 0; }
  .admin-sidebar ul { display: none; }
  .admin-sidebar.open ul { display: block; }
  .admin-toggle { display: inline-block; }
  .admin-main { padding: 0 16px 16px; }
  .admin-topbar { margin: 0 -16px 16px; padding-left: 16px; padding-right: 16px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .journal-title { font-size: 16px; white-space: normal; }
  .hero h1 { font-size: 22px; }
  .navrow { display: none; flex-direction: column; align-items: stretch; padding: 8px 0; }
  .navrow.show { display: flex; }
  .nav-account { margin-left: 0; flex-direction: column; align-items: stretch; }
  .drop { position: static; box-shadow: none; border: 0; padding-left: 12px; }
  .mobile { display: inline-block; margin: 8px 0; }
  .footbottom { flex-direction: row; flex-wrap: nowrap; gap: 8px; }
  .subjects { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .admin-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .admin-cards { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}
