/* Golden PM — Golden A/S project managers app. House style: navy, gold, green (copy of the Service app css + PM additions below) */
:root {
  --navy: #1F3A5F; --gold: #C9A227; --green: #2E7D32; --red: #B23A3A; --amber: #D98E04;
  --grey: #6B7280; --light: #EEF1F5; --line: #D0D5DD; --bg: #FFFFFF; --text: #222;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 Aptos, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overscroll-behavior-y: none; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

.hdr { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; padding: calc(var(--sat) + 10px) 12px 10px; display: flex; align-items: center; border-bottom: 3px solid var(--gold); }
.hdr-btn { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; width: 40px; height: 36px; visibility: hidden; }
.hdr-btn.show { visibility: visible; }
.hdr-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.badge { background: var(--gold); color: var(--navy); font-weight: 700; font-size: 12px; border-radius: 12px; padding: 3px 10px; min-width: 40px; text-align: center; }

.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--grey); padding: 8px 20px 0; }
.sync .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.sync.offline .dot { background: var(--amber); } .sync.error .dot { background: var(--red); }

main { flex: 1; padding: 12px 16px calc(84px + var(--sab)); }
h2 { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--grey); margin: 18px 0 8px; }
h1 { font-size: 20px; color: var(--navy); margin: 8px 0 12px; }
p.muted, .muted { color: var(--grey); font-size: 13px; }

