/* Palette + geometry aligned to the VTN Org Dashboard design system
   (same brand language: navy command bar, single blue accent, status-only
   red/orange/green, soft blue-tinted shadows, 14px card radius). */
:root {
  --navy: #0F2F57;
  --navy-2: #16406f;
  --blue: #006394;
  --blue-600: #0a72a6;
  --blue-soft: #e7f1f7;
  --ink: #14222f;
  --muted: #5b6b7a;
  --faint: #8696a4;
  --line: #e3eaf0;
  --line-soft: #eef3f7;
  --bg: #eef2f6;
  --ok: #1f9d57;
  --okbg: #e8f6ee;
  --warn: #e8890c;
  --warnbg: #fdf3e3;
  --bad: #dc3545;
  --badbg: #fdebec;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15,47,87,.06), 0 1px 3px rgba(15,47,87,.05);
  --shadow-md: 0 6px 18px rgba(15,47,87,.10);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hidden { display: none !important; }

/* Header */
header.topbar {
  background: linear-gradient(180deg, #123763, #0e2a4d); color: #fff; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; height: 62px; box-shadow: var(--shadow-md);
}
.topbar .brand { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 11px; }
.topbar .brand .logochip { background: #fff; border-radius: 10px; padding: 5px 11px; height: 44px;
  display: grid; place-items: center; box-shadow: var(--shadow); }
.topbar .brand .logochip img { height: 32px; display: block; }
.topbar .brand .logochip.fallback { color: var(--blue); font-weight: 800; font-size: 15px; min-width: 44px; }
.topbar .brand .logochip.fallback::after { content: "VTN"; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; opacity: .9; }
.topbar button.link { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; }

/* Mode switch (demo only) */
.modebar {
  background: #fff8e6; border-bottom: 1px solid #f0e3b8; color: #8a6d1f;
  font-size: 12.5px; padding: 7px 20px; display: flex; gap: 12px; align-items: center;
}
.modebar .seg { display: inline-flex; border: 1px solid #d9c98f; border-radius: 8px; overflow: hidden; }
.modebar .seg button { background: #fff; border: 0; padding: 5px 12px; font-size: 12.5px; color: #8a6d1f; cursor: pointer; }
.modebar .seg button.on { background: var(--navy); color: #fff; }

main { max-width: 920px; margin: 26px auto; padding: 0 20px 80px; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 19px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: #344054; margin: 0 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd6e0; border-radius: 9px;
  font-size: 14.5px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.field { margin-bottom: 16px; }

/* Buttons */
button { cursor: pointer; font-family: inherit; }
.btn { background: var(--blue); color: #fff; border: 0; padding: 11px 18px; border-radius: 9px; font-size: 14.5px; font-weight: 600; }
.btn:hover { background: #00547d; }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid #cfd6e0; }
.btn.secondary:hover { background: #f3f6fa; }
.btn.ghost { background: transparent; color: var(--blue); border: 0; padding: 8px 6px; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.actions .spacer { flex: 1; }

/* Landing cards */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); cursor: pointer; transition: .12s; }
.tile:hover { border-color: var(--blue); transform: translateY(-2px); }
.tile .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.tile h3 { margin: 0 0 6px; font-size: 17px; }
.tile p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* OTP */
.otp-boxes { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.otp-boxes input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 700; }
.hint { background: var(--blue-soft); border: 1px dashed var(--blue); color: var(--navy); border-radius: 9px; padding: 10px 14px; font-size: 13px; margin: 14px 0; }

/* Day cards */
.dayhead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.daycard { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 14px; overflow: hidden; }
.daycard .dtop { background: #f8fafc; border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.daycard .dtop .date { font-weight: 700; }
.daycard .dbody { padding: 14px 16px; }
.pill { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.pill.program { background: var(--blue-soft); color: var(--blue); }
.pill.travel { background: #ede9fe; color: #6d28d9; }
.pill.admin { background: #f1f5f9; color: #475569; }
.meals { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.meals span.on { color: var(--ok); font-weight: 600; }
.exline { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.exline .amt { margin-left: auto; font-weight: 700; }
.exline .ftype { color: var(--muted); font-size: 12.5px; }

/* Status badges */
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.b-sub { background: var(--blue-soft); color: var(--blue); }
.b-ok { background: var(--okbg); color: var(--ok); }
.b-warn { background: var(--warnbg); color: var(--warn); }
.b-bad { background: var(--badbg); color: var(--bad); }
.b-draft { background: #f1f5f9; color: #475569; }

/* Table / queue */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
tr.clk:hover { background: #f8fafc; cursor: pointer; }
.total { font-size: 22px; font-weight: 800; color: var(--navy); }
.kvs { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; margin: 6px 0 18px; }
.kvs .k { color: var(--muted); }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumb a { color: var(--blue); cursor: pointer; }

/* Toast */
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Guided participant flow — large, friendly choice buttons */
.gchoice { display: flex; flex-wrap: wrap; gap: 10px; }
.gopt { background: #fff; border: 1.5px solid #cfd6e0; border-radius: 11px; padding: 13px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink); min-height: 48px; }
.gopt:hover { border-color: var(--blue); }
.gopt.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Modal (navy-gradient header, like the dashboard) */
.modal-ov { position: fixed; inset: 0; background: rgba(15,33,55,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 18px; max-width: 540px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 24px 60px rgba(15,47,87,.28); }
.modal .mhead { background: linear-gradient(180deg, #123763, #0e2a4d); color: #fff; padding: 15px 20px; font-size: 16px; font-weight: 700; display: flex; align-items: center; }
.modal .mhead .x { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 18px; cursor: pointer; opacity: .8; }
.modal .mbody { padding: 20px; }
.modal .mfoot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.checks input { width: auto; }
.filechips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.filechip { font-size: 12px; background: var(--blue-soft); color: var(--blue); border-radius: 7px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 6px; }
.filechip button { background: transparent; border: 0; color: var(--blue); cursor: pointer; font-size: 13px; }

/* Make wide tables scroll instead of breaking the layout on small screens */
.card table { display: block; overflow-x: auto; }

@media (max-width: 640px) {
  .tiles, .grid2, .row { grid-template-columns: 1fr; }
  main { padding: 0 12px 80px; margin-top: 16px; }
  header.topbar { padding: 0 12px; }
  .topbar .who { display: none; } /* keep the bar uncluttered; identity shows in-page */
  .modebar { flex-wrap: wrap; }
  /* full-screen modals on phones (dashboard pattern) */
  .modal-ov { padding: 0; }
  .modal { max-width: 100%; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .spacer { display: none; }
  .btn, .btn.sm { width: 100%; }            /* full-width tap targets */
  .sigrow { grid-template-columns: 1fr; }
}

/* FR/EN language toggle (injected into the top bar by i18n.js) */
.lang-toggle { display: inline-flex; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; overflow: hidden; margin-right: 10px; }
.lang-toggle button { appearance: none; border: 0; background: transparent; color: #cbd5e1; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 5px 9px; cursor: pointer; line-height: 1; }
.lang-toggle button:hover { background: rgba(255,255,255,.12); color: #fff; }
.lang-toggle button.on { background: var(--blue, #006394); color: #fff; }
