/* 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; } }
