/* Klaidz Portal - glass design system. Blue, white and neutral; photographic backgrounds under dark overlays.
   No external resources. No inline styles are needed anywhere (the page security policy forbids them). */
:root {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #cbd5e1;
  --ac: #7fdcff;
  --ac-2: #3b82f6;
  --line: rgba(255, 255, 255, .18);
  --line-strong: rgba(255, 255, 255, .32);
  --glass: rgba(12, 26, 49, .72);
  --glass-bar: rgba(12, 26, 49, .84);
  --glass-hi: rgba(255, 255, 255, .045);
  --glass-solid: rgba(12, 26, 49, .76);
  --field: rgba(3, 8, 18, .62);
  --ok: #86efac; --ok-bg: rgba(34, 197, 94, .16); --ok-line: rgba(134, 239, 172, .35);
  --warn: #fcd34d; --warn-bg: rgba(245, 158, 11, .16); --warn-line: rgba(252, 211, 77, .35);
  --bad: #fca5a5; --bad-bg: rgba(239, 68, 68, .17); --bad-line: rgba(252, 165, 165, .4);
  --info-bg: rgba(59, 130, 246, .18); --info-line: rgba(127, 220, 255, .38);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-w: 248px;
  --gap: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #050c1a; scroll-behavior: smooth; }
body {
  margin: 0; font: 400 16px/1.55 var(--font); color: var(--ink); background: transparent;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(127, 220, 255, .35); }
a { color: var(--ac); text-underline-offset: 2px; }
a:hover { color: #fff; }
h1 { font-size: 1.75rem; margin: 0 0 .75rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; color: #fff; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; font-weight: 620; color: #fff; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; font-weight: 620; }
p { margin: 0 0 .9rem; }
code, .mono { font-family: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 3000; background: #fff; color: #06111b; padding: .5rem .9rem; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .2s var(--ease); }
.skip:focus { top: 12px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- photographic background: one fixed layer, dark blue overlay on top ---------- */
.bg { position: fixed; inset: 0; z-index: -2; background: #050c1a; overflow: hidden; }
.bg::before { content: ""; position: absolute; inset: 0; background: var(--photo) center / cover no-repeat; transform: scale(1.04); }
.bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(900px 500px at 78% -10%, rgba(59, 130, 246, .14), transparent 70%),
  linear-gradient(180deg, rgba(6, 14, 32, .80), rgba(6, 14, 32, .92)); }
body.staff { --photo: url("/static/img/bg-app-1920.webp"); }
body.client { --photo: url("/static/img/bg-client-1920.webp"); }
body.guest { --photo: url("/static/img/bg-login-1920.webp"); }
body.guest .bg::after { background:
  radial-gradient(70vmax 50vmax at 50% -10%, rgba(60, 130, 255, .28), transparent 70%),
  linear-gradient(180deg, rgba(6, 14, 32, .72), rgba(6, 14, 32, .90)); }
body.client .bg::after { background: linear-gradient(180deg, rgba(6, 14, 32, .76), rgba(6, 14, 32, .91)); }
@media (max-width: 900px) {
  body.staff { --photo: url("/static/img/bg-app-900.webp"); }
  body.client { --photo: url("/static/img/bg-client-900.webp"); }
  body.guest { --photo: url("/static/img/bg-login-900.webp"); }
}

/* ---------- glass surfaces ---------- */
.glass, .card, .stat, .table-wrap, .topbar, .notice, .savework-card {
  background: linear-gradient(165deg, var(--glass-hi), rgba(255, 255, 255, .015)), var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .stat, .table-wrap, .topbar, .notice, .savework-card { background: rgba(10, 20, 40, .92); }
}
.topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(165deg, var(--glass-hi), rgba(255, 255, 255, .015)), var(--glass-bar); border-color: var(--line-strong); }
.topbar::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); pointer-events: none; }
.card { border-radius: var(--radius); padding: 1.35rem 1.5rem; margin: 0 0 1.25rem; }
.card.narrow, section.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .9rem; }
.head h1 { margin: 0; }

/* ---------- shell: floating navigation ---------- */
.topbar { position: fixed; z-index: 100; left: 12px; right: 12px; top: 12px; max-width: 1180px; margin-inline: auto; padding: .55rem .85rem; display: flex; align-items: center; gap: .6rem 1rem; border-radius: 22px; }
body.staff, body.client { padding-top: 84px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: #fff; text-decoration: none; font-size: 1.08rem; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(127, 220, 255, .45)); transition: transform .4s var(--ease); }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.08); }
.topbar nav { display: flex; gap: .2rem; }
.topbar nav a { position: relative; display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .95rem; transition: background .2s, color .2s, transform .25s var(--ease); }
.topbar nav a::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i, var(--i-dot)) center / contain no-repeat; mask: var(--i, var(--i-dot)) center / contain no-repeat; opacity: .85; }
.topbar nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.topbar nav a.active { background: linear-gradient(100deg, rgba(59, 130, 246, .34), rgba(127, 220, 255, .14)); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(127, 220, 255, .28); }
.topbar nav a.active::after { content: ""; position: absolute; left: -7px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--ac); box-shadow: 0 0 10px var(--ac); }
.who { display: flex; align-items: center; gap: .7rem; font-size: .9rem; }
.who-name { color: #fff; text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.who-name:hover { text-decoration: underline; }
.menu-btn { display: none; }
.nav-backdrop { display: none; }
:root {
  --i-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E");
}
nav a[href="/admin"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); }
nav a[href^="/admin/inquiries"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
nav a[href^="/admin/clients"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 5.2a3.2 3.2 0 0 1 0 5.6M18 14.4c1.9.7 3 2.4 3 4.6'/%3E%3C/svg%3E"); }
nav a[href^="/admin/projects"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
nav a[href^="/admin/analytics"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
nav a[href^="/admin/users"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7'/%3E%3C/svg%3E"); }
nav a[href^="/admin/invitations"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-11 11M22 2l-7 20-4-9-9-4z'/%3E%3C/svg%3E"); }
nav a[href^="/admin/audit"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 10h6M9 14h6'/%3E%3C/svg%3E"); }
nav a[href^="/admin/integrations"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
nav a[href^="/admin/system"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='7' rx='2'/%3E%3Crect x='3' y='13' width='18' height='7' rx='2'/%3E%3Cpath d='M7 7.5h.01M7 16.5h.01'/%3E%3C/svg%3E"); }
nav a[href^="/admin/maintenance"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 6.5a4 4 0 0 0 5 5L10 21a2.1 2.1 0 0 1-3-3z'/%3E%3C/svg%3E"); }

/* staff desktop: floating glass sidebar */
@media (min-width: 1100px) {
  body.staff { padding-left: calc(var(--side-w) + var(--gap) * 2); padding-top: 0; }
  body.staff .topbar { left: var(--gap); right: auto; top: var(--gap); bottom: var(--gap); margin: 0; max-width: none; width: var(--side-w); flex-direction: column; align-items: stretch; padding: 1.1rem .9rem; gap: .9rem; }
  body.staff .topbar .brand { padding: .2rem .5rem .8rem; border-bottom: 1px solid var(--line); }
  body.staff .topbar nav { flex-direction: column; flex: 1; overflow-y: auto; padding-right: 2px; }
  body.staff .topbar nav a:hover { transform: translateX(3px); }
  body.staff .who { flex-direction: column; align-items: stretch; gap: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
  body.staff .who-name { padding: 0 .5rem; }
  body.staff .who .ghost { width: 100%; }
}
/* clients, tablets and phones: floating rounded bar on top */
@media (max-width: 1099.98px) {
  .topbar { flex-wrap: nowrap; }
  .topbar .who { margin-left: auto; }
  body.staff .menu-btn { display: inline-grid; place-content: center; gap: 4px; width: 40px; height: 40px; padding: 0; margin: 0; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); order: -1; }
  .menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s var(--ease), opacity .2s; }
  body.nav-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  body.staff .topbar nav { position: fixed; z-index: 120; top: 12px; bottom: 12px; left: 12px; width: min(300px, calc(100vw - 48px)); flex-direction: column; padding: 4.2rem .8rem .9rem; border-radius: 22px; overflow-y: auto; background: linear-gradient(165deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), rgba(8, 17, 34, .94); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -20px #000; transform: translateX(-115%); visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
  body.nav-open .topbar nav { transform: none; visibility: visible; transition: transform .35s var(--ease); }
  body.nav-open .menu-btn { position: relative; z-index: 130; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(2, 6, 16, .62); animation: fade .25s both; }
  body.client .brand-logo, body.staff .brand-logo { width: 28px; height: 28px; }
}
@media (max-width: 520px) { .who-name { display: none; } }

/* ---------- page frame ---------- */
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.4rem 2.5rem; outline: none; }
body.staff main { padding-top: 2rem; }
footer { text-align: center; color: var(--muted); text-shadow: 0 1px 3px rgba(2, 8, 20, .85), 0 0 12px rgba(2, 8, 20, .8); font-size: .82rem; padding: 1rem 1rem 1.4rem; }
body.staff footer { padding-left: 0; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: .95rem 0 .3rem; font-size: .92rem; color: #fff; }
label.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], input[type=date], input[type=url], textarea, select {
  width: 100%; padding: .66rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: var(--field); color: var(--ink);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
textarea { min-height: 4.8rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .36); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(127, 220, 255, .75); box-shadow: 0 0 0 4px rgba(127, 220, 255, .12), 0 0 22px -6px rgba(127, 220, 255, .4); }
input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 60px #0a1424 inset; }
option { background: #0b1424; color: var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--ac-2); width: 1.05rem; height: 1.05rem; }
input.code { font-size: 1.4rem; letter-spacing: .15em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
input[readonly] { background: rgba(59, 130, 246, .12); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); }
button, .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; position: relative; overflow: hidden;
  padding: .58rem 1.05rem; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .08); color: var(--ink); margin-top: .9rem;
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .3s;
}
button:hover, .button:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; transform: translateY(-1px); }
button:active, .button:active { transform: none; }
button.primary, .button.primary { color: #06111b; border-color: transparent; background: linear-gradient(100deg, #c9d3df, #fff 45%, #9fe3ff); box-shadow: 0 10px 28px -12px rgba(127, 220, 255, .65); }
button.primary:hover, .button.primary:hover { color: #06111b; background: linear-gradient(100deg, #d6dfe9, #fff 45%, #b4eaff); box-shadow: 0 16px 34px -12px rgba(127, 220, 255, .8); transform: translateY(-2px); }
button.primary::before, .button.primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .85), transparent 70%); translate: -120% 0; transition: translate .8s; pointer-events: none; }
button.primary:hover::before, .button.primary:hover::before { translate: 120% 0; }
button.danger { background: rgba(239, 68, 68, .1); border-color: var(--bad-line); color: var(--bad); }
button.danger:hover { background: rgba(239, 68, 68, .22); color: #fff; }
button.link { background: none; border: none; padding: 0; margin: 0; color: var(--ac); text-decoration: underline; font-weight: 500; box-shadow: none; }
button.link:hover { background: none; color: #fff; transform: none; }
button.ghost { background: transparent; border-color: var(--line); margin: 0; }
button.small { padding: .25rem .65rem; margin: 0; font-size: .82rem; }
button.is-loading, .button.is-loading { pointer-events: none; opacity: .8; }
button.is-loading::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .55em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
form.inline { display: inline; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.row > div { flex: 1 1 200px; }
.row button { margin-top: 0; }
form.action { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 1rem; }
form.action:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

/* ---------- notices ---------- */
.notice { padding: .75rem 1rem .75rem 1.1rem; border-radius: 14px; margin: 0 0 1rem; position: relative; overflow: hidden; animation: slide .45s var(--ease) both; }
.notice::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ac); }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice a { color: inherit; font-weight: 600; }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.notice.ok::before { background: var(--ok); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.notice.warn::before { background: var(--warn); }
.notice.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.notice.error::before { background: var(--bad); }
.notice.advance-info { background: var(--info-bg); border-color: var(--info-line); color: #cfeeff; }
.notice.advance-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.notice.advance-warn::before { background: var(--warn); }
.notice.advance-urgent { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); font-weight: 600; }
.notice.advance-urgent::before { background: var(--bad); }
.savework { position: fixed; inset: 0; background: rgba(2, 6, 16, .66); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 1000; animation: fade .25s both; }
.savework.closing { animation: fadeout .18s both; }
.savework-card { background: rgba(9, 18, 36, .94); border-radius: 22px; max-width: 30rem; width: 100%; padding: 1.5rem 1.6rem; box-shadow: 0 30px 80px -20px #000; animation: pop .35s var(--ease) both; }
.savework.closing .savework-card { animation: popout .18s both; }
.savework-card h2 { margin-top: 0; color: var(--bad); }

/* ---------- tables, pills, stats ---------- */
.table-wrap { overflow-x: auto; background: var(--glass-solid); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: rgba(255, 255, 255, .04); white-space: nowrap; font-weight: 650; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(127, 220, 255, .06); }
tr:last-child td { border-bottom: none; }
table.compact th, table.compact td { padding: .45rem .6rem; font-size: .85rem; }
td.details { overflow-wrap: anywhere; max-width: 28rem; }
.pill { display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgba(255, 255, 255, .1); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .12); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.stat { border-radius: var(--radius); padding: 1.05rem 1.15rem; display: flex; flex-direction: column; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.stat:hover { border-color: rgba(127, 220, 255, .4); box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .7), 0 0 30px -10px rgba(127, 220, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }
.stat .num { font-size: 1.65rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.stat .label { color: var(--muted); font-size: .85rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.4rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }
ol.steps { padding-left: 1.2rem; }
ol.steps li { margin-bottom: .8rem; }
.qr { margin: .75rem 0; display: inline-block; padding: .6rem; background: #fff; border-radius: 12px; line-height: 0; }
code.key { font-size: 1.05rem; background: rgba(59, 130, 246, .2); padding: .25rem .55rem; border-radius: 8px; letter-spacing: .05em; }
ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
ul.codes li { background: rgba(59, 130, 246, .16); border: 1px solid var(--info-line); padding: .5rem .75rem; border-radius: 12px; text-align: center; }
ul.codes code { font-size: 1.05rem; }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--ac); }
.pager { color: var(--muted); display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.message { display: block; margin: .3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
pre.secret { white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(4, 9, 20, .6); border: 1px solid var(--line-strong); border-radius: 12px; padding: .8rem 1rem; font-size: .85rem; }
progress { width: 100%; min-width: 120px; height: 10px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; -webkit-appearance: none; background: rgba(255, 255, 255, .14); accent-color: var(--ac-2); }
progress::-webkit-progress-bar { background: rgba(255, 255, 255, .14); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #3b82f6, #7fdcff); border-radius: 99px; transition: width .6s var(--ease); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #3b82f6, #7fdcff); border-radius: 99px; }
.bar { height: 10px; background: rgba(255, 255, 255, .14); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #7fdcff); }
.chart { display: block; width: 100%; height: 110px; margin: .25rem 0 1rem; fill: #7fdcff; opacity: .92; }
.filters a.button { text-decoration: none; }

/* ---------- motion: page entrance, top progress bar ---------- */
main > * { animation: rise .55s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .05s; }
main > *:nth-child(3) { animation-delay: .1s; }
main > *:nth-child(4) { animation-delay: .15s; }
main > *:nth-child(5) { animation-delay: .2s; }
main > *:nth-child(n+6) { animation-delay: .25s; }
.grid > .stat { animation: rise .55s var(--ease) both; }
.grid > .stat:nth-child(2) { animation-delay: .06s; }
.grid > .stat:nth-child(3) { animation-delay: .12s; }
.grid > .stat:nth-child(4) { animation-delay: .18s; }
.grid > .stat:nth-child(n+5) { animation-delay: .24s; }
.navbar-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 4000; background: linear-gradient(90deg, #3b82f6, #7fdcff, #fff); box-shadow: 0 0 12px var(--ac); opacity: 0; pointer-events: none; }
body.loading .navbar-progress { opacity: 1; width: 85%; transition: width 6s cubic-bezier(.1, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes popout { to { opacity: 0; transform: scale(.97); } }
@keyframes slide { from { opacity: 0; transform: translateX(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shk { 20%, 60% { translate: -7px 0; } 40%, 80% { translate: 7px 0; } }

/* ---------- sign-in and other pages without a session ---------- */
body.guest main { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 560px; padding: 24px 16px; }
body.guest main > * { width: 100%; }
body.guest footer { position: relative; z-index: 1; }
.guest-mark { display: grid; place-items: center; margin-bottom: 14px; width: auto !important; }
.logo { position: relative; width: 66px; aspect-ratio: 318 / 323; background: url("/static/img/klaidz-logo.webp") center / contain no-repeat; filter: drop-shadow(0 0 16px rgba(127, 220, 255, .45)); }
.logo::after { content: ""; position: absolute; inset: 0; -webkit-mask: url("/static/img/klaidz-logo.webp") center / contain no-repeat; mask: url("/static/img/klaidz-logo.webp") center / contain no-repeat; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) 100% 0 / 250% 100% no-repeat; animation: shine 4.5s 1.2s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0 0; } }
body.guest .card { position: relative; border-radius: 26px; padding: 2rem 2rem 1.6rem; background: linear-gradient(165deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025)), rgba(12, 26, 49, .72); -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%); box-shadow: 0 30px 80px -20px #000, inset 0 1px 0 rgba(255, 255, 255, .1); --mx: 50%; --my: 0%; margin-bottom: 1rem; }
body.guest .card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--a), rgba(255, 255, 255, .08) 0 55%, var(--ac) 80%, #fff 90%, rgba(255, 255, 255, .08)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin-a 8s linear infinite; pointer-events: none; }
body.guest .card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(380px circle at var(--mx) var(--my), rgba(127, 220, 255, .11), transparent 60%); pointer-events: none; }
@keyframes spin-a { to { --a: 360deg; } }
body.guest h1 { text-align: center; font-size: 1.9rem; }
body.guest .card > p.muted:last-child, body.guest .card > p.small { text-align: center; }
body.guest .notice.error { animation: shk .45s, slide .45s var(--ease) both; }
body.guest .card > *, body.guest .card form > * { animation: rise .7s var(--ease) both; }
body.guest .card > *:nth-child(2) { animation-delay: .1s; } body.guest .card > *:nth-child(3) { animation-delay: .17s; } body.guest .card > *:nth-child(4) { animation-delay: .24s; } body.guest .card > *:nth-child(n+5) { animation-delay: .3s; }
/* floating labels (sign-in forms) */
.f { position: relative; margin-top: 14px; }
.f input { height: 56px; padding: 22px 48px 6px 16px; border-radius: 14px; }
.f label { position: absolute; left: 16px; top: 17px; margin: 0; font-weight: 400; font-size: 1rem; color: var(--muted); pointer-events: none; transform-origin: left; transition: transform .25s var(--ease), color .25s; }
.f input:focus + label, .f input:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.76); }
.f input:focus + label { color: var(--ac); }
.f .eye { position: absolute; right: 6px; top: 8px; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 10px; display: none; place-items: center; box-shadow: none; }
.f .eye:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: none; }
html.js .f .eye { display: grid; }
.eye .sl { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s; }
.eye.on .sl { stroke-dashoffset: 0; }
body.guest button.primary { width: 100%; height: 52px; margin-top: 1.1rem; border-radius: 15px; font-size: 1rem; }
body.guest .f + .f { margin-top: 12px; }
#net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .75; }

/* intro loader (sign-in pages, once per browser session, only with JavaScript) */
.loader { display: none; }
html.intro .loader { position: fixed; inset: 0; z-index: 2000; display: grid; place-content: center; justify-items: center; gap: 30px; transition: opacity .5s; }
html.intro .loader::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #0b1424, #04060b 72%); transition: opacity .7s .2s; }
html.intro .loader.out::before, html.intro .loader.out .rings, html.intro .loader.out .loader-info { opacity: 0; }
html.intro .loader .rings, html.intro .loader .loader-info { transition: opacity .5s; }
html.intro body.guest .card, html.intro body.guest .guest-mark .logo { opacity: 0; }
html.intro body.guest .card:not(.on) > *, html.intro body.guest .card:not(.on) form > * { animation: none; opacity: 0; }
.sub { text-align: center; margin: -.2rem 0 1rem; }
html.intro body.guest .card.on { opacity: 1; transition: opacity .8s; }
.loader-stage { position: relative; width: min(280px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.rings { position: absolute; inset: 0; fill: none; stroke-linecap: round; }
.rings circle { transform-box: fill-box; transform-origin: center; stroke: rgba(127, 220, 255, .35); stroke-width: .6; }
.rings .r1 { stroke-dasharray: 1 7; animation: spin 40s linear infinite; }
.rings .r2 { stroke-dasharray: 90 30 12 30; stroke: rgba(255, 255, 255, .4); animation: spin 12s linear infinite reverse; }
.rings .r3 { stroke-dasharray: 3 150; stroke-width: 2; animation: spin 3s linear infinite; }
#pr { stroke: var(--ac) !important; stroke-width: 1.6; stroke-dasharray: 616; stroke-dashoffset: 616; transform: rotate(-90deg); filter: drop-shadow(0 0 4px var(--ac)); animation: none !important; }
.lw { position: relative; width: 46%; aspect-ratio: 318 / 323; --p: 0; }
.lw b, .lw u { position: absolute; display: block; text-decoration: none; }
.lw b { inset: 0; background: url("/static/img/klaidz-logo.webp") center / contain no-repeat; }
.lw .gh { opacity: .13; filter: grayscale(1); }
.lw .fl { clip-path: inset(calc(100% - var(--p) * 1%) 0 0 0); filter: drop-shadow(0 0 14px rgba(127, 220, 255, .45)); }
.lw u { left: -16%; right: -16%; bottom: calc(var(--p) * 1%); height: 2px; background: linear-gradient(90deg, transparent, var(--ac), #fff, var(--ac), transparent); box-shadow: 0 0 14px 2px var(--ac); transition: opacity .3s; }
.lw.done u { opacity: 0; }
.loader-info { text-align: center; position: relative; }
.wm { font-weight: 300; font-size: 15px; letter-spacing: .6em; margin-right: -.6em; color: #dfe8f2; animation: wm 1.4s var(--ease) both; }
@keyframes wm { from { letter-spacing: 1.2em; opacity: 0; filter: blur(6px); } }
.st { margin-top: 12px; display: flex; justify-content: center; gap: 14px; font: 11px ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--muted); }
#pc { color: var(--ac); min-width: 4ch; text-align: left; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  main { padding: 1rem .8rem 2rem; }
  .card { padding: 1.1rem 1rem; border-radius: 16px; }
  h1 { font-size: 1.45rem; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { margin-top: .4rem; }
  body.guest .card { padding: 1.6rem 1.2rem 1.3rem; }
  body.guest h1 { font-size: 1.6rem; }
  th, td { padding: .6rem .65rem; }
  .head { align-items: flex-start; }
}
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; } .stat { padding: .85rem .9rem; } .stat .num { font-size: 1.35rem; } }
body.guest form + p { margin-top: 1.1rem; }
@media (max-height: 640px) { .guest-mark { display: none; } }

/* ---------- motion preferences, printing ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #net { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .stat, .table-wrap, .topbar, .notice, .savework-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 16, 32, .96); }
}
@media print {
  .bg, .topbar, .nav-backdrop, footer, button, .button, .confirm-save, #net, .loader, .navbar-progress, .skip { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .card, .stat, .table-wrap { background: #fff !important; color: #000 !important; border: 1px solid #999; box-shadow: none; backdrop-filter: none; }
  h1, h2, .stat .num, .who-name { color: #000 !important; }
  .muted, th { color: #333 !important; }
  main > *, .grid > .stat { animation: none !important; }
}

/* text that sits directly on the background (no panel behind it) */
@media screen { main > h1, .head h1, main > .sub, main > .lead, main > p.muted { text-shadow: 0 1px 2px rgba(2, 8, 20, .7), 0 0 18px rgba(2, 8, 20, .75); } }
