/* LTS HR Mobile — mobile-first, LTS navy #1F3A5F, no CDNs. */
:root {
  --navy: #1F3A5F;
  --navy-dark: #152A45;
  --navy-light: #2E5077;
  --accent: #2E86DE;
  --bg: #F2F4F7;
  --card: #FFFFFF;
  --ink: #1A2333;
  --muted: #6B7686;
  --line: #E2E7EE;
  --ok: #1E7E34;
  --warn: #B7791F;
  --bad: #C0392B;
  --radius: 14px;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.45;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 56px);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0.5em 0; }
a { color: var(--accent); }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  min-height: 60px;
}
.appbar-title { flex: 1; font-size: 18px; font-weight: 700; text-align: center; }
.appbar-btn {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; font-size: 22px; border-radius: 10px;
}
.appbar-logo img { display: block; border-radius: 6px; }

.page { padding: 12px 12px 0; max-width: 640px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 0 0 12px; box-shadow: 0 1px 3px rgba(31,58,95,.06);
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-h h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }

/* Greeting */
.greet { padding: 8px 4px 12px; }
.greet h2 { font-size: 24px; font-weight: 600; color: var(--navy); }
.greet h2 b { font-weight: 800; }
.greet-date { color: var(--muted); margin: 4px 0 0; }

