@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 900; font-style: normal; font-display: swap; src: url("fonts/lato-latin-900-normal.woff2") format("woff2"); }

/* MAR360 brand: green #25412E, blue #489DD2, purple #5224BC, magenta #CC1483 */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --text: #17231b;
  --muted: #5b6a60;
  --line: #dbe3de;
  --brand: #25412E;
  --brand-dark: #1a2f21;
  --brand-soft: #e7efe9;
  --accent: #489DD2;
  --accent-soft: #e5f1f9;
  --link: #22668f;
  --purple: #5224BC;
  --magenta: #CC1483;
  --gradient: linear-gradient(135deg, #25412E 0%, #489DD2 100%);
  --ok: #1d7a4d;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf2dc;
  --danger: #b3261e;
  --danger-soft: #fbe7e6;
  --weekend: #eef1f4;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Lato", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--link); }
h1 { font-size: 1.7rem; font-weight: 900; margin: 0.4rem 0 0.6rem; letter-spacing: -0.01em; color: var(--brand); }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.8rem; }
h3 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn); }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0 16px;
  min-height: 68px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; padding: 10px 0; }
.brand img { height: 46px; width: auto; display: block; }
.mainnav { display: flex; align-items: center; gap: 0.15rem; flex: 1; flex-wrap: wrap; }
.mainnav a, .mainnav .linkbtn {
  color: var(--brand); text-decoration: none; padding: 0.45rem 0.75rem; border-radius: 999px; font-size: 0.93rem; font-weight: 700;
}
.mainnav a:hover, .mainnav .linkbtn:hover { background: var(--brand-soft); }
.mainnav a.on { background: var(--brand); color: #fff; }
.mainnav .linkbtn { font-weight: 400; color: var(--muted); }
.navsep { flex: 1; }
.count { background: var(--magenta); color: #fff; border-radius: 999px; padding: 0 0.45rem; font-size: 0.75rem; font-weight: 900; }
.nav-toggle { display: none; background: none; border: 0; color: var(--brand); font-size: 1.5rem; margin-left: auto; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 0.6rem; }
  .nav-open .mainnav { display: flex; }
  .navsep { display: none; }
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.5rem 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.card.narrow { max-width: 560px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 1rem; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.row-inline { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.4rem 0; }
.row-inline input { flex: 1; min-width: 120px; margin: 0; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; }
form.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.8rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  font: inherit; font-weight: 400; color: var(--text);
  padding: 0.55rem 0.65rem; border: 1px solid #c3ccd6; border-radius: 7px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
select { width: auto; max-width: 100%; }
label select { width: 100%; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
label.check input { width: auto; margin: 0; }
textarea { resize: vertical; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 0.55rem 1rem; border-radius: 7px; border: 1px solid #c3ccd6;
  background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f1f4f7; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #e3b5b2; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-small { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }

.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert-success { background: var(--ok-soft); border-color: #b5dec6; }
.alert-error { background: var(--danger-soft); border-color: #efc2bf; color: #7d1a14; }
.alert-info { background: var(--accent-soft); border-color: #bcdaf0; }
.creds { background: #fff; border: 1px dashed var(--accent); padding: 0.7rem; border-radius: 6px; font-size: 0.95rem; white-space: pre-wrap; user-select: all; }

/* ---------- auth ---------- */
body.auth { background: var(--gradient); }
body.auth .footer { color: rgba(255,255,255,0.8); }
.auth-card { max-width: 430px; margin: 7vh auto 0; background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 18px 50px rgba(10, 30, 20, 0.28); }
.auth-brand { margin-bottom: 1.4rem; }
.auth-brand img { height: 64px; width: auto; display: block; }
.auth-card .btn { width: 100%; padding: 0.7rem; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.8rem; margin: 1rem 0; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } .tile-main { grid-column: 1 / -1; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.tile-main { background: var(--gradient); color: #fff; border: 0; position: relative; overflow: hidden; }
.tile-main::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 96px; height: 96px; transform: translateY(-50%);
  background: url("brand/mar360-icon-white.png") center / contain no-repeat; opacity: 0.25;
}
.tile-main .tile-value, .tile-main .tile-label, .tile-main .tile-sub { position: relative; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.tile-label { font-size: 0.82rem; opacity: 0.8; }
.tile-value { font-size: 1.6rem; font-weight: 900; color: var(--brand); }
.tile-main .tile-value { color: #fff; }
.tile-main .tile-value { font-size: 2.2rem; }
.tile-sub { font-size: 0.85rem; opacity: 0.85; }

/* ---------- lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li, .list-row { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.list li:last-child, .list-row:last-of-type { border-bottom: 0; }
.todo { margin: 0; padding-left: 1.2rem; }
.todo li { margin: 0.3rem 0; }
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 0.5rem; white-space: nowrap; }
.table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.inactive td { opacity: 0.55; }
.summary { width: 100%; border-collapse: collapse; margin-bottom: 0.6rem; }
.summary td { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.summary td:last-child { text-align: right; white-space: nowrap; }
.summary tr.total td { font-weight: 700; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.badge-pending, .badge-manager_review, .badge-employee_signoff { background: var(--warn-soft); color: var(--warn); }
.badge-approved, .badge-complete { background: var(--ok-soft); color: var(--ok); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: #eceff2; color: var(--muted); }
.badge-self_assessment { background: #efe9fb; color: var(--purple); }

.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--accent); font-weight: 700; }

/* ---------- approvals ---------- */
.request { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.request:last-child { border-bottom: 0; }
.request-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.request-actions input { width: 200px; margin: 0; }

/* ---------- calendar ---------- */
.monthnav { display: flex; gap: 0.5rem; align-items: center; }
.legend { display: flex; gap: 1rem; margin-bottom: 0.6rem; flex-wrap: wrap; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.calwrap { overflow-x: auto; padding: 0.6rem; }
.cal { border-collapse: separate; border-spacing: 2px; font-size: 0.75rem; }
.cal th { font-weight: 600; color: var(--muted); text-align: center; min-width: 24px; line-height: 1.2; }
.cal th span { display: block; font-weight: 400; }
.cal th.who { text-align: left; min-width: 140px; max-width: 180px; padding-right: 0.5rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); }
.cal td { height: 26px; background: #f8fafb; border-radius: 4px; }
.cal .weekend, .sw.weekend { background: var(--weekend); }
.cal th.weekend { background: none; color: #a3adb8; }
.cal th.today { color: var(--magenta); }
.cal td.today { box-shadow: inset 0 0 0 2px var(--magenta); }
.cal tr.me th.who { color: var(--brand); }

/* ---------- policies ---------- */
.cat { color: var(--brand); font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem; margin-top: 1.2rem; }
.cat:first-child { margin-top: 0; }
.policy { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.policy-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.prose { white-space: normal; overflow-wrap: anywhere; }

/* ---------- appraisals ---------- */
.steps { list-style: none; display: flex; gap: 0.4rem; padding: 0; margin: 0 0 1rem; counter-reset: s; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 120px; padding: 0.55rem 0.8rem; border-radius: 8px; background: #e9edf1; color: var(--muted); font-size: 0.88rem; font-weight: 600; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.current { background: var(--gradient); color: #fff; }
.steps li.done { background: var(--ok-soft); color: var(--ok); }
.steps li.done::before { content: "✓ "; }

.estimate { min-height: 1.4em; margin: -0.3rem 0 0.8rem; }

@media print {
  .topbar, .footer, .actions, form { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}


/* ---------- who's off (leave form) ---------- */
.whos-off { background: var(--accent-soft); border: 1px solid #bcdaf0; border-radius: 8px; padding: 0.7rem 0.9rem; margin: -0.2rem 0 0.9rem; font-size: 0.88rem; }
.whos-off ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.whos-off li { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.2rem 0; }
.tag { font-size: 0.7rem; font-weight: 700; background: #fff; color: var(--link); border-radius: 999px; padding: 0 0.4rem; }

/* ---------- org chart ---------- */
.org, .org ul { list-style: none; margin: 0; padding: 0; }
.org ul { margin-left: 22px; padding-left: 22px; border-left: 2px solid var(--line); }
.org li { position: relative; padding-top: 0.6rem; }
.org ul > li::before { content: ""; position: absolute; left: -22px; top: 2.1rem; width: 18px; border-top: 2px solid var(--line); }
.person { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.9rem 0.55rem 0.55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-width: 100%; }
.person.is-me { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.person-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.person-text a { text-decoration: none; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gradient); color: #fff; font-weight: 900; font-size: 0.85rem; }
@media (max-width: 560px) { .org ul { margin-left: 10px; padding-left: 14px; } .org ul > li::before { left: -14px; width: 10px; } }
.steps-list { padding-left: 1.2rem; margin: 0; } .steps-list li { margin: 0.45rem 0; }

/* ---------- leave types ---------- */
.cal td.on { background: var(--c); }
.cal td.on.pending { background: repeating-linear-gradient(45deg, var(--c), var(--c) 3px, #ffffff 3px, #ffffff 6px); }
.cal td.on.half { background: linear-gradient(90deg, var(--c) 50%, #f8fafb 50%); }
.cal td.on.pending.half { background: linear-gradient(90deg, transparent 50%, #f8fafb 50%), repeating-linear-gradient(45deg, var(--c), var(--c) 3px, #ffffff 3px, #ffffff 6px); }
.sw.pending { background: repeating-linear-gradient(45deg, #3d4a42, #3d4a42 2px, #ffffff 2px, #ffffff 5px); outline: 1px solid #3d4a42; outline-offset: -1px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); vertical-align: 0; }
h1 .dot { width: 14px; height: 14px; }
.badge-recorded { background: #fbe6f2; color: #9c0f64; }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.4rem; }
.type-card { padding: 1rem 1.2rem; }
.type-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.type-head input[type=color] { width: 44px; height: 36px; padding: 2px; margin: 0; flex: none; }
.type-name { flex: 1; min-width: 180px; margin: 0; font-weight: 700; }
.type-flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 1rem; }
.type-flags label { margin-bottom: 0.5rem; }
.report-filter { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.report-filter label { margin: 0; }
.report-filter .row-inline label { margin: 0; }
