/* Aplikacja pracownika: jasne tło, kolory z logo, niebieskie przyciski. Bez trybu ciemnego. */
:root {
    color-scheme: light;
    --bg: #f4f4f1; --card: #fff; --text: #1e2428; --muted: #5b6770; --line: #d9dcdd;
    --brand: #1d5fa6; --btn: #1d5fa6; --btn-hover: #154c88;
    --ok: #2d6a4f; --ok-bg: #e8f3ed; --err: #b3261e; --err-bg: #fbeceb; --info: #274459; --info-bg: #eef3f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }

.screen {
    min-height: 100vh; min-height: 100dvh;
    max-width: 480px; margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.screen:has(.bar) { justify-content: flex-start; }

.bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px; }
.bar strong { color: var(--brand); letter-spacing: .12em; }
.bar form { margin: 0; }
.bar-actions { display: flex; align-items: center; gap: 14px; }
/* .link-btn (Zmień hasło) wygląda jak delikatny przycisk, patrz blok "Linki pomocnicze" niżej */

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 24px 20px; text-align: center; box-shadow: 0 1px 3px rgba(30, 36, 40, .06);
}
.card.left { text-align: left; }
.card h1 { margin: 6px 0 4px; font-size: 24px; color: var(--brand); letter-spacing: .06em; }
.card.left h1 { color: var(--text); letter-spacing: normal; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.logo { display: block; width: 220px; max-width: 80%; height: auto; margin: 0 auto 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 8px 0; }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; text-align: left; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input[type=email], input[type=password], input[type=text] {
    width: 100%; padding: 13px 14px; font: inherit; font-size: 16px; /* 16px: iOS nie przybliża pola */
    border: 1px solid #b9bfc2; border-radius: 10px; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid #8fb3d9; outline-offset: 1px; border-color: var(--btn); }

/* Tytuły stron, formularzy i sekcji oraz przyciski: wielkie litery */
h1, h2, h3 { text-transform: uppercase; }
.badge-on { background: var(--ok-bg); color: var(--ok); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
button, .btn {
    text-transform: uppercase; letter-spacing: .03em;
    display: inline-block; padding: 13px 18px; border: 0; border-radius: 10px;
    background: var(--btn); color: #fff; font: inherit; font-weight: 600; text-align: center;
    text-decoration: none; cursor: pointer; width: 100%;
}
button:hover, .btn:hover { background: var(--btn-hover); }
button:disabled { opacity: .45; cursor: not-allowed; background: var(--btn); }
.links { margin-top: 14px; }
a { color: var(--btn); text-decoration: none; }
a.btn { color: #fff; }

/* Linki pomocnicze (Wróć, Zmień hasło, Wyloguj...) jako delikatne przyciski, bez podkreślenia */
.link-btn, button.link, .links a, p > a:not(.btn) {
    display: inline-block; width: auto; padding: 8px 16px;
    background: #eef4fb; color: var(--btn); border: 1px solid #c9dbee; border-radius: 10px;
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; cursor: pointer;
}
.link-btn:hover, button.link:hover, .links a:hover, p > a:not(.btn):hover { background: #e1ecf8; color: var(--btn-hover); }

.alert { padding: 10px 12px; border-radius: 10px; margin: 12px 0; text-align: left; font-size: 15px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.info { background: var(--info-bg); color: var(--info); }

button.secondary { background: transparent; color: var(--btn); border: 2px solid var(--btn); }
button.secondary:hover { background: #eef4fb; }
.actions2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
@media (max-width: 360px) { .actions2 { grid-template-columns: 1fr; } }
.status { font-size: 18px; margin: 4px 0; }
.status.in { color: var(--ok); font-weight: 700; }
.status.in::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2d6a4f; margin-right: 8px; }
.card.left > button, .card.left > form > button { margin-top: 10px; }

.list { list-style: none; margin: 10px 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }

/* Ostatnie odbicia: rozpoczęcie pracy = zielone tło, zakończenie pracy = niebieskie (jak w rejestrze w panelu firmy) */
.list li.row-leave, .list li.row-sick { border-top: 0; border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.list li.row-leave { background: #e8f0f9; }
.list li.row-sick  { background: #fdf3de; }
.list li.row-in, .list li.row-out { border-top: 0; border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.list li.row-in  { background: #eaf5ee; }
.list li.row-out { background: #e8f0f9; }

/* skaner QR na pełnym ekranie (ciemny, bo to podgląd z aparatu) */
.scanner { position: fixed; inset: 0; z-index: 20; background: #000; display: grid; place-items: center; }
.scanner[hidden] { display: none; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
    position: relative; width: min(70vw, 320px); aspect-ratio: 1; border-radius: 18px;
    border: 3px solid #fff; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
}
.scan-title { position: absolute; top: max(24px, env(safe-area-inset-top)); left: 16px; right: 16px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 4px #000; }
.scan-cancel { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: auto; padding: 12px 28px; background: var(--btn); color: #fff; }

/* Strona instalacji aplikacji (instaluj.php) */
.install-box { margin: 14px 0 6px; text-align: left; }
.steps { text-align: left; margin: 14px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.steps li { margin: 8px 0; }

.net { position: sticky; top: 0; z-index: 5; background: #a66a00; color: #fff; text-align: center; padding: 6px; font-size: 14px; }
.net[hidden] { display: none; }

/* WERSJA DEMO: symulacja skanu kodu QR i wskazówka nad przyciskami */
.scan-demo { position: absolute; bottom: calc(max(28px, env(safe-area-inset-bottom)) + 64px); left: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.scan-demo select { width: auto; max-width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; font-size: 15px; }
.scan-demo button { width: auto; padding: 12px 22px; background: #ffea6c; color: #1c1917; font-weight: 700; }
.demo-wskazowka { font-size: 14px; }
.scanner.demo-bez-aparatu { background: #1f272c; }
#punch-msg { white-space: pre-line; }   /* WERSJA DEMO: uwagi demo w nowych liniach */
.scanner { top: var(--demo-pasek-h, 0px); }   /* WERSJA DEMO: okno aparatu pod paskiem demo */
