* { box-sizing: border-box; }
body { margin: 0; font-family: 'Work Sans', sans-serif; background: #FAF8F3; color: #1A1815; }
h1, h2, h3, .display { font-family: 'Space Grotesk', sans-serif; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 216px; flex-shrink: 0; background: #0B4F3F; padding: 22px 14px; box-sizing: border-box; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.navtitle { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #7FA898; padding: 12px 14px 4px; font-weight: 700; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; margin-bottom: 32px; }
.sidebar .brand span { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; color: #FAF8F3; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: #B8D4C9; font-size: 13px; font-weight: 500; transition: background .15s; }
.navlink:hover { background: rgba(255,255,255,0.06); }
.navlink.active { background: rgba(232,130,60,0.16); color: #FAF8F3; font-weight: 600; border-left: 3px solid #E8823C; padding-left: 11px; }

.main { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 72px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: #fff; border-bottom: 1px solid #F1EFE6; box-sizing: border-box; }
.topbar h1 { font-weight: 600; font-size: 22px; margin: 0; }
.content { flex-grow: 1; padding: 24px 32px; overflow-y: auto; box-sizing: border-box; }

.card { background: #fff; border-radius: 16px; box-shadow: 0 2px 10px rgba(26,24,21,0.05); overflow: hidden; }
.card-pad { background: #fff; border-radius: 16px; box-shadow: 0 2px 10px rgba(26,24,21,0.05); padding: 22px; box-sizing: border-box; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border-radius: 10px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: #E8823C; color: #fff; box-shadow: 0 6px 16px rgba(232,130,60,0.3); }
.btn-secondary { background: #0B4F3F; color: #fff; }
.btn-outline { background: #fff; color: #3A362E; border: 1.5px solid #E8E3D8; }
.btn-danger { background: #fff; color: #C0392B; border: 1.5px solid #F0C4A8; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: #3A362E; }
.field input, .field select { height: 44px; padding: 0 14px; border: 1.5px solid #E8E3D8; border-radius: 10px; font-size: 13px; font-family: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: #0B4F3F; box-shadow: 0 0 0 3px rgba(11,79,63,0.1); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(26,24,21,0.05); }
.stat-card .label { font-size: 12px; color: #8A8577; font-weight: 500; }
.stat-card .value { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 28px; margin-top: 8px; color: #0B4F3F; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #8A8577; font-weight: 600; border-bottom: 1px solid #F1EFE6; }
td { padding: 13px 16px; border-bottom: 1px solid #F5F2EA; font-size: 13px; }
tr:hover td { background: #FBF9F4; }

.badge { padding: 4px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.badge-green { background: #E7F4EA; color: #15803D; }
.badge-amber { background: #FDEEDB; color: #D97706; }
.badge-red { background: #FBE7E6; color: #C0392B; }
.badge-gray { background: #F4F1EA; color: #8A8577; }

.error-box { background: #FBE7E6; color: #C0392B; padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.empty { text-align: center; padding: 40px 0; color: #8A8577; font-size: 13px; }


/* ---- Top bar: always visible, with the signed-in person's menu (name, account, Log out) at the right edge ---- */
.topbar { position: sticky; top: 0; z-index: 40; justify-content: flex-start; gap: 16px; }
.topbar h1 { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu { position: relative; flex-shrink: 0; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E8E3D8; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font: 600 13px 'Work Sans', sans-serif; color: #1A1815; }
.usermenu-btn:hover, .usermenu-btn[aria-expanded="true"] { background: #FAF8F3; }
.usermenu-btn:focus-visible, .usermenu-pop a:focus-visible, .usermenu-pop button:focus-visible, .nav-burger:focus-visible { outline: 2px solid #0BA678; outline-offset: 2px; }
.usermenu-av { width: 30px; height: 30px; border-radius: 50%; background: #0B4F3F; color: #FAF8F3; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.usermenu-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid #E8E3D8; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 60; }
.usermenu-pop[hidden] { display: none; }
.usermenu-who { padding: 10px 12px 8px; border-bottom: 1px solid #F1EFE6; margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.usermenu-who span { color: #8A8577; font-size: 12px; }
.usermenu-pop a, .usermenu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font: 500 13px 'Work Sans', sans-serif; color: #1A1815; text-decoration: none; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: #F5F2EA; }
.usermenu-pop .um-out { color: #C0392B; font-weight: 600; }
.nav-burger { display: none; background: none; border: 1px solid #E8E3D8; border-radius: 8px; width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-scrim { display: none; }
@media (max-width: 760px) {
  /* Phones: the menu becomes a drawer behind a button, so the top bar (and Log out) always has room. */
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; transform: translateX(-100%); transition: transform .18s ease; width: 250px; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70; }
  .nav-burger { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .topbar > div:not(.usermenu):not(.nav-burger) { display: none; }
  .usermenu-name { display: none; }
  .usermenu-btn { padding: 4px; }
  .content { padding-left: 12px; padding-right: 12px; }
}

/* ---- Show / hide password (eye) ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; cursor: pointer; border-radius: 8px; color: #6B6558; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.pw-eye:hover { background: rgba(0,0,0,.05); }
.pw-eye:focus-visible { outline: 2px solid #0BA678; outline-offset: 1px; }
