/* Etigo mobile PWA (docs/plans/25-mobile-pwa.md). Hand-written, no Tailwind build: this app ships without a build step.
 * Visual language: "Leaf and Lagoon" (Cliff hotel design proposal, 2026-11-15) — soft mint ground, white rounded cards,
 * leaf-green primary, deep-teal header, Fraunces titles + Plus Jakarta Sans body, module accent colours with tints.
 * Light only on purpose. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --canvas: #ffffff; --canvas-soft: #e8f1ed; --hairline: #d8e5df; --bg: #f2f8f5;
  --leaf: #17834b; --leaf-b: #3cc273; --leaf-t: #daf4e5; --leaf-d: #0f6b3c; --deep: #0a2d2a; --deep2: #0b5b52;
  --r: 20px; --r-sm: 14px; --shadow: 0 1px 2px rgba(var(--shade),.06), 0 8px 24px rgba(var(--shade),.07);
  --ink: #0d2926; --ink-soft: #0f4540; --body: #44605a; --link: #0b7a85;
  --accent-blue: #2166c9; --accent-blue-tint: #e0ecfc;
  --accent-teal: #0b7a85; --accent-teal-tint: #d5f0f2;
  --accent-purple: #7a45c7; --accent-purple-tint: #ede2fa;
  --accent-orange: #c98a06; --accent-orange-tint: #fff0cc;
  --accent-red: #d9472f; --accent-red-tint: #ffe5df;
  --accent-green: #17834b; --accent-green-tint: #daf4e5;
  --accent-yellow: #f7d744; --accent-yellow-tint: #fef9e3;
  --success-fg: #0f6b3c; --success-bg: #daf4e5;
  --warning-fg: #7f5400; --warning-bg: #fff0cc;
  --danger-fg: #b02f1b; --danger-bg: #ffe5df;
  --badge-red: #d9472f;
  --font-sans: 'Plus Jakarta Sans', system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --tab-h: 58px;
  /* the few colours a palette also sets (Admin > Module Palettes writes a :root rule after this file; these are the defaults) */
  --btn-a: #1fa05b; --btn-b: #0f7a45; --pri-rgb: 23,131,75; --shade: 13,41,38; --hot-b: #ff7a66;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font-sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }

/* accent helpers: set data-color / .c-<name> on an element, children read --c and --c-tint */
.c-blue { --c: var(--accent-blue); --c-tint: var(--accent-blue-tint); }
.c-teal { --c: var(--accent-teal); --c-tint: var(--accent-teal-tint); }
.c-purple { --c: var(--accent-purple); --c-tint: var(--accent-purple-tint); }
.c-orange { --c: var(--accent-orange); --c-tint: var(--accent-orange-tint); }
.c-red { --c: var(--accent-red); --c-tint: var(--accent-red-tint); }
.c-green { --c: var(--accent-green); --c-tint: var(--accent-green-tint); }
.c-yellow { --c: var(--accent-yellow); --c-tint: var(--accent-yellow-tint); }

/* header = the web's page header: hairline underline, Playfair title */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 20px 18px; background: linear-gradient(160deg, var(--deep), var(--deep2)); color: #fff; border-radius: 0 0 24px 24px; }
.top h1 { flex: 1; min-width: 0; font: 600 24px/1.15 var(--font-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; min-width: 44px; min-height: 44px; margin: -8px; border: 0; background: none; color: inherit; padding: 0; text-decoration: none; }
.icon-btn .ico { width: 20px; height: 20px; }

.content { padding: 18px 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.pad { padding: 4px 0; display: grid; gap: 12px; }
.muted { color: var(--body); } .small { font-size: 13px; }
.error { color: var(--danger-fg); min-height: 1em; }
.ok { color: var(--success-fg); font-weight: 700; }
.empty { text-align: center; color: var(--body); padding: 48px 8px; }

/* section label = the web's <x-nav-section> heading */
.section { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--body); }
.count { background: var(--leaf-t); color: var(--leaf-d); padding: 0 8px; font-size: 11px; line-height: 18px; border-radius: 99px; }

/* cards: hairline box, no shadow, no radius */
.card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.line { color: var(--body); font-size: 13px; overflow-wrap: anywhere; }
.link-line { display: block; padding: 6px 0; color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.scan-video { border-radius: var(--r); width: 100%; max-height: 50dvh; background: #000; object-fit: cover; }
input[type="search"] { margin-bottom: 8px; }
.receipt { border-radius: var(--r-sm); max-width: 100%; max-height: 260px; border: 1px solid var(--hairline); justify-self: start; }
.receipt[hidden] { display: none; }
.clock-btn { margin-bottom: 10px; min-height: 56px; font-size: 16px; }
.btn { display: inline-grid; place-items: center; text-decoration: none; }
.btn.block { display: grid; }
a.btn.block { margin-bottom: 10px; }
.stamp { margin: 0 0 8px; font-size: 13px; color: var(--body); }
.stamp.warn { color: var(--warning-fg); background: var(--warning-bg); border-radius: var(--r-sm); padding: 6px 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.note { cursor: pointer; }
.note.unread { box-shadow: inset 4px 0 0 var(--leaf-b), var(--shadow); }
.note.unread h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--leaf-b); }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions .btn { flex: 1; }

/* buttons = web primary / secondary / danger buttons */
.btn { min-height: 46px; padding: 0 20px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--canvas); color: var(--ink); font: 700 14px/1 var(--font-sans); }
.btn:active { border-color: var(--leaf); }
.btn.primary { background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(var(--pri-rgb),.28); }
.btn.primary:active { background: var(--leaf-d); }
.btn.danger { color: var(--danger-fg); border-color: var(--danger-fg); background: var(--canvas); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }
.link { border: 0; background: none; color: var(--link); font: 700 13px var(--font-sans); padding: 8px; min-height: 44px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--canvas); color: var(--ink); font: inherit; font-weight: 400; font-size: 16px; /* 16px stops iOS zooming the page on focus */ }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-t); }
textarea { min-height: 80px; }

