/* =========================================================================
   Journal Publishing Platform - styles
   Minimal, scientific / medical look.
   ========================================================================= */

:root {
  --navy:       #1e3a5f;
  --navy-dark:  #15294a;
  --steel:      #5a7196;
  --accent:     #4a90c2;
  --accent-soft:#e6f0f7;
  --ink:        #1d2733;
  --muted:      #6b7785;
  --line:       #dfe5ec;
  --line-soft:  #eef1f5;
  --bg:         #f7f9fb;
  --white:      #ffffff;
  --ok:         #2e7d5b;
  --ok-bg:      #e7f4ee;
  --err:        #b3261e;
  --err-bg:     #fbe9e8;
  --warn:       #8a6300;
  --warn-bg:    #fcf3da;
  --radius:     6px;
  --shadow-sm:  0 1px 2px rgba(20,30,50,.06);
  --shadow:     0 4px 14px rgba(20,30,50,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main.container { flex: 1; }

/* ---- Layout ---- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.hbar      { display: flex; align-items: center; gap: 24px; }

/* ---- Header ---- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header .hbar { padding: 14px 0; }
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--navy);
  font-size: 18px;
}
.brand img { height: 36px; width: auto; display: block; }
.brand strong { color: var(--navy-dark); font-weight: 700; }

.nav { display: flex; gap: 14px; align-items: center; margin-left: 24px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--steel);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active { color: var(--navy); border-bottom-color: var(--accent); }
.nav-sep { color: var(--line); }

.user-pill {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.user-name { color: var(--ink); font-weight: 500; }
.role-tag {
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.role-admin  { background: var(--navy); color: white; }
.role-author { background: var(--accent-soft); color: var(--navy); }
.user-link, .btn-link {
  color: var(--steel); background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer; text-decoration: underline;
}
.user-link:hover, .btn-link:hover { color: var(--navy); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 16px 0; margin-top: 60px; background: var(--white);
}
.site-footer .container { display: flex; justify-content: space-between; }
.muted { color: var(--muted); }

/* ---- Headings ---- */
h1, h2, h3, h4 { color: var(--navy-dark); margin: 0 0 .4em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 28px; margin-top: 16px; }
h2 { font-size: 21px; margin-top: 32px; }
h3 { font-size: 17px; margin-top: 24px; color: var(--navy); }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: .65em; margin-left: 8px; }

/* ---- Page header strip with breadcrumb/back ---- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 24px 0 12px; gap: 16px; flex-wrap: wrap;
}
.page-head .actions { display: flex; gap: 8px; }

/* ---- Cards / panels ---- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--white); }
.stat .num { font-size: 28px; font-weight: 600; color: var(--navy-dark); }
.stat .lbl { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Flash messages ---- */
.flash {
  margin: 16px 0; padding: 10px 14px;
  border-radius: var(--radius); border: 1px solid;
  font-size: 14px;
}
.flash-success { color: var(--ok);   background: var(--ok-bg);   border-color: #c2e4d3; }
.flash-error   { color: var(--err);  background: var(--err-bg);  border-color: #f3c8c5; }
.flash-info    { color: var(--navy); background: var(--accent-soft); border-color: #c9dfee; }

/* ---- Forms ---- */
form.stack { display: flex; flex-direction: column; gap: 14px; }
form .row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { form .row { grid-template-columns: 1fr; } }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--steel); font-weight: 500; }
label.field .hint { color: var(--muted); font-weight: 400; font-size: 12px; }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,144,194,.18);
}
textarea { resize: vertical; min-height: 100px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; }
textarea.prose { font-family: inherit; font-size: 15px; min-height: 360px; }
input[disabled], select[disabled], textarea[disabled] { background: #f4f6f8; color: var(--muted); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---- Buttons ---- */
.btn, button.btn {
  display: inline-block; cursor: pointer;
  font: inherit; font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, border .15s;
}
.btn-primary  { background: var(--navy);   color: white; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--navy-dark); }
.btn-danger   { background: var(--white); color: var(--err); border-color: #f3c8c5; }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

form.inline { display: inline; }

/* ---- Tables ---- */
table.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.data th, table.data td { padding: 10px 14px; text-align: left; }
table.data th { background: #f4f7fa; color: var(--steel); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
table.data td { border-bottom: 1px solid var(--line-soft); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafcfd; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; }

/* ---- Section list (manuscript overview) ---- */
.sec-list { display: grid; gap: 10px; }
.sec-row {
  display: grid; grid-template-columns: 1.5fr 80px 110px 1fr 110px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; gap: 10px;
}
.sec-row .name { font-weight: 500; color: var(--navy); }
.sec-row .name a { color: var(--navy); text-decoration: none; }
.sec-row .name a:hover { text-decoration: underline; }
.sec-row .meta { color: var(--muted); font-size: 13px; }
.sec-row .bar  { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.sec-row .bar > span { display: block; height: 100%; background: var(--accent); }
.sec-row .bar > span.over { background: var(--err); }
.sec-row .status { text-align: right; font-size: 12px; }
.sec-row .req-tag { font-size: 11px; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--navy); margin-left: 6px; }
@media (max-width: 740px) { .sec-row { grid-template-columns: 1fr; } }

/* ---- Status & validation chips ---- */
.chip {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink);
}
.chip-ok   { background: var(--ok-bg);   color: var(--ok); }
.chip-err  { background: var(--err-bg);  color: var(--err); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

/* ---- Auth screens ---- */
.auth-card {
  max-width: 420px; margin: 80px auto 0;
  background: var(--white); padding: 36px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth-card .brand { justify-content: center; margin-bottom: 12px; font-size: 20px; }
.auth-card h1 { text-align: center; margin: 0 0 22px; font-size: 22px; }

/* ---- Empty state ---- */
.empty {
  padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--muted);
}

/* ---- Misc ---- */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 16px 0 18px; }
.tabs a { color: var(--steel); text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; }
.tabs a.active, .tabs a:hover { color: var(--navy); border-bottom-color: var(--accent); }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; color: var(--ink); }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
pre.code-block { background: #f4f7fa; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
