/* ALS Project Log. Colours, type and logos from alsindustrial.co.uk. */

:root {
  --navy:        #0b3d6e;   /* ALS primary */
  --navy-dark:   #072a4d;
  --navy-light:  #337abd;   /* ALS secondary */
  --amber:       #fabb00;   /* ALS accent */
  --ink:         #252525;
  --ink-soft:    #55607a;
  --ink-faint:   #636d81;
  --line:        #d7dce3;
  --line-control:#8695aa;
  --line-soft:   #e8ecf2;
  --bg:          #ffffff;
  --tint:        #f4f4f4;   /* ALS light grey, for panels on the white page */
  --surface:     #ffffff;
  --ok:          #0f7a4d;
  --ok-bg:       #e3f4ec;
  --warn:        #9a5b00;
  --warn-bg:     #fdf0d6;
  --bad:         #a3231f;
  --bad-bg:      #fbe6e5;
  --info:        #1d4f91;
  --info-bg:     #e6eefb;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 2px rgba(27, 34, 49, .06), 0 6px 18px rgba(27, 34, 49, .05);
  --font:        Roboto, "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font-head:   "Roboto Condensed", Roboto, "Segoe UI", Arial, sans-serif;
  --mono:        ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--navy); }
a:hover { color: var(--navy-light); }
h1, h2, h3 { line-height: 1.25; color: var(--navy); font-family: var(--font-head); font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
p { margin: 0 0 .75rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
/* White header framed by the ALS navy above and the amber rule below. */
.topbar { background: #fff; border-top: 6px solid var(--navy); border-bottom: 3px solid var(--amber); box-shadow: 0 2px 10px rgba(11, 61, 110, .06); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { color: var(--navy); text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand:hover { color: var(--navy); }
.brand img { height: 36px; width: auto; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; color: var(--navy-light); padding-left: 14px; border-left: 3px solid var(--amber); line-height: 1.2; }
@media (max-width: 520px) { .brand img { height: 26px; } .brand-name { font-size: .9rem; padding-left: 10px; } }
.login-mark { display: block; width: 56px; height: 56px; margin-bottom: 12px; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { color: var(--navy); text-decoration: none; padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 500; }
.mainnav a:hover { background: #eaf1f8; color: var(--navy); }
.mainnav a[aria-current] { background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--amber); }
.main { padding-top: 28px; padding-bottom: 48px; min-height: 70vh; }
.footer { background: var(--navy); color: #d6e2ef; font-size: .85rem; border-top: 3px solid var(--amber); }
.footer .wrap { padding-top: 16px; padding-bottom: 16px; }

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e0cb; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; }
.alert-bad { background: var(--bad-bg); color: var(--bad); border-color: #efc2c0; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d9a8; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c4d5f2; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: var(--radius-sm); padding: 8px 14px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--navy-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line-control); }
.btn-ghost:hover { background: var(--line-soft); color: var(--navy-dark); }
.btn-danger { background: #fff; color: var(--bad); border-color: #d9a3a1; }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-small { padding: 4px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-control); border-radius: var(--radius-sm); padding: 8px 10px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.input-with-button { display: flex; gap: 8px; }
.input-with-button input { flex: 1; min-width: 0; }
.input-with-button .btn { white-space: nowrap; }
@media (max-width: 520px) { .input-with-button { flex-direction: column; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); background: var(--tint); border-bottom: 2px solid var(--amber); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-soft); white-space: nowrap; }
.badge-open { background: var(--info-bg); color: var(--info); }
.badge-won { background: var(--ok-bg); color: var(--ok); }
.badge-lost { background: var(--bad-bg); color: var(--bad); }
.badge-on_hold { background: var(--warn-bg); color: var(--warn); }
.badge-type { background: #eef1f7; color: var(--navy); }

/* Project document */
.doc-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; }
.overview p { white-space: pre-line; }
.status-line { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; }
.facts div { background: var(--tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.facts dt { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 10px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-light); }
.timeline time { font-weight: 600; color: var(--navy); margin-right: 6px; }
.cite { font-size: .8rem; text-decoration: none; color: var(--ink-faint); white-space: nowrap; }
.cite:hover { text-decoration: underline; }
.list-plain { margin: 0; padding-left: 1.2rem; }
.list-plain li { margin-bottom: 4px; }

.entry { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--navy-light); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; scroll-margin-top: 16px; }
.entry:target { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,196,37,.35); }
.entry-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.entry-num { color: var(--ink-faint); font-weight: 600; margin-right: 6px; }
.entry-meta { color: var(--ink-soft); font-size: .85rem; display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.entry-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sp-path { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); word-break: break-all; }
.entry details { margin-top: 10px; }
.entry summary { cursor: pointer; color: var(--navy-light); font-size: .9rem; }
.original { white-space: pre-wrap; font-family: var(--mono); font-size: .8rem; background: #fafbfd; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px; max-height: 420px; overflow: auto; }
.notes { border-left: 3px solid var(--amber); padding: 4px 10px; background: #fffaf0; margin-bottom: 10px; white-space: pre-line; }
.mini-facts { margin: 6px 0 0; padding-left: 1.2rem; font-size: .9rem; }
.history { font-size: .85rem; }
.history td:first-child { white-space: nowrap; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.searchbar input { flex: 1; min-width: 200px; }
.searchbar select { width: auto; }
.token-box { font-family: var(--mono); background: #fafbfd; border: 1px dashed var(--line-control); padding: 10px; border-radius: var(--radius-sm); word-break: break-all; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Print: the project page is the document. Save as PDF from the browser. */
@media print {
  body { background: #fff; font-size: 11pt; }
  .footer, .no-print, .entry details, .actions, .mainnav { display: none !important; }
  .topbar { box-shadow: none; }
  .card, .entry { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: #000; }
  .sp-link::after { content: " (" attr(href) ")"; font-weight: 400; font-size: 8pt; word-break: break-all; }
  .main { padding: 0; }
}
