/* jobjob frontend v1.0.1: färger och mått enligt godkänd mockup (v22). Inget mörkt läge i leverans 1 (O5). */
:root {
  --bg: #FAF9F5; --fg: #1C1C1A; --muted: #55554F; --line: #D9D7CF; --field: #B9B7AE;
  --acc: #1F5C4A; --acc2: #153D31; --today: #DCE9E2; --day: #ECF2EE; --err: #B42318;
  --off-bg: #D9D7CF; --off-fg: #6B6B66;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, sans-serif; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.center { align-items: center; justify-content: center; gap: 24px; padding: 24px; text-align: center; }

.btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; border: 0; border-radius: 10px; background: var(--acc); color: #fff; font-size: 16px; font-weight: 600; }
.btn:hover { background: var(--acc2); }
.btn:disabled { background: var(--off-bg); color: var(--off-fg); cursor: not-allowed; }
.btn.secondary { background: transparent; border: 1px solid var(--field); color: var(--fg); }
.btn.secondary:hover { background: var(--day); }
.center .btn { max-width: 420px; }

/* Inloggning */
.login { padding: calc(72px + env(safe-area-inset-top)) 24px 32px; gap: 24px; overflow-y: auto; width: 100%; max-width: 480px; margin: 0 auto; }
.logo-big { height: 120px; width: auto; align-self: center; display: block; }
.login h1 { margin: 24px 0 8px; font-size: 28px; font-weight: 700; line-height: 1.2; }
.login p { margin: 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font-size: 16px; color: var(--fg); }
.field input[aria-invalid="true"] { border-color: var(--err); }
.error { margin: 0; font-size: 14px; color: var(--err); }
.note { font-size: 14px; }
.sent { display: flex; flex-direction: column; gap: 16px; }
.sent p { color: var(--fg); }

/* Nattens träffar */
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 20px; flex-shrink: 0; border-bottom: 2px solid var(--acc); }
.logo-small { height: 44px; width: auto; display: block; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.heading { margin: 0; padding: 12px 24px 8px; font-size: 22px; font-weight: 700; line-height: 1.3; flex-shrink: 0; }
.daybar { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px; min-height: 52px; background: var(--day); flex-shrink: 0; }
.daybar.today { background: var(--today); }
.daylabel { font-size: 16px; font-weight: 600; }
.daybar.today .daylabel { font-size: 20px; font-weight: 700; }
.nav { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.nav.off { visibility: hidden; }

.banner { margin: 8px 24px 0; padding: 4px 4px 4px 12px; border: 1px solid var(--err); border-radius: 10px; background: #fff; color: var(--err); font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.banner button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--err); font-weight: 600; text-decoration: underline; }

.panels { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-top: 1px solid var(--line); margin-top: 8px; }
.panels::-webkit-scrollbar { display: none; }
.panel { flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: flex-start; gap: 4px; padding: 8px 24px 8px 12px; border-bottom: 1px solid var(--line); }
.check { flex: 0 0 44px; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; }
.box { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; line-height: 1; }
.box.empty { border: 2px solid var(--muted); background: #fff; }
.box.strong { background: var(--acc); color: #fff; }
.box.weak { border: 2px solid var(--acc); background: #fff; color: var(--acc); }
.info { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; min-width: 0; }
.title { font-size: 16px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.small { font-size: 13px; color: var(--muted); }
.empty-day { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px; text-align: center; }
.empty-day strong { font-size: 18px; font-weight: 600; }
.empty-day span { font-size: 14px; color: var(--muted); }

.send { flex-shrink: 0; padding: 16px 24px calc(32px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }

/* Meny och dialog */
.overlay { position: fixed; inset: 0; background: rgba(28, 28, 26, 0.35); z-index: 10; }
.overlay.dark { background: rgba(28, 28, 26, 0.45); }
.menu { position: fixed; top: calc(60px + env(safe-area-inset-top)); right: 12px; width: 240px; padding: 4px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); z-index: 11; }
.menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 48px; padding: 0 16px; border: 0; background: transparent; text-align: left; font-size: 16px; }
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item[aria-disabled="true"] { color: var(--off-fg); cursor: default; }
.soon { font-size: 13px; }
.dialog { position: fixed; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); max-width: 420px; margin: 0 auto; padding: 24px; background: #fff; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; z-index: 11; }
.dialog h2 { margin: 0; font-size: 20px; font-weight: 700; }
.dialog p { margin: 0; font-size: 15px; color: var(--muted); }
.dialog .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.send-dialog { align-items: center; text-align: center; }
.send-dialog h2 { margin-top: 8px; }
.send-dialog .actions { width: 100%; }
.spinner { width: 36px; height: 36px; box-sizing: border-box; border: 4px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: spin 1s linear infinite; }
.done-mark { width: 36px; height: 36px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.send-days { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; border-top: 1px solid var(--line); }
.send-days li { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
