/* IJPR Submission Portal — dashboard components.
   Built on the ijpr.css design tokens (--teal, --paper, --ink, …), so the
   accent picker and dark mode apply here automatically. */

body.ijprp { background: var(--paper); color: var(--ink); }
.masthead .brand a.portal-mark { text-decoration: none; display: inline-block; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Utility bar: account links */
.utility-bar .u-right { display: flex; align-items: center; gap: 18px; }
.portal-account { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.portal-account a { color: inherit; text-decoration: none; }
.portal-account a:hover { text-decoration: underline; }
.portal-account .icon { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.portal-hero { padding: 44px 0 40px; border-bottom: 1px solid var(--line-strong); background:
	linear-gradient(180deg, var(--teal-pale) 0%, var(--paper) 100%); }
.portal-hero__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 40px; align-items: start; }
.portal-hero h1 { font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 14px; max-width: 20ch; }
.portal-hero .lede { font-size: 16px; line-height: 1.65; color: var(--ink-soft); max-width: 58ch; margin: 0 0 22px; }
.portal-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.portal-hero__actions .btn-ghost, .p-panel__head .btn-ghost { background: var(--paper) !important; color: var(--teal-dark) !important; border: 1px solid var(--line-strong) !important; box-shadow: none; }
.portal-hero__actions .btn-ghost:hover, .p-panel__head .btn-ghost:hover { border-color: var(--teal) !important; color: var(--teal) !important; }
.portal-hero__actions .icon, .p-card .icon, .p-panel h2 .icon, .portal-links .icon { width: 18px; height: 18px; vertical-align: -3px; }

.portal-hero__card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-md); }
.portal-hero__card h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; }
.portal-hero__card form p { margin: 0 0 12px; }
.portal-hero__card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.portal-hero__card input[type=text], .portal-hero__card input[type=password] {
	width: 100%; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink);
	background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; }
