/* Compass screens rebuilt in code for the website (sharp at any size, sample data only).
   Colours, font, sizes and card style copy the Compass theme (frontend/src/ui/tokens.ts, theme.ts).
   Icons: js/coded-icons.js. A view: <div class="cx">…</div>, sized by its frame (default height 400px). */
.cx { --blue: #1565c0; --blue50: #e3f2fd; --text: #1f2937; --muted: #6b7280; --border: #e5e7eb; --page: #f7f9fc; --subtle: #f3f4f6;
  --green: #2e7d32; --orange: #ed6c02; --red: #d32f2f; --info: #0277bd; --purple: #6a1b9a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px; line-height: 1.43; color: var(--text); background: var(--page); --under: var(--page);
  width: 100%; height: 400px; overflow: hidden; box-sizing: border-box; padding: 18px 20px 0; text-align: left; position: relative; }
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx .i { width: 18px; height: 18px; fill: currentColor; flex: none; vertical-align: middle; }
.cx h1 { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.cx h1 .i { width: 24px; height: 24px; color: var(--blue); }
.cx .sub { color: var(--muted); margin: 2px 0 0; }
.cx hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0 12px; }
.cx h2 { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.cx h2 .i { color: var(--blue); width: 20px; height: 20px; }
.cx .mt { margin-top: 16px; } .cx .mt8 { margin-top: 8px; } .cx .mt12 { margin-top: 12px; }
.cx .flex { display: flex; align-items: center; gap: 10px; } .cx .grow { flex: 1; } .cx .right { margin-left: auto; }
.cx .x-grid { display: grid; gap: 14px; } .cx .g2 { grid-template-columns: 1fr 1fr; } .cx .g3 { grid-template-columns: repeat(3, 1fr); } .cx .g4 { grid-template-columns: repeat(4, 1fr); }
.cx .muted { color: var(--muted); } .cx .small { font-size: 12px; } .cx b, .cx .b { font-weight: 600; }

/* cards and KPI tiles */
.cx .x-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; position: relative; }
.cx .x-card.p0 { padding: 0; overflow: hidden; }
.cx .x-card:has(> .ic) { padding-right: 56px; }
.cx .lab { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.cx .val { font-size: 20px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.cx .val.s { font-size: 17px; }
.cx .x-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cx .ic { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.cx .ic .i { width: 19px; height: 19px; }
.cx .t-green { background: #e8f5e9; color: var(--green); } .cx .t-orange { background: #fff3e0; color: var(--orange); }
.cx .t-blue { background: #e1f5fe; color: var(--info); } .cx .t-grey { background: var(--subtle); color: var(--muted); }
.cx .t-red { background: #fdecea; color: var(--red); } .cx .t-purple { background: #f3e5f5; color: var(--purple); }
.cx .c-blue { color: var(--blue); } .cx .c-green { color: var(--green); } .cx .c-orange { color: var(--orange); } .cx .c-red { color: var(--red); }

/* chips, buttons, links */
.cx .chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--subtle); color: #374151; }
.cx .chip.out { background: transparent; border: 1px solid #c4c9d2; color: var(--text); font-weight: 500; }
.cx .chip.blue { background: var(--blue); color: #fff; } .cx .chip.lblue { background: transparent; border: 1px solid var(--blue); color: var(--blue); }
.cx .chip.green { background: #e8f5e9; color: #1b5e20; } .cx .chip.orange { background: #fff3e0; color: #b45309; } .cx .chip.red { background: #fdecea; color: #b71c1c; }
.cx .x-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 6px; font-weight: 600; font-size: 13px; white-space: nowrap;
  border: 1px solid rgba(21,101,192,.5); color: var(--blue); background: transparent; }
.cx .x-btn .i { width: 17px; height: 17px; }
.cx .x-btn.solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.cx .x-btn.dark { border-color: #1f2937; color: #1f2937; }
.cx .x-btn.text { border-color: transparent; background: none; padding: 0 6px; }
.cx .link { color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.cx .badge { width: 28px; height: 28px; border-radius: 50%; background: #fff3e0; color: #b45309; font-weight: 600; display: grid; place-items: center; font-size: 12px; flex: none; }
.cx .x-av { width: 30px; height: 30px; border-radius: 50%; background: #1976d2; color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }

/* outlined fields with a floating label */
.cx .fld { position: relative; border: 1px solid #c4c9d2; border-radius: 6px; height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: transparent; white-space: nowrap; }
.cx .fld > label { position: absolute; top: -8px; left: 9px; padding: 0 4px; font-size: 11px; color: var(--muted); background: var(--under); line-height: 14px; }
.cx .fld.req { background: #e3f2fd; } .cx .fld.req > label { background: linear-gradient(var(--under) 50%, #e3f2fd 50%); }
.cx .fld.req > label::after { content: " *"; color: var(--red); }
.cx .fld .i { color: var(--muted); }
.cx .fld .drop { margin-left: auto; color: #6b7280; }
.cx .fld.x-ph { color: #9ca3af; }
.cx .help { font-size: 12px; color: var(--muted); margin: 4px 2px 0; }

/* tabs */
.cx .tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.cx .tabs span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cx .tabs span .i { width: 19px; height: 19px; }
.cx .tabs .x-on { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }

/* tables */
.cx table { width: 100%; border-collapse: collapse; background: #fff; }
.cx th { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); background: var(--subtle); text-align: left; padding: 8px 12px; white-space: nowrap; }
.cx td { padding: 8px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
.cx td.x-num, .cx th.x-num { text-align: right; }
.cx .namecell { display: flex; align-items: center; gap: 10px; }
.cx .cb { width: 16px; height: 16px; border: 2px solid #9ca3af; border-radius: 3px; display: inline-block; vertical-align: middle; }
.cx .meter { height: 4px; border-radius: 2px; background: #e5e7eb; margin-top: 5px; }
.cx .meter i { display: block; height: 100%; border-radius: 2px; background: var(--blue); }

/* booking stepper */
.cx .steps { display: flex; height: 34px; }
.cx .steps span { flex: 1; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #9ca3af; background: #eeeeee;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-left: -6px; }
.cx .steps span:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); margin-left: 0; }
.cx .steps .x-done { background: #bbdefb; color: var(--blue); } .cx .steps .x-on { background: #1976d2; color: #fff; }
.cx .sect { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cx .sect > .hd { padding: 9px 16px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); background: #fafafa; border-bottom: 1px solid var(--border); }
.cx .sect > .bd { padding: 12px 16px; }
.cx .x-pill { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--blue); color: #fff; font-weight: 600; }
.cx .money { display: grid; background: #fafafa; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cx .money > div { padding: 9px 12px; border-left: 1px solid var(--border); }
.cx .money > div:first-child { border-left: 0; }
.cx .money .lab { font-size: 10.5px; } .cx .money b { font-size: 14px; font-weight: 700; display: block; margin-top: 1px; }
.cx .money .profit { background: #e8f5e9; } .cx .money .profit b { color: var(--green); }

/* alert */
.cx .alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: 6px; background: #fdecea; color: #5f2120; }
.cx .alert .i { color: var(--red); width: 20px; height: 20px; margin-top: 1px; }

/* app shell (front-page top) */
.cx.app { padding: 0; display: grid; grid-template-columns: 60px 1fr; grid-template-rows: 56px 1fr; }
.cx .topbar { grid-column: 1 / -1; background: var(--blue); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 22px 0 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2); position: relative; z-index: 1; }
.cx .topbar .i { width: 22px; height: 22px; }
.cx .x-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; margin-left: 6px; }
.cx .x-brand .x-logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.cx .user { text-align: right; line-height: 1.25; font-weight: 600; } .cx .user small { display: block; font-weight: 400; opacity: .9; font-size: 12px; }
.cx .rail { background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; }
.cx .rail span { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #6b7280; }
.cx .rail span.x-on { background: var(--blue50); color: var(--blue); }
.cx .rail .i { width: 22px; height: 22px; }
.cx .main { padding: 18px 22px 0; overflow: hidden; }
.cx .ql { display: grid; place-items: center; text-align: center; gap: 4px; height: 76px; border-radius: 4px; font-size: 12.5px; line-height: 1.2; padding: 6px; }
.cx .ql .i { width: 20px; height: 20px; }
.cx .trip { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; }
.cx .route { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 6px; margin-top: 8px; }
.cx .stop { text-align: center; line-height: 1.25; } .cx .stop b { display: block; font-size: 13px; }
.cx .stop i { display: block; width: 10px; height: 10px; border: 2px solid var(--blue); border-radius: 50%; margin: 0 auto 2px; }
.cx .stop i.or { border: 0; background: var(--orange); }
.cx .line { height: 1px; background: #90caf9; position: relative; }
.cx .line .i { position: absolute; left: 10%; top: -9px; color: var(--blue); transform: rotate(90deg); }

/* campaign editor */
.cx.dialog { padding: 0; background: rgba(15,23,42,.42); }
.cx .dlg { position: absolute; inset: 14px 14px -10px; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.3); overflow: hidden; }
.cx .dlg-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 17px; font-weight: 700; }
.cx .dlg-h .i { color: var(--blue); width: 22px; height: 22px; }
.cx .dlg-h .i.x { color: var(--muted); }
.cx .poster { height: 104px; border-radius: 6px 6px 0 0; background: linear-gradient(135deg, #f4b860 0%, #e2725b 55%, #7a4b9b 100%); display: flex; align-items: flex-end; padding: 12px 16px;
  color: #fff; font-size: 21px; font-weight: 700; letter-spacing: -.01em; position: relative; overflow: hidden; }
.cx .poster::before { content: ""; position: absolute; right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,236,170,.55); }
.cx .poster::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(transparent, rgba(60,20,70,.35)); }
.cx .poster span { position: relative; z-index: 1; }
.cx .mailbtn { display: inline-block; background: var(--blue); color: #fff; font-weight: 700; padding: 8px 18px; border-radius: 4px; font-family: Arial, sans-serif; }

/* history dialog */
.cx.hist td, .cx.hist th { padding: 8px 10px; } .cx.hist td { vertical-align: top; white-space: normal; } .cx.hist td:nth-child(2) { white-space: nowrap; }
.cx .old { color: #c62828; } .cx .new { color: #2e7d32; }
.cx .fieldname { text-decoration: underline dotted; text-underline-offset: 3px; }

/* what sits under a field's label: the page, or a white card / dialog */
.cx .x-card, .cx .sect, .cx .dlg { --under: #fff; }
/* notification counts on the top bar (red, like Compass) */
.cx .nb { position: relative; display: inline-flex; }
.cx .nb b { position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d32f2f; color: #fff;
  font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--blue); }
.cx .presence { position: relative; display: inline-flex; }
.cx .presence::after { content: ""; position: absolute; right: -1px; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: #4caf50; box-shadow: 0 0 0 2px var(--blue); }
.cx .g4 .x-card .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a rebuilt screen inside a website frame (js/coded-icons.js scales it to the frame) */
.cx-fit { position: relative; overflow: hidden; width: 100%; }
.cx-fit > .cx { transform-origin: 0 0; }
/* shield the screens from the website's own heading and paragraph styles */
.cx h1, .cx h2, .cx h3 { font-family: inherit; color: inherit; letter-spacing: 0; }
.cx h1 { line-height: 1.3; } .cx h2 { line-height: 1.4; }
.cx p { margin: 2px 0 0; }
/* the product name in the dashboard's top bar uses the Compass wordmark (Cinzel capitals), like the logo above it */
.cx .x-brand { font-family: 'Cinzel', Georgia, serif; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: 17px; }

/* the dashboard greeting: looks like the app headline, but is not a page heading */
.cx .x-h1 { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; color: inherit; }