.card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 18px; margin-bottom: 10px; background: #fff; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 10px 0 0 10px; background: var(--c, var(--navy)); }
.card .t { font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; align-items: baseline; }
.card .t small { font-size: 11px; font-weight: 700; color: var(--c, var(--navy)); }
.card .s { font-size: 13px; color: #333; margin-top: 2px; }
.card.tap { cursor: pointer; } .card.tap:active { background: var(--light); }
.c-red { --c: var(--red); } .c-amber { --c: var(--amber); } .c-green { --c: var(--green); } .c-grey { --c: var(--grey); } .c-gold { --c: var(--gold); }

.stats { display: flex; gap: 8px; }
.stats div { flex: 1; background: var(--light); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stats b { display: block; font-size: 22px; color: var(--navy); } .stats b.gold { color: var(--gold); } .stats b.green { color: var(--green); }
.stats span { font-size: 11px; color: var(--grey); }

label { display: block; font-size: 12px; color: var(--grey); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 10px; border: 1px solid var(--line); border-radius: 8px; background: #F7F8FA; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); background: #fff; }
input[readonly] { color: var(--grey); }
textarea { min-height: 84px; resize: vertical; }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; min-width: 0; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #E5E8EE; font-size: 14px; }
.kv b { color: var(--navy); } .kv .v { text-align: right; max-width: 60%; }
.kv.lock .v { color: var(--grey); }

.btn { display: block; width: 100%; border: 0; border-radius: 10px; padding: 13px; font: inherit; font-weight: 700; font-size: 15px; margin: 12px 0; cursor: pointer; }
.btn.gold { background: var(--gold); color: var(--navy); } .btn.navy { background: var(--navy); color: #fff; }
.btn.line { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.red { background: var(--red); color: #fff; } .btn:disabled { opacity: .45; }
.btn.sm { padding: 8px; font-size: 13px; margin: 6px 0; }

.seg { display: flex; background: var(--light); border-radius: 18px; padding: 2px; margin: 8px 0; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-weight: 700; font-size: 13px; color: var(--navy); padding: 8px 4px; border-radius: 16px; }
.seg button.on { background: var(--navy); color: #fff; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos .ph, .photos .add { width: 72px; height: 72px; border-radius: 8px; background: #D9DEE6; overflow: hidden; position: relative; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 2px; right: 2px; border: 0; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; }
.photos .add { background: #fff; border: 1.5px solid var(--gold); color: var(--gold); font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.photos input { display: none; }

.sigbox { border: 1px solid var(--navy); border-radius: 8px; background: #FBFBFC; position: relative; }
.sigbox canvas { width: 100%; height: 150px; display: block; touch-action: none; }
.sigbox .clr { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--grey); background: none; border: 0; }
.sigbox .lbl { position: absolute; left: 10px; bottom: 6px; font-size: 11px; color: var(--grey); }

.bar { margin: 6px 0 10px; } .bar .l { display: flex; justify-content: space-between; font-size: 13px; } .bar .l b { color: var(--navy); }
.bar .tr { height: 12px; border-radius: 6px; background: var(--light); overflow: hidden; display: flex; margin-top: 4px; }
.bar .tr i { display: block; height: 100%; background: var(--green); } .bar .tr i.over { background: var(--navy); } .bar .tr i.extra { background: var(--gold); }
.note { background: #FBF7E8; border: 1px solid var(--gold); border-radius: 8px; padding: 10px; font-size: 13px; color: var(--navy); margin: 8px 0; }
.note.red { background: #FBECEC; border-color: var(--red); color: var(--red); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--sab); z-index: 10; }
.tabs a { flex: 1; text-align: center; text-decoration: none; color: var(--grey); font-size: 10px; padding: 8px 0 6px; }
.tabs a i { display: block; width: 20px; height: 14px; border-radius: 3px; background: var(--grey); margin: 0 auto 4px; }
.tabs a.on { color: var(--navy); font-weight: 700; } .tabs a.on i { background: var(--navy); }

.login { padding-top: 24px; } .login img { width: 200px; display: block; margin: 10px auto 24px; }
.lang { display: flex; gap: 6px; } .lang button { flex: 1; border: 0; background: var(--light); color: var(--navy); font-weight: 700; padding: 8px 0; border-radius: 14px; font: inherit; font-size: 13px; }
.lang button.on { background: var(--navy); color: #fff; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + var(--sab)); background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 10px; font-size: 14px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.list-empty { text-align: center; color: var(--grey); padding: 30px 0; font-size: 14px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--light); color: var(--navy); margin-right: 4px; }
.chip.green { background: #E3F1E4; color: var(--green); } .chip.amber { background: #FBF0D9; color: var(--amber); } .chip.red { background: #F6E0E0; color: var(--red); } .chip.grey { color: var(--grey); }
.search { margin: 6px 0; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; display: flex; align-items: flex-end; }
.sheet .in { background: #fff; width: 100%; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + var(--sab)); max-height: 85vh; overflow: auto; }
.sheet h3 { margin: 0 0 8px; color: var(--navy); font-size: 16px; }
.opt { padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; cursor: pointer; }
.opt.on { border-color: var(--navy); background: var(--light); } .opt b { color: var(--navy); display: block; } .opt span { font-size: 12px; color: var(--grey); }
.week td, .week th { padding: 6px 4px; font-size: 13px; text-align: right; } .week th { color: var(--grey); font-weight: 400; } .week td:first-child, .week th:first-child { text-align: left; }
table.week { width: 100%; border-collapse: collapse; } .week tr { border-bottom: 1px solid #E5E8EE; }
.lockicon::after { content: " \1F512"; font-size: 11px; }
@media (min-width: 700px) { main { max-width: 640px; margin: 0 auto; width: 100%; } .tabs { left: 50%; transform: translateX(-50%); max-width: 640px; } }

.overflow { overflow-x: auto; }
.task label { margin-top: 12px; }
.row2 > button, .row2 > .btn { flex: 0 0 auto; width: auto; }
.row2 > input[type=time] { min-width: 0; padding-left: 6px; padding-right: 2px; }

.ai-btn { background: #FBF7E8; color: var(--navy); border: 1px solid var(--gold); border-radius: 12px; font: inherit; font-size: 11px; font-weight: 700; padding: 3px 9px; margin: 4px 0 0; cursor: pointer; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; } .ai-actions .btn { width: auto; margin: 0; flex: 1 1 45%; }
.ai-out { background: var(--light); border-radius: 10px; padding: 10px 12px; margin-top: 10px; } .ai-text { font-size: 14px; white-space: normal; }
.hdr-ai { background: none; border: 0; color: var(--gold); font-size: 20px; width: 36px; height: 36px; margin-right: 4px; }
/* v0.5.0 */
.txt{font-size:14px;white-space:pre-wrap;margin:4px 0 8px}
.item .t{display:flex;align-items:center}
.item .t .in{font-weight:700;color:var(--navy)}
.qa .qq{font-weight:600}

/* ======================================================================== Golden PM 1.0.0 additions */
/* tab glyphs (CSS only, no emoji) and badges */
.tabs a { position: relative; }
.tabs a i.g-home { width: 18px; height: 14px; border-radius: 2px 2px 3px 3px; clip-path: polygon(50% 0, 100% 45%, 100% 100%, 0 100%, 0 45%); }
.tabs a i.g-proj { width: 20px; height: 14px; background: none; border-top: 4px solid var(--grey); border-bottom: 4px solid var(--grey); box-shadow: inset 0 -4px 0 -0px transparent; position: relative; }
.tabs a i.g-proj::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: var(--grey); }
.tabs a.on i.g-proj { border-color: var(--navy); } .tabs a.on i.g-proj::after { background: var(--navy); }
.tabs a i.g-team { width: 20px; height: 14px; background: none; position: relative; }
.tabs a i.g-team::before, .tabs a i.g-team::after { content: ""; position: absolute; bottom: 0; width: 9px; height: 9px; border-radius: 50% 50% 2px 2px; background: var(--grey); }
.tabs a i.g-team::before { left: 0; } .tabs a i.g-team::after { right: 0; height: 12px; width: 10px; }
.tabs a.on i.g-team::before, .tabs a.on i.g-team::after { background: var(--navy); }
.tabs a i.g-appr { width: 14px; height: 14px; border-radius: 3px; background: none; border: 3px solid var(--grey); position: relative; }
.tabs a i.g-appr::after { content: ""; position: absolute; left: 1px; top: -1px; width: 4px; height: 7px; border: solid var(--grey); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.tabs a.on i.g-appr { border-color: var(--navy); } .tabs a.on i.g-appr::after { border-color: var(--navy); }
.tabs a i.g-more { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; margin-bottom: 8px; box-shadow: -8px 0 0 var(--grey), 8px 0 0 var(--grey); }
.tabs a.on i.g-more { box-shadow: -8px 0 0 var(--navy), 8px 0 0 var(--navy); }
.tbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; text-align: center; }

/* process line — same reading as the portal's process_line(): 7 segments, done / active / todo / N/A (hatched), fed = read-only */
.stepper { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0; }
.stp { position: relative; overflow: hidden; height: 46px; border-radius: 8px; background: #EEF1F4; border: 1px solid #DCE2E8; display: flex; align-items: center; justify-content: center; }
.stp-fill { position: absolute; inset: 0 auto 0 0; display: block; background: var(--gold); transition: width .3s ease; }
.stp--done .stp-fill { background: var(--green); } .stp--done { border-color: var(--green); } .stp--active { border-color: var(--gold); }
.stp-txt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; width: 100%; padding: 0 2px; }
.stp-txt b { font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stp-txt em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--navy); margin-top: 2px; }
.stp--done .stp-txt b, .stp--done .stp-txt em { color: #fff; } .stp--todo .stp-txt b, .stp--todo .stp-txt em { color: #6B7280; }
.stp--na { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(107,114,128,.14) 6px 8px); border-style: dashed; }
.stp--na .stp-txt b, .stp--na .stp-txt em { color: #6B7280; }
.stp--fed::after { content: ""; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 2px; color: var(--navy); opacity: .7; z-index: 1; }
.stp--fed.stp--done::after { color: #fff; }
.stp.tap { cursor: pointer; } .stp.tap:active { filter: brightness(.95); }
.stepper--compact { gap: 2px; margin: 4px 0; } .stepper--compact .stp { height: 18px; border-radius: 4px; }
.stepper--compact .stp-txt b { font-size: 7px; letter-spacing: 0; } .stepper--compact .stp-txt em { display: none; }
.stepper--compact .stp--fed::after { width: 4px; height: 4px; right: 2px; top: 2px; }
.stp--queued { box-shadow: 0 0 0 2px var(--amber) inset; } .stp--conflict { box-shadow: 0 0 0 2px var(--red) inset; }

/* overall pill */
.opill { display: inline-flex; align-items: center; gap: 8px; }
.opill i { position: relative; width: 72px; height: 8px; border-radius: 999px; background: #E6EAEE; overflow: hidden; display: block; }
.opill i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--gold); border-radius: 999px; }
.opill--done i::after { background: var(--green); }
.opill span { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; color: var(--navy); min-width: 34px; text-align: right; }
.opill--done span { color: var(--green); } .opill--todo span { color: #8A96A3; }

/* project rows & tree */
.prow .t { align-items: center; } .prow .t .code { font-variant-numeric: tabular-nums; }
.prow .sub { font-size: 13px; color: #333; margin-top: 2px; }
.tree .lvl2 { margin-left: 14px; }
.tree .card { padding-left: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chips .chip { margin: 0; }
.chip.navy { background: var(--navy); color: #fff; } .chip.gold { background: var(--gold); color: var(--navy); }
.chip.on { outline: 2px solid var(--navy); }
.chip.tap { cursor: pointer; }

/* KPI tiles — 2 × 2 */
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi div { background: var(--light); border-radius: 10px; padding: 12px 10px; text-align: center; cursor: pointer; }
.kpi div:active { background: #E2E7EE; }
.kpi b { display: block; font-size: 26px; color: var(--navy); line-height: 1.1; } .kpi b.red { color: var(--red); } .kpi b.gold { color: var(--gold); } .kpi b.green { color: var(--green); }
.kpi span { font-size: 11px; color: var(--grey); }

/* stepper sheet (% options) */
.pct-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.pct-opts button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 14px 0; font: inherit; font-weight: 700; font-size: 16px; color: var(--navy); }
.pct-opts button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pct-opts button.na { background: repeating-linear-gradient(135deg, #fff 0 6px, rgba(107,114,128,.14) 6px 8px); border-style: dashed; }
.pct-opts button.na.on { background: var(--grey); color: #fff; }

/* absence matrix (today → +28 days), horizontal scroll */
.matrix { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 6px -16px; padding: 0 16px; }
.matrix table { border-collapse: separate; border-spacing: 2px; font-size: 10px; }
.matrix th { font-weight: 400; color: var(--grey); text-align: center; padding: 0 1px; min-width: 22px; white-space: nowrap; }
.matrix th.wk { color: var(--navy); }
.matrix th.name, .matrix td.name { position: sticky; left: 0; background: #fff; text-align: left; font-size: 12px; font-weight: 700; color: var(--navy); padding-right: 8px; white-space: nowrap; min-width: 110px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.matrix td { width: 22px; height: 22px; border-radius: 4px; background: var(--light); text-align: center; font-weight: 700; color: #fff; }
.matrix td.we { background: #E6EAEE; } .matrix td.today { outline: 2px solid var(--navy); outline-offset: -2px; }
.matrix td.approved, .matrix td.board { background: var(--green); } .matrix td.pending_mgr, .matrix td.pending_hr { background: var(--gold); color: var(--navy); }
.matrix .leg { display: flex; gap: 10px; font-size: 11px; color: var(--grey); margin: 4px 0 0; } .matrix .leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }

/* comments */
.cmt { border-radius: 10px; padding: 8px 12px; margin: 6px 0; background: var(--light); font-size: 14px; }
.cmt.ext { background: #FBF7E8; border: 1px solid var(--gold); }
.cmt .m { font-size: 11px; color: var(--grey); display: flex; justify-content: space-between; }
.cmt .m b { color: var(--navy); }
.composer { display: flex; gap: 8px; align-items: flex-end; } .composer textarea { min-height: 44px; flex: 1; } .composer .btn { width: auto; margin: 0; padding: 12px 14px; }

/* lists */
.kv .v.wrap { max-width: 70%; text-align: right; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; } .sec-h h2 { margin-bottom: 8px; } .sec-h a, .sec-h button.lnk { font-size: 12px; color: var(--navy); font-weight: 700; text-decoration: none; background: none; border: 0; font-family: inherit; }
.hdr-sub { font-size: 12px; color: var(--grey); margin-top: -8px; margin-bottom: 10px; }
.mark { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: middle; } .mark.red { background: var(--red); }
.totp input { font-size: 24px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.inbox .card.unread::before { background: var(--gold); } .inbox .card.read { opacity: .75; }
.greet { font-size: 20px; color: var(--navy); font-weight: 700; margin: 6px 0 2px; } .greet small { display: block; font-size: 13px; color: var(--grey); font-weight: 400; }
.week-h { font-size: 11px; color: var(--grey); letter-spacing: .5px; text-transform: uppercase; margin: 14px 0 6px; }

/* searchable picker (R72-009) */
.pk .in { display: flex; flex-direction: column; max-height: 80vh; }
.pk input[type=search] { margin-bottom: 8px; }
.pk-list { overflow: auto; flex: 1; min-height: 120px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
.pk-g { font-size: 11px; font-weight: 700; color: var(--grey); text-transform: uppercase; padding: 8px 12px 2px; }
.pk-it { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--light); padding: 12px; font: inherit; color: var(--text); }
.pk-it.on { color: var(--navy); font-weight: 700; box-shadow: inset 4px 0 0 var(--gold); }
.pk-it:active { background: var(--light); }
