/* Alpega Group look & feel – colours/type taken from alpegagroup.com */
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap;
  src: url("fonts/montserrat-Regular.woff2") format("woff2"), url("https://www.alpegagroup.com/build/fonts/montserrat-v26-latin-Regular.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap;
  src: url("fonts/montserrat-Medium.woff2") format("woff2"), url("https://www.alpegagroup.com/build/fonts/montserrat-v26-latin-Medium.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap;
  src: url("fonts/montserrat-Bold.woff2") format("woff2"), url("https://www.alpegagroup.com/build/fonts/montserrat-v26-latin-Bold.woff2") format("woff2"); }

:root {
  --bg: #ffffff; --soft: #f6f7f9; --card: #ffffff;
  --ink: #282d35; --navy: #0b2d3f; --muted: #5d6673;
  --teal: #02475e; --pink: #bf123f; --pink-bright: #e8184a; --pink-tint: #fde8ef; --green: #00a898;
  --line: #c8c7cb; --line-soft: #e9ecef;
  --radius: 10px; --pill: 50rem;
  --shadow: 0 0 25px 0 rgba(0, 0, 0, .12);
  --head: "Figtree", "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--body); }
body { user-select: none; -webkit-user-select: none;
  background: radial-gradient(900px 500px at 8% -5%, var(--pink-tint), transparent 70%), var(--bg) no-repeat; }
input, textarea { user-select: text; -webkit-user-select: text; }
h1, h2, h3 { font-family: var(--head); color: var(--navy); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px 48px; }

/* header: white bar, logo left, hairline */
header.top { display: flex; align-items: center; gap: 16px; padding: 0 24px; min-height: 72px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
header.top .logo { height: 52px; width: auto; display: block; }
header.top h1 { font-size: 1.05rem; margin: 0 0 0 8px; padding-left: 16px; border-left: 1px solid var(--line); flex: 1; font-weight: 700; color: var(--navy); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.2; font-size: .85rem; }
.clock b { display: block; font-family: var(--head); font-size: 1.3rem; color: var(--navy); }
.lang { display: flex; border: 1px solid var(--line); border-radius: var(--pill); overflow: hidden; }
.lang button { border: 0; background: transparent; color: var(--teal); padding: 9px 14px; font: 700 .85rem var(--body); min-height: 44px; }
.lang button.on { background: var(--teal); color: #fff; }

button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 2px solid var(--teal); background: #fff; color: var(--teal); border-radius: var(--pill); padding: 10px 26px; min-height: 48px; font-weight: 500; transition: all .2s ease-in-out; }
.btn:hover { background: var(--teal); color: #fff; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-bright); border-color: var(--pink-bright); }
.btn.ok { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ok:hover { background: #033b4e; }
.btn.danger { border-color: var(--line); color: var(--pink); }
.btn.danger:hover { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.big { min-height: 60px; font-size: 1.15rem; padding: 12px 36px; font-weight: 600; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.iconbtn { border: 0; background: transparent; color: var(--teal); font-size: 1.7rem; min-width: 48px; min-height: 48px; border-radius: var(--pill); }

.eyebrow { color: var(--pink-bright); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .85rem; margin: 0 0 10px; }
.center { text-align: center; padding: 10vh 20px 0; }
.center h2 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 10px; }
.center p { color: var(--muted); margin: 0 0 28px; }

.sites { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding-top: 32px; }
.sites h2 { grid-column: 1 / -1; text-align: left; margin: 0; font-size: 2.2rem; line-height: 1.15; }
.sites h2::before { content: attr(data-eyebrow); display: block; font: 600 .85rem var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--pink-bright); margin-bottom: 8px; }
.site-tile { border: 1px solid var(--line-soft); border-radius: var(--radius); min-height: 26vh; background: var(--card); color: var(--navy); box-shadow: var(--shadow); font: 700 2rem var(--head); position: relative; transition: all .2s ease-in-out; }
.site-tile::after { content: "›"; position: absolute; right: 24px; bottom: 14px; color: var(--pink); font-size: 2.4rem; line-height: 1; }
.site-tile:hover { border-color: var(--pink); }
.site-tile:active { transform: scale(.98); }

.section-title { margin: 30px 0 12px; font: 600 .85rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--pink-bright); }
.list { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.card .who { flex: 1; min-width: 0; }
.card .name { font: 700 1.2rem var(--head); color: var(--navy); overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: var(--muted); font-size: .9rem; }
.card .time { font: 700 1.1rem var(--head); font-variant-numeric: tabular-nums; color: var(--teal); min-width: 74px; text-align: right; }
.card.present { border-left: 6px solid var(--green); }
.card.done { opacity: .7; padding: 10px 20px; box-shadow: none; }
.card.col { flex-direction: column; align-items: stretch; }
.tag { display: inline-block; font-size: .72rem; border: 1px solid var(--pink); color: var(--pink); border-radius: var(--pill); padding: 0 9px; margin-left: 8px; vertical-align: middle; font-weight: 600; }
.empty { color: var(--muted); padding: 10px 4px; }
.banner { background: var(--pink-tint); color: var(--pink); border-radius: var(--radius); padding: 10px 16px; margin-top: 16px; font-weight: 500; }
.fab { margin-top: 26px; width: 100%; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 14px 22px; border-radius: var(--pill); display: none; align-items: center; gap: 16px; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; font-weight: 500; }
#toast.show { display: flex; }
#toast button { background: transparent; border: 1px solid #fff; color: #fff; border-radius: var(--pill); padding: 6px 16px; font-weight: 600; min-height: 40px; }

dialog { border: 0; border-radius: var(--radius); padding: 28px; width: min(560px, 92vw); background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(9, 34, 51, .55); }
dialog h2 { margin: 0 0 14px; font-size: 1.5rem; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .9rem; color: var(--navy); }
input, select { width: 100%; font: inherit; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); min-height: 52px; }
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.err { color: var(--pink); min-height: 1.4em; margin-top: 10px; font-weight: 500; }
.ok-msg { color: var(--green); min-height: 1.4em; margin-top: 10px; font-weight: 500; }

/* admin */
.tabs { display: flex; gap: 8px; margin: 22px 0; border-bottom: 1px solid var(--line-soft); }
.tabs button { border: 0; background: transparent; color: var(--teal); padding: 12px 20px; font: 600 .95rem var(--body); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--pink); border-bottom-color: var(--pink); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filters label { margin: 0 0 4px; }
.presets { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.presets .btn { min-height: 42px; padding: 6px 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 20px 0; }
.stat { background: #fff; border: 1px solid var(--line-soft); border-top: 3px solid var(--pink); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); padding: 12px 16px; }
.stat b { display: block; font: 700 1.7rem var(--head); color: var(--navy); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--teal); font: 700 .75rem var(--body); text-transform: uppercase; letter-spacing: .06em; background: var(--soft); }
tr:last-child td { border-bottom: 0; }
td.wrapcell { white-space: normal; min-width: 160px; }
td select { min-height: 40px; padding: 6px 10px; width: auto; }
td .btn { min-height: 38px; padding: 4px 16px; margin-right: 4px; font-size: .85rem; }
.pill { border-radius: var(--pill); padding: 2px 12px; font-size: .78rem; font-weight: 700; background: var(--soft); border: 1px solid var(--line-soft); color: var(--teal); }
.pill.checked_in { color: #fff; background: var(--green); border-color: var(--green); }
.pill.no_logoff, .pill.no_show { color: var(--pink); background: var(--pink-tint); border-color: var(--pink-tint); }
.pill.cancelled { color: var(--muted); }
.login-form, .reg-form { max-width: 420px; margin: 0 auto; text-align: left; }
.login-actions { display: grid; gap: 12px; margin-top: 18px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

@media (max-width: 700px) {
  .sites { grid-template-columns: 1fr; } .site-tile { min-height: 18vh; }
  header.top h1 { display: none; } .clock { display: none; }
}

.sigpad { display: block; width: 100%; height: 220px; background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
#w-sig { height: 160px; }
.sigwrap { position: relative; }
.sighint { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: var(--line); font: 600 1.3rem var(--head); pointer-events: none; }
.sig-notice { margin: 0 0 12px; }
#w-sigbox { margin-top: 6px; } #w-sigbox .btn { margin-top: 8px; min-height: 40px; padding: 4px 18px; }
.sigimg { width: 100%; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; }
