/* VIMEDRA look & feel, taken from vimedra.ai: Nunito Sans, deep navy, indigo + pink accents, pill buttons. */
:root {
  --navy: #051023;
  --navy-2: #0a1228;
  --indigo: #4f4cc8;
  --indigo-dark: #4338ca;
  --indigo-soft: #eef2ff;
  --indigo-line: #c7d2fe;
  --pink: #ec4899;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f9fafb;
  --card: #fff;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --grey-bg: #f3f4f6;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--indigo-dark); }
:focus-visible { outline: 3px solid var(--indigo-line); outline-offset: 2px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.3); }
.sections { display: flex; gap: 4px; margin-left: 8px; }
.sections a { color: #cbd5e1; text-decoration: none; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.sections a[aria-current='true'] { background: rgba(255,255,255,.14); color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .9rem; color: #cbd5e1; }
.userbox .who { text-align: right; line-height: 1.2; }
.userbox .who b { color: #fff; display: block; }
.subnav { background: var(--navy-2); border-top: 1px solid rgba(255,255,255,.08); }
.subnav-inner { max-width: 1100px; margin: 0 auto; padding: 0 8px; display: flex; overflow-x: auto; scrollbar-width: none; }
.subnav a { color: #cbd5e1; text-decoration: none; padding: 12px 14px; font-weight: 700; font-size: .95rem; border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.subnav a:hover { color: #fff; }
.subnav a[aria-current='page'] { color: #fff; border-bottom-color: var(--pink); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 2px solid transparent; cursor: pointer; font: inherit; font-weight: 700;
  padding: 10px 22px; border-radius: 999px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--indigo); color: #fff; min-height: 44px; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--indigo-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--indigo-dark); border-color: var(--indigo-line); }
.btn.secondary:hover { background: var(--indigo-soft); }
.btn.danger { background: #fff; color: var(--bad); border-color: #fca5a5; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); padding: 6px 16px; min-height: 36px; font-size: .9rem; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.big { font-size: 1.15rem; padding: 16px 34px; min-height: 56px; background: linear-gradient(90deg, var(--indigo), #7c3aed 60%, var(--pink)); box-shadow: 0 8px 24px rgba(79,76,200,.35); }
.btn.big:hover { filter: brightness(1.08); background: linear-gradient(90deg, var(--indigo), #7c3aed 60%, var(--pink)); }
.btn.sm { padding: 6px 16px; min-height: 36px; font-size: .9rem; }

label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; font-size: .95rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #d1d5db; border-radius: 12px; padding: 10px 14px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--indigo-line); border-color: var(--indigo); }
.field { margin-bottom: 18px; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.check input { width: 20px; min-height: 20px; height: 20px; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 600; margin-bottom: 16px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(17,24,39,.04); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid > .card { margin-top: 0; }
.grid.home { grid-template-columns: 1fr 1fr; }
.grid.home .span2 { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

.balance { background: var(--navy); color: #fff; border: 0; position: relative; overflow: hidden; }
.balance::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(236,72,153,.35), transparent 70%); }
.balance h2 { color: #c7d2fe; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
.balance .num { font-size: 3.2rem; font-weight: 800; line-height: 1.1; margin-top: 8px; position: relative; }
.balance .num small { font-size: 1.1rem; font-weight: 600; color: #c7d2fe; margin-left: 6px; }
.balance .num.unset { font-size: 1.7rem; }
.balance .sub { color: #cbd5e1; margin-top: 6px; position: relative; }
.bar { height: 8px; background: rgba(255,255,255,.18); border-radius: 99px; margin-top: 16px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #818cf8, var(--pink)); border-radius: 99px; }
.cta { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; background: var(--indigo-soft); border-color: var(--indigo-line); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--indigo); box-shadow: 0 6px 20px rgba(79,76,200,.12); }
.tile b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 2px; }
.tile span { color: var(--muted); font-size: .92rem; }

/* ---------- status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.pending { color: var(--warn); background: var(--warn-bg); }
.badge.approved { color: var(--ok); background: var(--ok-bg); }
.badge.declined { color: var(--bad); background: var(--bad-bg); }
.badge.cancelled, .badge.draft { color: #4b5563; background: var(--grey-bg); }
.badge.published { color: var(--ok); background: var(--ok-bg); }
.pill-count { background: var(--pink); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 8px; line-height: 1.5; font-weight: 800; }

/* ---------- request list ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; text-decoration: none; color: inherit; flex-wrap: wrap; }
a.item:hover .item-title { color: var(--indigo-dark); }
.item-title { font-weight: 700; color: var(--ink); }
.item-sub { color: var(--muted); font-size: .92rem; }
.empty { color: var(--muted); padding: 12px 0; }

.detail dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
.detail dt { font-weight: 700; color: var(--ink); }
.detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reason { background: var(--bad-bg); color: #7f1d1d; padding: 12px 16px; border-radius: 12px; margin-top: 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.decide { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.narrow { max-width: 640px; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 700; text-decoration: none; }

/* ---------- calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav h2 { min-width: 10ch; text-align: center; font-size: 1.3rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal .dow { background: var(--grey-bg); padding: 8px; font-weight: 700; font-size: .8rem; text-align: center; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal .day { min-height: 104px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.cal .day:nth-child(7n + 1) { border-left: 0; }
.cal .day.off { background: #fcfcfd; color: #9ca3af; }
.cal .day.weekend { background: #f9fafb; }
.cal .day.today .dnum { background: var(--pink); color: #fff; }
.dnum { font-size: .82rem; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.chip { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--indigo-soft); color: var(--indigo-dark); border: 1px solid var(--indigo-line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.comp { background: #fdf2f8; color: #9d174d; border-color: #fbcfe8; }
.agenda { display: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 0; font-size: .88rem; color: var(--muted); }

/* ---------- benefits / admin ---------- */
.benefit h3 { font-size: 1.15rem; margin-bottom: 6px; }
.benefit dl { margin: 14px 0 0; display: grid; gap: 10px; }
.benefit dt { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--indigo-dark); }
.benefit dd { margin: 2px 0 0; white-space: pre-wrap; }
.person { display: grid; grid-template-columns: 1.3fr 1fr 1fr 130px auto; gap: 12px; align-items: end; padding: 16px 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person label { font-size: .8rem; margin-bottom: 4px; color: var(--muted); }
.person .nm b { color: var(--ink); display: block; }
.person .nm span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.person.inactive { opacity: .6; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 500px at 80% -10%, rgba(236,72,153,.28), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(79,76,200,.5), transparent 60%), var(--navy); }
.signin-card { background: #fff; border-radius: 24px; padding: 36px 32px; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.signin-logo { background: var(--navy); border-radius: 14px; padding: 16px 24px; display: inline-block; margin-bottom: 22px; }
.signin-logo img { height: 34px; display: block; }
.signin-card p { margin: 10px 0 24px; }
#gbtn { display: flex; justify-content: center; }
#gbtn:empty { display: none; }
.devbox { text-align: left; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.devbox .badge { margin-bottom: 10px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  h1 { font-size: 1.5rem; }
  .brand span { display: none; }
  .userbox .who { display: none; }
  .grid.home { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .detail dl { grid-template-columns: 1fr; gap: 2px; }
  .detail dd { margin-bottom: 10px; }
  .btn.big { width: 100%; }
  .cal { display: none; }
  .agenda { display: block; }
  .person { grid-template-columns: 1fr 1fr; }
  .person .nm { grid-column: 1 / -1; }
  .person .inline-actions { grid-column: 1 / -1; }
  .card { padding: 18px; }
}
.agenda-day { font-weight: 800; color: var(--ink); margin: 18px 0 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