.banners { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 4; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px; background: var(--canvas-soft); font-size: 13px; }
.banner.warn { background: var(--warning-bg); color: var(--warning-fg); }
.banner.flash { border-radius: var(--r-sm); margin-bottom: 10px; }

/* bottom tab bar = the web sidebar, flattened: accent icon, ink label, tint + top rail when active */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--canvas); border-top: 1px solid var(--hairline); padding: 6px 8px env(safe-area-inset-bottom); }
.tab > span { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab { position: relative; flex: 1; min-height: calc(var(--tab-h) - 8px); display: grid; place-items: center; align-content: center; gap: 3px; color: var(--body); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: var(--r-sm); }
.tab .ico { color: var(--c, var(--body)); }
.tab.on { background: var(--c-tint, var(--leaf-t)); color: var(--c, var(--leaf-d)); font-weight: 800; }
.ico { width: 22px; height: 22px; flex: none; }
.badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 3px; border-radius: 99px; background: var(--badge-red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* More page: brand block + collapsible module sections, rows like the web's <x-nav-link> */
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 20px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); text-align: center; }
.brand img { width: 166px; max-width: 70%; height: auto; object-fit: contain; }
.brand span { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--body); }
.nav-sec { margin-top: 8px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 4px 0; margin-bottom: 0; border: 0; background: none; color: var(--body); font: 700 11px var(--font-sans); text-transform: uppercase; letter-spacing: .5px; text-align: left; min-height: 32px; }
.nav-head > span { display: flex; align-items: center; gap: 8px; }
.nav-head .ico { width: 15px; height: 15px; color: var(--c, var(--body)); }
.nav-head .chev { width: 12px; height: 12px; color: var(--body); transition: transform .15s; }
.nav-sec.shut .chev { transform: rotate(-90deg); }
.nav-sec.shut .nav-body { display: none; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.nav-link .ico { width: 17px; height: 17px; color: var(--c, var(--ink)); }
.nav-link > span { flex: 1; }
.nav-link:active { background: var(--canvas-soft); }
.badge.inline { position: static; }

.login { min-height: 100dvh; display: grid; align-content: center; gap: 16px; padding: 24px; max-width: 420px; margin: 0 auto; }
.login-brand { text-align: center; margin-bottom: 12px; }
.login-logo { height: 48px; width: auto; }
.login-tagline { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--body); }
.login-card { border: 1px solid var(--hairline); border-radius: 24px; box-shadow: var(--shadow); background: var(--canvas); padding: 24px; display: grid; gap: 18px; }
.login h1 { font: 600 26px/1.15 var(--font-display); letter-spacing: -.01em; }
.login-foot { text-align: center; font-size: 11px; color: var(--body); }
.login-form { display: grid; gap: 14px; }

.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(var(--shade), .45); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 85dvh; overflow: auto; background: var(--canvas); border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }

ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

/* calendar month grid */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.cal-name { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--body); }
.cal-cell { min-height: 46px; padding: 4px; border-radius: var(--r-sm); border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink); font: inherit; display: grid; place-items: center; gap: 2px; }
.cal-cell.blank { border: 0; background: none; }
.cal-cell.today { border-color: var(--leaf); color: var(--leaf-d); font-weight: 800; }
.cal-cell.sel { background: var(--leaf-t); border-color: var(--leaf); }
.cal-cell .dot { font-style: normal; font-size: 10px; min-width: 8px; min-height: 8px; background: var(--leaf); color: #fff; padding: 0 4px; border-radius: 99px; }

label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 400; }
label.check input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--leaf); }

a.card.with-avatar { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.center { display: flex; justify-content: center; margin-bottom: 12px; }
.avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--hairline); color: var(--body); display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.avatar.big { width: 96px; height: 96px; font-size: 32px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a.card.note { display: block; color: inherit; text-decoration: none; }

/* Mine | All switch (tasks, contacts) */
.seg { display: flex; margin-bottom: 12px; padding: 4px; gap: 2px; background: var(--canvas-soft); border-radius: var(--r-sm); }
.seg-btn { flex: 1; min-height: 40px; border: 0; background: transparent; color: var(--body); border-radius: 11px; font: 700 13px var(--font-sans); }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(var(--shade),.15); }

