/* Staff portal (served at /portal/<slug>/). No inline styles: the page's security policy forbids them. The customer's colours, fonts and logo are
   applied by portal.js through the custom properties below (--blue is their main colour, --navy their dark colour). */
:root { --blue: #1B4DB1; --navy: #0E2A6B; --yellow: #F9C623; --cream: #FFF9E8; --muted: #56658C; --line: #EBE3CB; --pale: #EEF2FB; --red: #B3261E; --red-bg: #FDECEA; --green: #1D7A46; --green-bg: #E6F4EC; --on-blue: #fff; --ink: var(--navy); --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-head: var(--font-body); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--cream); color: var(--ink); line-height: 1.5; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--font-head); color: var(--navy); }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.loading { text-align: center; padding: 80px 16px; color: var(--muted); }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 48px; }
.top { background: #fff; border-bottom: 2px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
.top h1 { font-size: 20px; }
.top .brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top .brand img { height: 48px; width: auto; max-width: 160px; object-fit: contain; }
.top { border-bottom-color: var(--blue); border-bottom-width: 3px; }
.logo { display: block; margin: 0 auto 16px; max-height: 96px; max-width: 70%; width: auto; }
.top .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin: 22px 0 18px; flex-wrap: wrap; }
.tab { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 16px; cursor: pointer; font-weight: 700; }
.tab[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }

.card { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 18px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.login { max-width: 400px; margin: 9vh auto 0; }
.login h1 { font-size: 24px; margin-bottom: 4px; }
.login.branded h1, .login.branded .sub { text-align: center; }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.input { width: 100%; min-height: 44px; border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.input:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 2px solid var(--blue); background: var(--blue); color: var(--on-blue); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy); border-color: var(--navy); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.ghost:hover { background: var(--pale); }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn:disabled { opacity: .6; cursor: default; }
.block { width: 100%; }
.error { color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.ok { color: var(--green); background: var(--green-bg); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.foot { text-align: center; margin-top: 14px; font-size: 14px; }
.linkbtn { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; padding: 0; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.files li:first-child { border-top: 0; }
.files .name { flex: 1 1 220px; font-weight: 700; word-break: break-word; }
.files .meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 8px 0; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.bar input[type="file"] { max-width: 100%; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--pale); color: var(--blue); }
.tag.off { background: var(--red-bg); color: var(--red); }
.tag.wait { background: #FFF4D6; color: #7A5B00; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.row { display: grid; grid-template-columns: 1fr 1fr 150px auto; gap: 10px; align-items: end; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; } .scroll { overflow-x: auto; } }

/* Words the customer can change: a welcome card, a notice banner and a footer line */
.card.welcome p { white-space: pre-line; font-size: 16px; }
.notice { border-radius: 12px; padding: 12px 16px; margin: 16px 0 0; font-weight: 600; white-space: pre-line; }
.notice.info { background: var(--pale); border: 1px solid var(--line); color: var(--ink); }
.notice.warn { background: #FFF4D6; border: 1px solid #F0D58A; color: #5C4300; }
.login .notice { margin: 12px 0; font-size: 14px; }
.footnote { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; white-space: pre-line; }

/* Layout choices the customer can make (classes set by portal.js from a fixed list) */
.w-narrow .wrap { max-width: 680px; }
.w-wide .wrap { max-width: 1200px; }
.h-center .top .wrap { flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
.h-center .top .brand { justify-content: center; }
.h-center .top .who { justify-content: center; }
.sq .card, .sq .btn, .sq .tab, .sq .input, .sq .notice, .sq .logo { border-radius: 3px; }
.dense .card { padding: 14px; margin-bottom: 12px; }
.dense .tabs { margin: 14px 0 12px; }
.dense .files li { padding: 6px 0; }
.dense th, .dense td { padding: 6px 8px; }

/* Extra pages: plain content blocks */
.card.page h2 { margin-bottom: 10px; }
.card.page .blk { margin: 0 0 14px; }
.card.page h3.blk { font-size: 16px; margin-top: 18px; }
.card.page .para { white-space: pre-line; }
.card.page .bullets { padding-left: 22px; }
.card.page .bullets li { margin-bottom: 4px; }
.card.page .linkrow { display: flex; gap: 10px; flex-wrap: wrap; }
.card.page .facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.card.page .facts dt { font-weight: 700; }
.card.page .facts dd { margin: 0; white-space: pre-line; }
.card.page .notice { margin: 0 0 14px; }
.card.page hr.blk { border: 0; border-top: 1px solid var(--line); }

/* Folders */
.card.folder h2::before { content: '\1F4C1'; margin-right: 8px; font-size: 16px; }
.files select.move { width: auto; min-height: 34px; padding: 0 8px; font-size: 14px; }
