/* engineering.lubingusa.com - one stylesheet for every page */
:root {
	--bg: #f4f6f8;
	--card: #ffffff;
	--text: #1f2933;
	--muted: #5f6b7a;
	--line: #d9dee5;
	--accent: #0b5ea8;
	--accent-dark: #094e8c;
	--accent-soft: #eef4fb;
	--accent-text: #ffffff;
	--error: #b42318;
	--error-dark: #961c12;
	--error-soft: #fbeeec;
	--ok: #1d7a3e;
	--ok-soft: #e3f3e8;
	--control-line: #b9c3cf;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
nav a { color: var(--accent); text-decoration: none; }
nav a:hover { text-decoration: underline; }
nav .who { color: var(--muted); }
main { padding: 24px 16px; }
.card { max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; }
.card.narrow { max-width: 420px; }
.card.wide { max-width: 1600px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
label { display: block; margin: 12px 0; font-weight: 600; }
label input { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=search], input[type=file] { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; font: inherit; background: #fff; color: var(--text); }

/* buttons: one style on every page (14 px text, about 34 px tall); the links page rows use the compact .act below */
button { padding: 6px 14px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: var(--accent-text); font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; }
button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
button.danger { background: var(--error); border-color: var(--error); color: #fff; }
button.danger:hover { background: var(--error-dark); border-color: var(--error-dark); }
button.link { padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; line-height: inherit; }
button.link:hover { background: none; text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
form.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
form.inline input[type=date] { width: auto; }
progress { width: 100%; height: 18px; margin-top: 16px; }
.error { color: var(--error); font-weight: 600; }
.notice { color: var(--ok); font-weight: 600; }
.note { color: var(--muted); font-size: .92rem; }
.result { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { flex: 1; min-width: 12em; }
/* read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------------------------------------- links pages */
.links-page .page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 12px; }
.links-page .page-head h1 { margin: 0; }
form.find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
form.find label { margin: 0; font-size: 14px; }
form.find input[type=search] { width: 18em; max-width: 100%; padding: 5px 9px; font-size: 14px; }
form.find button { padding: 5px 12px; }
form.find a { color: var(--accent); font-size: 14px; }
.links-page .toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; margin-bottom: 8px; }
.links-page .count { margin: 0; color: var(--muted); font-size: 14px; }
.links-page .date-note { margin: 0 0 8px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0; font-size: 14px; }
.pager a { color: var(--accent); }
.pager span { color: var(--muted); }
.links-page form + .pager { margin-top: 12px; }

table.links { width: 100%; border-collapse: collapse; font-size: 14px; }
table.links th, table.links td { padding: 5px 7px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
table.links thead th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom: 2px solid var(--line); }
/* the file column takes whatever width the fixed columns leave; a long name is cut with an ellipsis (full name on hover and in each dialog) */
table.links th.file { width: 100%; max-width: 0; min-width: 11em; }
table.links tbody th.file { font-weight: 400; }
table.links th.file .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.links .num { text-align: right; }
table.links td.by span { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table.links .actions { text-align: right; padding-right: 0; }
tr.status-expired th, tr.status-expired td, tr.status-off th, tr.status-off td { color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 1.5; font-weight: 600; white-space: nowrap; }
.badge.active { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #e9edf1; color: var(--muted); }
.badge.expired { background: var(--error-soft); color: var(--error); }
.badge.lock { background: #fff3d1; color: #7a4e00; }

/* the compact row controls: quiet outlined buttons, 13 px text, about 30 px tall; Delete red and set apart */
.links-page button.act { padding: 5px 9px; font-size: 13px; line-height: 1.4; background: #fff; color: var(--accent); border: 1px solid var(--control-line); border-radius: 4px; margin-left: 4px; }
.links-page button.act:hover { background: var(--accent-soft); border-color: var(--accent); }
.links-page button.act[data-act=copy] { min-width: 5.4em; }   /* room for "Copied" without the row shifting */
.links-page button.act.done { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.links-page button.act.danger { color: var(--error); border-color: #e3b7b2; margin-left: 12px; }
.links-page button.act.danger:hover { background: var(--error-soft); border-color: var(--error); }

/* dialogs (Expiry, Password, Delete, Copy by hand) */
dialog.dlg { width: calc(100% - 32px); max-width: 440px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
dialog.dlg::backdrop { background: rgba(31, 41, 51, .45); }
dialog.dlg h2 { margin: 0 0 8px; overflow-wrap: anywhere; }
dialog.dlg .dlg-file { margin: 0 0 10px; font-weight: 600; overflow-wrap: anywhere; }
dialog.dlg .dlg-state { margin: 0 0 6px; color: var(--muted); font-size: .92rem; }
dialog.dlg label { margin: 10px 0 0; font-size: 14px; }
dialog.dlg input:not([type=hidden]) { display: block; width: 100%; margin-top: 4px; }
dialog.dlg .note { margin: 8px 0 0; }
dialog.dlg .dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
dialog.dlg .dlg-actions .dlg-cancel { margin-left: auto; }

/* narrow screens: each row becomes a block (name, then details with their labels, then the controls); the header
   row stays in the page for screen readers only */
@media (max-width: 1099px) {
	table.links, table.links tbody, table.links tr, table.links th, table.links td { display: block; }
	table.links thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
	table.links tr { padding: 8px 10px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; }
	table.links th, table.links td { border: 0; padding: 2px 0; white-space: normal; }
	table.links tbody th.file { width: auto; max-width: none; min-width: 0; font-weight: 600; }
	table.links th.file .name { white-space: normal; overflow-wrap: anywhere; }
	table.links td[data-label] { display: inline-block; margin-right: 16px; text-align: left; }
	table.links td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
	table.links td.by span { max-width: none; display: inline; }
	table.links td.actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; text-align: left; }
	.links-page button.act, .links-page button.act.danger { margin-left: 0; }
	.links-page button.act.danger { margin-left: auto; }
}