/* task comments (inside the task sheet) */
.comments { display: grid; gap: 8px; }
.comment { padding: 8px 12px; border-radius: var(--r-sm); background: var(--canvas-soft); }
.comment .line { font-weight: 700; margin-bottom: 2px; }

.line.overdue { color: var(--danger-fg); font-weight: 700; }
.line.overdue .pill { margin-left: 8px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* tasks: status + priority filters */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }

/* status pill + money rows (sales screens) = the web's <x-status-pill> */
.pill { display: inline-block; flex: none; padding: 3px 11px; border-radius: 99px; background: var(--canvas-soft); color: var(--body); font-size: 12px; font-weight: 700; }
.pill.success { color: var(--success-fg); background: var(--success-bg); }
.pill.warning { color: var(--warning-fg); background: var(--warning-bg); }
.pill.danger { color: var(--danger-fg); background: var(--danger-bg); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-between h3 { margin-bottom: 0; }
.total { font-weight: 700; color: var(--ink); font-size: 15px; }
.ink { color: var(--ink); }
.fin .section { margin-top: 16px; }
.fin .section:first-child { margin-top: 0; }
.fin-total { border-top: 2px solid var(--leaf); padding-top: 6px; margin-top: 4px; }
.tb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.tb-row span:nth-child(n+2) { text-align: right; min-width: 64px; }
.tb-row.total { border-bottom: 0; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-v { display: block; width: 100%; background: linear-gradient(180deg, var(--leaf-b), var(--leaf)); border-radius: 4px 4px 0 0; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 8px; margin: 6px 0; }
.bar-row b { text-align: right; }
.bar-track { display: block; height: 10px; border-radius: 99px; overflow: hidden; background: var(--canvas-soft); }
.bar-h { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--leaf-b), var(--leaf)); }
.prose { overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; margin: 18px 0 6px; }
.prose h2 { font-size: 21px; } .prose h3 { font-size: 18px; } .prose h4 { font-size: 16px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--hairline); color: var(--body); }
.prose pre { margin: 0 0 12px; padding: 10px; overflow-x: auto; background: var(--canvas-soft); border: 1px solid var(--hairline); font-size: 13px; }
.prose code { font-size: 13px; }
.prose a { color: var(--link); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 12px; }
.prose th, .prose td { border: 1px solid var(--hairline); padding: 6px 8px; text-align: left; font-size: 13px; }
.prose th { background: var(--canvas-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.two > label, .two input { min-width: 0; }
/* hotel today: next 7 nights, needs attention */
.nights { display: flex; align-items: flex-end; gap: 8px; height: 140px; margin: 10px 0 4px; }
.nt { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.nt small { font-size: 11px; color: var(--body); }
.nt .bar-v { width: 100%; background: linear-gradient(180deg, var(--leaf-b), var(--leaf)); border-radius: 10px 10px 4px 4px; }
.nt .bar-v.hot { background: linear-gradient(180deg, var(--hot-b), var(--accent-red)); }
.att { padding: 8px 0; border-bottom: 1px solid var(--canvas-soft); font-size: 14px; }
.pill.vip { background: var(--accent-purple-tint); color: var(--accent-purple); }
.pill.info { background: var(--accent-blue-tint); color: var(--accent-blue); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* hotel reservation and folio pages */
.hero { padding: 18px; border-radius: var(--r); background: linear-gradient(160deg, var(--deep), var(--deep2)); color: #fff; display: grid; gap: 4px; justify-items: start; margin-bottom: 12px; }
.hero small { opacity: .85; font-size: 13px; }
.hero h2 { font: 600 26px/1.15 var(--font-display); }
.hero p { font-size: 13.5px; opacity: .95; margin-bottom: 6px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.step { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 12px; position: relative; }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--canvas-soft); color: var(--body); position: relative; z-index: 1; }
.step::after { content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 3px; background: var(--canvas-soft); }
.step:last-child::after { display: none; }
.step.done .n { background: var(--leaf); color: #fff; }
.step.done::after { background: var(--leaf-b); }
.step.now .n { background: #fff; color: var(--leaf-d); box-shadow: 0 0 0 3px var(--leaf-b); }
.step small { color: var(--body); font-size: 11.5px; }
.kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.kv { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.kv small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--body); }
.kv .link-line { padding: 0; }
.kvs .wide { grid-column: 1 / -1; margin: 0; }
.next { background: linear-gradient(160deg, var(--accent-teal-tint), var(--leaf-t)); }
.balcard { background: linear-gradient(160deg, var(--accent-orange-tint), #fff 80%); }
.balcard small { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--warning-fg); }
.balcard strong { display: block; font: 600 40px/1.1 var(--font-display); margin: 4px 0 8px; }
.dim { opacity: .65; }
.nightly { margin-top: 8px; font-size: 13px; }
.nightly summary { min-height: 32px; cursor: pointer; color: var(--link); font-weight: 700; }
[hidden] { display: none !important; }