/* Pills */
.pillrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pill {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; min-height: 76px; justify-content: center;
  text-decoration: none; color: var(--navy); font-size: 13px; font-weight: 600; text-align: center;
}
.pill-ico { font-size: 22px; }
.pill:active { background: #E8EEF6; }

/* Stats */
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.statgrid.single { grid-template-columns: 1fr; }
.stat {
  background: var(--navy); color: #fff; border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat b { font-size: 26px; font-weight: 800; }
.stat span { font-size: 12px; opacity: .85; }

/* Carousel */
.car-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.car-item {
  flex: 0 0 82%; scroll-snap-align: start;
  background: #F7FAFF; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.car-item h4 { font-size: 16px; margin-bottom: 4px; color: var(--navy); }
.car-item p { font-size: 14px; color: var(--ink); }
.car-item time { font-size: 12px; color: var(--muted); }

/* Badges */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 4px 8px; border-radius: 999px; background: #E8EEF6; color: var(--navy); white-space: nowrap;
}
.badge.ok { background: #DFF3E4; color: var(--ok); }
.badge.warn { background: #FDF0D7; color: var(--warn); }
.badge.bad { background: #FBE4E1; color: var(--bad); }
.badge.pin { background: var(--navy); color: #fff; }
.badge.kind { background: #E4EBF5; color: var(--navy); }

/* Rows / feeds / kv */
.rows, .feed, .kv, .menulist, .cards, .changelog, .steps, .alert-items, .task-lines { list-style: none; margin: 0; padding: 0; }
.rows li, .feed li {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 2px; border-top: 1px solid var(--line); min-height: 56px;
}
.rows li:first-child, .feed li:first-child { border-top: 0; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main b { font-size: 15px; }
.feed li { flex-direction: column; align-items: flex-start; gap: 2px; }
.feed p { font-size: 14px; color: var(--ink); }
.feed time, .car-item time { font-size: 12px; color: var(--muted); }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); min-height: 44px; align-items: center; }
.kv li:first-child { border-top: 0; }
.tl { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.kv b { text-align: right; font-size: 15px; }
.muted { color: var(--muted); }
.muted.sm, .sm { font-size: 13px; }
.desc { white-space: pre-wrap; font-size: 14px; margin-top: 8px; }

/* Menus */
.menugroup { margin-bottom: 16px; }
.menugroup h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 4px 6px; }
.menulist { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menulist a, .menulist.sections a {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  min-height: 56px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px;
  border-top: 1px solid var(--line);
}
.menulist a:first-child { border-top: 0; }
.m-ico { font-size: 20px; width: 28px; text-align: center; }
.chev { margin-left: auto; color: var(--muted); font-size: 22px; }
.signedin { margin: 10px 4px 0; font-size: 13px; }

/* Avatar */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }

/* Profile hero */
.profile-hero {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 18px 14px; margin-bottom: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.profile-hero .avatar { background: rgba(255,255,255,.18); }
.ph-main { flex: 1; min-width: 140px; }
.ph-main h2 { font-size: 20px; }
.ph-main p { margin: 2px 0; font-size: 14px; }
.ph-main .muted { color: rgba(255,255,255,.75); }
.ph-btns { display: flex; gap: 8px; width: 100%; }
.ph-btns .btn { flex: 1; }

/* Buttons / forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.big { width: 100%; margin-top: 10px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:active { background: var(--navy-dark); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.form-card .btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin: 12px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"] {
  width: 100%; min-height: 48px; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.reason { margin-bottom: 8px; }

/* Search bar */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; }
.searchbar .btn { flex-shrink: 0; }

/* Tasks */
.tasks-count { margin: 4px 4px 12px; color: var(--muted); font-size: 14px; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.task-top h4 { font-size: 16px; flex: 1; }
.task-lines li { padding: 3px 0; font-size: 14px; }
.why { font-size: 13px; color: var(--muted); font-style: italic; margin: 8px 0 0; }
.task-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.task-btns form { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.task-btns .btn { width: 100%; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.alert.ok { background: #DFF3E4; color: var(--ok); }
.alert.err { background: #FBE4E1; color: var(--bad); }
.alert-item { padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; margin: 6px 0; }
.alert-item.critical { background: #FBE4E1; color: var(--bad); }
.alert-item.warning { background: #FDF0D7; color: var(--warn); }
.alert-card.critical { border-left: 4px solid var(--bad); }
.alert-card.warning { border-left: 4px solid var(--warn); }
.alert-items li { padding: 6px 0; font-size: 14px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 44px; }
.empty p { font-size: 16px; }

/* Org chart */
.org, .org-kids { list-style: none; margin: 0; padding: 0; }
.org-kids { margin-left: 18px; border-left: 2px solid var(--line); padding-left: 8px; }
.org-node details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.org-node summary { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 56px; cursor: pointer; list-style: none; }
.org-node summary::-webkit-details-marker { display: none; }
.hint { margin: 8px 4px; font-size: 13px; }

/* Changelog */
.changelog li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.changelog li:first-child { border-top: 0; }

/* Login */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%); }
.login-card {
  background: #fff; margin: auto 16px; border-radius: 18px; padding: 24px 20px;
  width: calc(100% - 32px); max-width: 440px; align-self: center;
}
.login-logo { display: block; max-width: 220px; max-height: 72px; margin: 0 auto 8px; }
.login-logo.sm { max-width: 72px; max-height: 72px; }
.login-card h1 { text-align: center; font-size: 22px; color: var(--navy); }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.aup-warn {
  background: #FFF8DC; border: 2px solid #E8C547; color: #5A4A00;
  font-size: 12px; padding: 10px 12px; border-radius: 8px; margin: 14px 0;
}
.login-tabs { display: flex; gap: 8px; margin: 12px 0 4px; }
.ltab {
  flex: 1; min-height: 44px; border: 1px solid var(--line); background: #F7F9FC;
  border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.ltab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabpane { display: none; }
.tabpane.on { display: block; }
.sess-data { margin-top: 16px; font-size: 13px; color: var(--muted); }
.sess-data summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.sess-data dl { margin: 6px 0 0; }
.sess-data dl div { display: flex; gap: 8px; padding: 4px 0; }
.sess-data dt { font-weight: 700; min-width: 90px; }
.sess-data dd { margin: 0; word-break: break-word; }

/* Install page */
.install { max-width: 520px; margin: 0 auto; padding: 24px 16px 12px; }
.install-hero { text-align: center; margin-bottom: 18px; }
.install-logo { border-radius: 22px; box-shadow: 0 4px 16px rgba(31,58,95,.25); }
.install-hero h1 { font-size: 26px; color: var(--navy); margin-top: 10px; }
.install-sub { color: var(--muted); }
.install .card h2 { font-size: 17px; color: var(--navy); margin-bottom: 8px; }
.steps li { padding: 8px 0; font-size: 15px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.share-glyph { font-size: 18px; }
.install-note { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 8px; }
.install-foot { justify-content: center; gap: 16px; }
.staff-link { font-size: 12px; color: var(--muted); text-decoration: none; }

/* Tab bar + footer */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; min-height: var(--tabbar-h);
}
.tab-ico { font-size: 22px; position: relative; }
.tab.on { color: var(--navy); }
.tab-badge {
  position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.appfoot {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; font-size: 12px; color: var(--muted);
  background: rgba(242,244,247,.92); border-top: 1px solid var(--line);
}
.appfoot .ver { color: var(--muted); text-decoration: none; font-size: 12px; }
.login-wrap .appfoot, .install-foot { position: static; margin-top: auto; background: transparent; border-top: 0; }
.login-wrap .appfoot { color: rgba(255,255,255,.7); }
.login-wrap .appfoot .ver { color: rgba(255,255,255,.7); }
.cards { list-style: none; margin: 0; padding: 0; }
.cards li { margin-bottom: 12px; }
.link-card { display: block; text-decoration: none; color: var(--ink); margin: 0; }
.link-card:active { background: #F4F7FB; }

@media (min-width: 700px) {
  .pillrow { grid-template-columns: repeat(6, 1fr); }
}