.portal-hero__card input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.portal-hero__card .login-remember label { display: inline-flex; gap: 6px; font-weight: 400; align-items: center; }
.portal-hero__card .login-submit input { width: 100%; padding: 11px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.portal-hero__card .login-submit input:hover { background: var(--teal-dark); }
.portal-small { font-size: 13px; color: var(--ink-soft); margin: 4px 0 12px; }
.portal-card-split { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.portal-card-split a { display: block; padding: 10px 12px; border-radius: 8px; background: var(--paper-alt); color: var(--ink); text-decoration: none; font-size: 14px; }
.portal-card-split a:hover { background: var(--teal-pale); }
.portal-card-split strong { color: var(--teal-dark); }
.portal-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.p-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); }
.p-chip--strong { background: var(--teal); color: #fff; }
.portal-links { list-style: none; margin: 8px 0 0; padding: 0; }
.portal-links li { border-top: 1px solid var(--line); }
.portal-links a { display: flex; gap: 10px; align-items: center; padding: 10px 2px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.portal-links a:hover { color: var(--teal); }

/* ---------- Sections ---------- */
.portal-section { padding: 40px 0; }
.portal-section--alt { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.portal-h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0 0 20px; }
.portal-note { background: var(--teal-pale); padding: 12px 16px; border-radius: 8px; margin-top: 20px; }
.portal-empty { color: var(--ink-soft); margin: 6px 0 0; }

/* Panels (role dashboards) */
.portal-panels { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.p-panel { flex: 1 1 340px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); min-width: 0; }
.p-panel--editor { flex-basis: 100%; border-top: 3px solid var(--teal); }
.p-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.p-panel h2 { font-size: 18px; font-weight: 700; margin: 0; display: flex; gap: 8px; align-items: center; color: var(--teal-dark); }
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.p-stat { display: block; padding: 12px 14px; border-radius: 10px; background: var(--paper-alt); color: var(--ink); text-decoration: none; }
a.p-stat:hover { background: var(--teal-pale); }
.p-stat strong { display: block; font-size: 26px; line-height: 1.1; color: var(--teal-dark); font-family: var(--serif); }
.p-stat span { font-size: 12.5px; color: var(--ink-soft); }
.p-stat.is-alert { background: #FBEDE3; }
.p-stat.is-alert strong { color: var(--rust); }
.p-list { list-style: none; margin: 0; padding: 0; }
.p-list li { border-top: 1px solid var(--line); }
.p-list a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 4px; text-decoration: none; color: var(--ink); }
.p-list a:hover { background: var(--paper-alt); }
.p-list li.is-action { box-shadow: inset 3px 0 0 var(--rust); }
.p-list__id { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); grid-row: span 2; padding-top: 2px; min-width: 128px; }
.p-list__title { font-size: 14px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-list__action { grid-column: 2; font-size: 12.5px; font-weight: 600; color: var(--rust); }
.p-list .p-badge { grid-column: 2; justify-self: start; }
.p-more { margin: 10px 0 0; font-size: 14px; }
.p-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); }
.p-badge--draft, .p-badge--withdrawn { background: var(--paper-alt); color: var(--ink-soft); }
.p-badge--returned, .p-badge--revision_requested, .p-badge--revision_expired { background: #FBEDE3; color: var(--rust); }
.p-badge--accepted, .p-badge--in_production, .p-badge--published { background: #DDF1E4; color: #1D6B3A; }
.p-badge--rejected { background: #FDECEA; color: #B42318; }

/* Quick access cards */
.p-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.p-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.p-card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.p-card .icon { color: var(--teal); width: 24px; height: 24px; margin-bottom: 4px; }
.p-card strong { font-size: 15.5px; color: var(--teal-dark); }
.p-card span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* How it works */
.p-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; counter-reset: step; }
.p-steps li { position: relative; padding: 46px 16px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); counter-increment: step; }
.p-steps li::before { content: counter(step); position: absolute; top: 14px; left: 16px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.p-steps strong { display: block; font-size: 15px; margin-bottom: 4px; }
.p-steps span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* Facts */
.p-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.p-facts h3 { font-size: 15px; font-weight: 700; color: var(--teal-dark); margin: 0 0 6px; }
.p-facts p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

/* Inner pages */
.portal-page-hero { background: linear-gradient(180deg, var(--teal-pale) 0%, var(--paper) 100%); }
.portal-content { padding: 32px 0 56px; }
.portal-content > .ijem { margin: 0 auto; }

@media (max-width: 900px) {
	.portal-hero__grid { grid-template-columns: 1fr; gap: 24px; }
	.portal-hero h1 { font-size: 30px; }
}
@media (max-width: 560px) {
	.p-list a { grid-template-columns: 1fr; }
	.p-list__id { grid-row: auto; }
	.p-list__title, .p-list__action, .p-list .p-badge { grid-column: 1; }
	.utility-bar .u-right .icons { display: none; }
}

/* ---------- Dark mode for the editorial plugin's forms ----------
   The plugin draws white cards and inputs; in dark mode the design
   system's --ink turns light, so re-point the plugin's own variables at
   the dark palette. Same rules twice: explicit toggle, and system dark. */
[data-theme="dark"] .ijem {
	--ijem-bg: var(--paper-alt);
	--ijem-bg-alt: var(--paper);
	--ijem-ok-bg: #16302A;
	--ijem-warn-bg: #33241A;
}
[data-theme="dark"] .ijem input[type=text], [data-theme="dark"] .ijem input[type=email], [data-theme="dark"] .ijem input[type=number],
[data-theme="dark"] .ijem input[type=password], [data-theme="dark"] .ijem input[type=date], [data-theme="dark"] .ijem select, [data-theme="dark"] .ijem textarea,
[data-theme="dark"] .ijem-table, [data-theme="dark"] .ijem-btn--ghost { background: var(--paper); color: var(--ink); }
[data-theme="dark"] .ijem-notice--error, [data-theme="dark"] .ijem-table tr.is-overdue td { background: #3A1E1C; }
[data-theme="dark"] .ijem-badge--rejected, [data-theme="dark"] .p-badge--rejected { background: #3A1E1C; color: #F4A39A; }
[data-theme="dark"] .ijem-badge--accepted, [data-theme="dark"] .ijem-badge--in_production, [data-theme="dark"] .ijem-badge--published,
[data-theme="dark"] .p-badge--accepted, [data-theme="dark"] .p-badge--in_production, [data-theme="dark"] .p-badge--published { background: #16302A; color: #8FD3A8; }
[data-theme="dark"] .p-stat.is-alert, [data-theme="dark"] .p-badge--returned, [data-theme="dark"] .p-badge--revision_requested,
[data-theme="dark"] .p-badge--revision_expired { background: #33241A; }

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ijem {
		--ijem-bg: var(--paper-alt);
		--ijem-bg-alt: var(--paper);
		--ijem-ok-bg: #16302A;
		--ijem-warn-bg: #33241A;
	}
	:root:not([data-theme="light"]) .ijem input[type=text], :root:not([data-theme="light"]) .ijem input[type=email],
	:root:not([data-theme="light"]) .ijem input[type=number], :root:not([data-theme="light"]) .ijem input[type=password],
	:root:not([data-theme="light"]) .ijem input[type=date], :root:not([data-theme="light"]) .ijem select, :root:not([data-theme="light"]) .ijem textarea,
	:root:not([data-theme="light"]) .ijem-table, :root:not([data-theme="light"]) .ijem-btn--ghost { background: var(--paper); color: var(--ink); }
	:root:not([data-theme="light"]) .ijem-notice--error, :root:not([data-theme="light"]) .ijem-table tr.is-overdue td { background: #3A1E1C; }
	:root:not([data-theme="light"]) .ijem-badge--rejected, :root:not([data-theme="light"]) .p-badge--rejected { background: #3A1E1C; color: #F4A39A; }
	:root:not([data-theme="light"]) .ijem-badge--accepted, :root:not([data-theme="light"]) .ijem-badge--in_production, :root:not([data-theme="light"]) .ijem-badge--published,
	:root:not([data-theme="light"]) .p-badge--accepted, :root:not([data-theme="light"]) .p-badge--in_production, :root:not([data-theme="light"]) .p-badge--published { background: #16302A; color: #8FD3A8; }
	:root:not([data-theme="light"]) .p-stat.is-alert, :root:not([data-theme="light"]) .p-badge--returned, :root:not([data-theme="light"]) .p-badge--revision_requested,
	:root:not([data-theme="light"]) .p-badge--revision_expired { background: #33241A; }
}
