/* GeoAttend Pro — staff portal (mobile-first) */
.portal-body { background: #e9edf5; min-height: 100vh; }
html.dark .portal-body { background: #050a16; }
@media (min-width: 560px) {
  .portal-body { background: radial-gradient(circle at 20% 10%, rgba(249,115,22,.16), transparent 40%), linear-gradient(160deg, #06112b, #10306e); padding: 28px 0; }
  .phone { border-radius: 34px; box-shadow: 0 40px 90px rgba(0,0,0,.45); overflow: hidden; min-height: calc(100vh - 56px); }
}
.phone { max-width: 440px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; padding-bottom: 86px; }

.p-head { background: linear-gradient(160deg, #081636 0%, #0f2a5f 60%, #17407f 100%); color: #fff; padding: 22px 20px 70px; position: relative; overflow: hidden; }
.p-head::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.35), transparent 65%); }
.p-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.p-top .avatar { border: 2px solid rgba(255,255,255,.35); }
.p-hi { font-size: .78rem; color: rgba(255,255,255,.6); }
.p-name { font-weight: 800; font-size: 1.05rem; }
.p-top form { margin-left: auto; }
.p-iconbtn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.p-shift { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.p-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 600; padding: 6px 11px; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.88); }
.p-date { position: relative; z-index: 1; margin-top: 16px; }
.p-date .t { font-size: 2.4rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.p-date .d { font-size: .82rem; color: rgba(255,255,255,.6); margin-top: 6px; }

.p-body { padding: 0 16px; margin-top: -52px; position: relative; z-index: 2; }
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 10px 30px rgba(15,23,42,.08); padding: 20px; margin-bottom: 14px; }

/* Clock button */
.clock-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; }
.clock-btn { width: 178px; height: 178px; border-radius: 50%; border: 0; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; font-family: inherit; transition: transform .15s, box-shadow .2s; }
.clock-btn:active { transform: scale(.96); }
.clock-btn i { font-size: 2.6rem; }
.clock-btn .lbl { font-weight: 900; font-size: 1.15rem; letter-spacing: .01em; }
.clock-btn .sub { font-size: .7rem; opacity: .8; font-weight: 600; }
.clock-btn.in { background: radial-gradient(circle at 30% 25%, #34d399, #059669); box-shadow: 0 16px 40px rgba(16,185,129,.45), 0 0 0 10px rgba(16,185,129,.12); }
.clock-btn.out { background: radial-gradient(circle at 30% 25%, #fb923c, #ea580c); box-shadow: 0 16px 40px rgba(234,88,12,.4), 0 0 0 10px rgba(249,115,22,.12); }
.clock-btn.done, .clock-btn:disabled { background: radial-gradient(circle at 30% 25%, #94a3b8, #64748b); box-shadow: 0 10px 30px rgba(100,116,139,.35), 0 0 0 10px rgba(100,116,139,.1); cursor: not-allowed; }
.clock-btn.locked { background: radial-gradient(circle at 30% 25%, #f87171, #dc2626); box-shadow: 0 16px 40px rgba(220,38,38,.35), 0 0 0 10px rgba(239,68,68,.12); }
.clock-btn .ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.clock-btn.in .ring, .clock-btn.out .ring { color: rgba(255,255,255,.0); }
.clock-state { margin-top: 18px; text-align: center; font-size: .86rem; color: var(--text-2); font-weight: 600; }

/* Geofence status */
.geo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 18px; }
.geo .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.geo.wait .ic { background: #e0e7ff; color: #4338ca; }
.geo.ok .ic { background: #d1fae5; color: #047857; }
.geo.bad .ic { background: #fee2e2; color: #b91c1c; }
.geo .t { font-weight: 700; font-size: .84rem; }
.geo .s { font-size: .74rem; color: var(--muted); margin-top: 1px; }
.geo .dist { margin-left: auto; text-align: right; }
.geo .dist .v { font-weight: 900; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.geo .dist .k { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
#pMap { height: 170px; border-radius: 16px; margin-top: 12px; border: 1px solid var(--border); z-index: 0; }

/* Timeline + stats */
.tl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tl > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 10px; text-align: center; }
.tl .k { font-size: .62rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tl .v { font-size: 1rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.p-sec { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 4px 10px; }
.notice { display: flex; gap: 12px; padding: 14px; border-radius: 16px; font-size: .82rem; line-height: 1.5; margin-bottom: 14px; }
.notice i { margin-top: 2px; }
.notice.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.notice.bad { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.notice.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 20px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd5e1; transition: all .15s; }
.pin-dots span.on { background: #0f2a5f; border-color: #0f2a5f; transform: scale(1.1); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { height: 58px; border-radius: 16px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 1.35rem; font-weight: 700; color: #0f172a; cursor: pointer; font-family: inherit; }
.pin-pad button:active { background: #e2e8f0; }
.pin-pad button.fn { font-size: .95rem; color: #64748b; background: transparent; border-color: transparent; }

/* Tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 30; }
@media (min-width: 560px) { .tabbar { bottom: 28px; border-radius: 0 0 34px 34px; } }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; color: var(--muted) !important; padding: 6px 0; border-radius: 12px; }
.tabbar a i { font-size: 1.15rem; }
.tabbar a.active { color: var(--pr) !important; }
html.dark .tabbar a.active { color: #8fb0ff !important; }

/* Simple page header for inner portal pages */
.p-page { padding: 22px 18px 8px; }
.p-page h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.p-page p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.p-list { list-style: none; margin: 0; padding: 0; }
.p-list li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.p-list li:last-child { border-bottom: 0; }
.p-date-box { width: 46px; height: 50px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.p-date-box .dd { font-weight: 900; font-size: 1.05rem; line-height: 1; }
.p-date-box .mm { font-size: .6rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* Portal login */
.p-login-hero { background: linear-gradient(160deg, #081636 0%, #0f2a5f 60%, #17407f 100%); color: #fff; padding: 64px 26px 90px; text-align: center; position: relative; overflow: hidden; }
.p-login-hero::after { content: ''; position: absolute; left: 50%; top: -80px; width: 320px; height: 320px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.3), transparent 65%); }
.p-login-hero > * { position: relative; z-index: 1; }
.p-login-hero > .p-home { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff !important; font-size: .78rem; font-weight: 600; text-decoration: none; }
.p-login-hero > .p-home:hover { background: rgba(255,255,255,.2); }
.p-login-logo { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; background: linear-gradient(135deg, #f97316, #fb923c); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; box-shadow: 0 14px 30px rgba(249,115,22,.4); overflow: hidden; }
.p-login-logo img { width: 100%; height: 100%; object-fit: cover; }
.p-login-hero h1 { color: #fff; font-size: 1.45rem; font-weight: 900; margin: 0; }
.p-login-hero p { color: rgba(255,255,255,.62); font-size: .86rem; margin: 6px 0 0; }
.p-login-card { margin: -58px 16px 0; position: relative; z-index: 2; }
.p-login-card .form-control { height: 50px; border-radius: 14px; font-size: .95rem; }
.p-login-card .btn-lg { width: 100%; height: 52px; border-radius: 14px; }

/* Separate Clock In / Clock Out tiles — only the valid one is enabled */
.clock-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.clock-tile { border: 0; border-radius: 22px; padding: 22px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; cursor: pointer; font-family: inherit; transition: transform .12s, box-shadow .2s; }
.clock-tile i { font-size: 2rem; width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.clock-tile .lbl { font-weight: 900; font-size: 1.1rem; }
.clock-tile .sub { font-size: .72rem; font-weight: 600; opacity: .85; }
.clock-tile:active { transform: scale(.97); }
.clock-tile.in { background: linear-gradient(145deg, #10b981, #047857); box-shadow: 0 14px 30px rgba(16,185,129,.35); }
.clock-tile.out { background: linear-gradient(145deg, #f97316, #c2410c); box-shadow: 0 14px 30px rgba(234,88,12,.32); }
.clock-tile.off { background: var(--surface-2); color: var(--muted); box-shadow: none; border: 1px dashed var(--border-strong); cursor: not-allowed; }
.clock-tile.off i { background: var(--border); }

/* ── Portal v2: app bar, hero, shift track, timeline, map chip, month ring ── */
.pp-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(6,18,46,.92); backdrop-filter: blur(10px); color: #fff; }
.pp-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: .88rem; min-width: 0; }
.pp-brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-logo { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #f97316, #fb923c); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.pp-logo img { width: 100%; height: 100%; object-fit: cover; }
.pp-icon { width: 36px; height: 36px; border-radius: 11px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; }

.pp-hero { background: radial-gradient(circle at 90% 0%, rgba(249,115,22,.35), transparent 45%), radial-gradient(circle at 0% 100%, rgba(16,185,129,.18), transparent 40%), linear-gradient(170deg, #06122e 0%, #0f2a5f 65%, #16397a 100%); color: #fff; padding: 18px 18px 74px; }
.pp-who { display: flex; align-items: center; gap: 13px; }
.pp-av { border: 3px solid rgba(255,255,255,.25); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.pp-hi { font-size: .76rem; color: rgba(255,255,255,.6); font-weight: 600; }
.pp-name { font-size: 1.12rem; font-weight: 800; line-height: 1.2; }
.pp-role { font-size: .72rem; color: rgba(255,255,255,.55); margin-top: 1px; }
.pp-time { margin-top: 22px; font-weight: 900; letter-spacing: -.03em; line-height: 1; display: flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.pp-time #ppClock { font-size: 3.2rem; }
.pp-time small { font-size: 1.4rem; color: rgba(255,255,255,.45); font-weight: 800; margin-left: 2px; }
.pp-time em { font-style: normal; font-size: 1rem; font-weight: 800; margin-left: 8px; color: #fdba74; }
.pp-date { font-size: .84rem; color: rgba(255,255,255,.6); margin-top: 6px; }
.pp-shift { margin-top: 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(6px); }
.pp-shift-top, .pp-shift-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .74rem; }
.pp-shift-top { font-weight: 700; color: rgba(255,255,255,.9); }
.pp-shift-foot { color: rgba(255,255,255,.6); margin-top: 8px; }
.pp-shift-foot strong { color: #fdba74; }
.pp-track { position: relative; height: 6px; border-radius: 99px; background: rgba(255,255,255,.14); margin-top: 10px; }
.pp-track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #10b981, #fbbf24); }
.pp-track i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 4px rgba(255,255,255,.2); }

.pp-body { padding: 0 14px; margin-top: -56px; position: relative; z-index: 2; }
.pp-actions { padding: 16px; }
.pp-tl { display: flex; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pp-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; width: 30%; flex-shrink: 0; }
.pp-step .dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--muted); font-size: .78rem; }
.pp-step.done .dot { background: #10b981; border-color: #10b981; color: #fff; }
.pp-step.now .dot { border-color: var(--pr); color: var(--pr); box-shadow: 0 0 0 5px var(--pr-soft); }
.pp-step .k { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); }
.pp-step .v { font-size: .9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pp-step .m { font-size: .66rem; font-weight: 700; margin-top: 1px; }
.pp-step .m.ok { color: #047857; } .pp-step .m.late { color: #b45309; }
.pp-line { flex: 1; height: 2px; background: var(--border); margin-top: 16px; border-radius: 2px; }
.pp-line.on { background: #10b981; }
.pp-penalty { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: .82rem; }
.pp-penalty i { margin-top: 3px; } .pp-penalty small { display: block; opacity: .8; margin-top: 2px; }
.pp-penalty .waived { color: #047857; font-weight: 700; }
html.dark .pp-penalty { filter: brightness(.85); }

.pp-loc { padding: 0; overflow: hidden; }
.pp-map-wrap { position: relative; }
.pp-map-wrap #pMap { height: 210px; border-radius: 0; margin: 0; border: 0; }
.pp-map-wrap .geo { position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; z-index: 500; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(15,23,42,.18); border: 0; }
html.dark .pp-map-wrap .geo { background: rgba(19,28,47,.94); }
.pp-map-wrap .geo .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pp-month { display: flex; gap: 16px; align-items: center; }
.pp-ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.pp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pp-ring circle { fill: none; stroke-width: 7; }
.pp-ring .bg { stroke: var(--surface-2); }
.pp-ring .fg { stroke: #10b981; stroke-linecap: round; transition: stroke-dasharray .6s; }
.pp-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pp-ring b { font-size: 1.35rem; font-weight: 900; line-height: 1; } .pp-ring span { font-size: .6rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.pp-mstats { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.pp-mstats div { display: grid; grid-template-columns: 18px 1fr; column-gap: 7px; align-items: center; }
.pp-mstats i { grid-row: span 2; font-size: .85rem; }
.pp-mstats b { font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; } .pp-mstats b small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.pp-mstats span { font-size: .66rem; color: var(--muted); font-weight: 600; }

/* Floating glass tab bar */
.tabbar { bottom: 12px; width: calc(100% - 24px); max-width: 416px; border-radius: 22px; border: 1px solid var(--border); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); box-shadow: 0 12px 34px rgba(15,23,42,.16); padding: 6px; }
html.dark .tabbar { background: rgba(19,28,47,.9); }
.tabbar a { border-radius: 16px; padding: 8px 0; }
.tabbar a.active { background: var(--pr-soft); }
@media (min-width: 560px) { .tabbar { bottom: 40px; border-radius: 22px; } }
.phone { padding-bottom: 100px; }

/* ══ Desktop / tablet interface (html.ui-desktop — set by device detection in layouts/portal.php) ══ */
.ps-side { display: none; }
html.ui-desktop .portal-body { background: var(--bg); padding: 0; }
html.ui-desktop .tabbar, html.ui-desktop .pp-bar { display: none; }

/* Sidebar */
html.ui-desktop .ps-side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30; color: #aab4cc; background: linear-gradient(180deg, #0b1733 0%, #0f1f45 100%); }
.ps-brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; }
.ps-brand .pp-logo { width: 40px; height: 40px; border-radius: 12px; }
.ps-brand .n { color: #fff; font-weight: 800; font-size: .92rem; line-height: 1.2; }
.ps-brand .s { font-size: .7rem; color: #7f8bab; }
.ps-me { display: flex; gap: 12px; align-items: center; margin: 4px 14px 14px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.ps-me .n { color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-me .s { font-size: .7rem; color: #7f8bab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-nav { flex: 1; padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.ps-nav a { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 11px; font-size: .86rem; font-weight: 600; color: #aab4cc !important; position: relative; }
.ps-nav a i { width: 18px; text-align: center; color: #7382a6; }
.ps-nav a:hover { background: rgba(255,255,255,.05); color: #fff !important; }
.ps-nav a.active { background: rgba(255,255,255,.09); color: #fff !important; }
.ps-nav a.active i { color: #f97316; }
.ps-nav a.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #f97316; }
.ps-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 6px; }
.ps-theme, .ps-out { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 11px; border: 0; background: transparent; color: #aab4cc; font: 600 .82rem inherit; font-family: inherit; cursor: pointer; }
.ps-theme:hover, .ps-out:hover { background: rgba(255,255,255,.06); color: #fff; }
.ps-pow { font-size: .66rem; color: #5f6b8a; padding: 6px 14px 0; }

/* Content column */
html.ui-desktop .phone { max-width: none; margin: 0; border-radius: 0; box-shadow: none; min-height: 100vh; padding-bottom: 36px; background: var(--bg); overflow: visible; }
html.ui-desktop body.signed-in .phone { margin-left: 264px; }

/* Home: wide hero + two-column dashboard */
html.ui-desktop .pp-hero { display: grid; grid-template-columns: minmax(0, 1fr) 440px; grid-template-rows: auto auto 1fr; column-gap: 40px; padding: 30px 40px 96px; }
html.ui-desktop .pp-who { grid-column: 1; }
html.ui-desktop .pp-time { grid-column: 1; margin-top: 18px; }
html.ui-desktop .pp-time #ppClock { font-size: 4rem; }
html.ui-desktop .pp-date { grid-column: 1; }
html.ui-desktop .pp-shift { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin-top: 0; padding: 18px 20px; }
html.ui-desktop .pp-shift-top { font-size: .86rem; }
html.ui-desktop .pp-shift-foot { font-size: .8rem; }
html.ui-desktop .pp-body { padding: 0 40px; margin-top: -64px; max-width: 1360px; }
html.ui-desktop .pp-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
html.ui-desktop .pp-actions { padding: 22px; }
html.ui-desktop .clock-tile { padding: 30px 14px 24px; }
html.ui-desktop .clock-tile i { width: 72px; height: 72px; font-size: 2.2rem; }
html.ui-desktop .clock-tile .lbl { font-size: 1.25rem; }
html.ui-desktop .pp-map-wrap #pMap { height: 300px; }
html.ui-desktop .pp-col > .p-sec:first-child { margin-top: 0; }
html.ui-desktop .p-card { border-radius: 18px; }
html.ui-desktop .notice { max-width: 1360px; }

/* Inner pages (history, payslips, guide) */
html.ui-desktop .p-page { padding: 32px 40px 12px; max-width: 1180px; }
html.ui-desktop .p-page h1 { font-size: 1.6rem; }
html.ui-desktop .phone > div[style="padding:0 16px"], html.ui-desktop .phone > .sg { padding: 0 40px !important; max-width: 1180px; }
html.ui-desktop .pp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html.ui-desktop .pp-cards > .p-card { margin: 0; }
html.ui-desktop .sg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
html.ui-desktop .sg > .p-card { margin: 0; }
html.ui-desktop .sg > .p-card:first-child, html.ui-desktop .sg > p { grid-column: 1 / -1; }

/* Sheet dialogs (PIN / reason) become centred dialogs */
html.ui-desktop .modal-sheet { align-items: center; }
html.ui-desktop .sheet { border-radius: 24px; max-width: 400px; box-shadow: var(--shadow-lg); }
html.ui-desktop .sheet-grab { display: none; }

/* Signed-out screens (staff sign-in, parent lookup) */
html.ui-desktop body.signed-out { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; background: radial-gradient(circle at 15% 10%, rgba(249,115,22,.14), transparent 40%), linear-gradient(160deg, #06112b, #10306e); }
html.ui-desktop body.signed-out .phone { width: 100%; max-width: 760px; min-height: 0; border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.45); padding-bottom: 0; }
html.ui-desktop body.signed-out .phone:has(.p-login-hero) { max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; }
html.ui-desktop .p-login-hero { display: flex; flex-direction: column; justify-content: center; padding: 56px 44px; }
html.ui-desktop .p-login-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
html.ui-desktop body.signed-out .p-head { padding: 26px 28px 80px; }
html.ui-desktop body.signed-out .p-body { padding: 0 24px 28px; }

/* Tablet widths (portrait iPad, small laptops): icon-rail sidebar + single content column */
@media (max-width: 1099px) {
  html.ui-desktop .ps-side { width: 84px; }
  html.ui-desktop body.signed-in .phone { margin-left: 84px; }
  html.ui-desktop .ps-brand { justify-content: center; padding: 20px 0 14px; }
  html.ui-desktop .ps-brand > div, html.ui-desktop .ps-me, html.ui-desktop .ps-pow { display: none; }
  html.ui-desktop .ps-nav { padding: 6px 10px; }
  html.ui-desktop .ps-nav a { justify-content: center; font-size: 0; padding: 13px 0; gap: 0; }
  html.ui-desktop .ps-nav a i { font-size: 1.05rem; width: auto; }
  html.ui-desktop .ps-nav a.active::before { left: -10px; }
  html.ui-desktop .ps-theme, html.ui-desktop .ps-out { justify-content: center; font-size: 0; gap: 0; padding: 12px 0; }
  html.ui-desktop .ps-theme i, html.ui-desktop .ps-out i { font-size: 1rem; }
  html.ui-desktop .pp-hero { display: block; padding: 26px 30px 92px; }
  html.ui-desktop .pp-shift { margin-top: 20px; }
  html.ui-desktop .pp-body { padding: 0 30px; }
  html.ui-desktop .pp-grid { grid-template-columns: 1fr; }
  html.ui-desktop .p-page { padding: 28px 30px 10px; }
  html.ui-desktop .phone > div[style="padding:0 16px"], html.ui-desktop .phone > .sg { padding: 0 30px !important; }
  html.ui-desktop body.signed-out .phone:has(.p-login-hero) { grid-template-columns: 1fr; max-width: 520px; }
  html.ui-desktop .p-login-hero { padding: 40px 32px; }
}

/* Desktop: keep the month calendar a sensible size */
html.ui-desktop .heat { max-width: 520px; margin: 0 auto; }
html.ui-desktop .heat .c { font-size: .8rem; }
