/* Evergreen Siteworks brand: green #329B47, black #231F20 */
:root {
  --green: #329B47; --green-dark: #267a37; --green-soft: #e6f3e9;
  --black: #231F20; --bg: #f3f5f3; --surface: #fff; --sunk: #eaeeea;
  --text: #231F20; --muted: #5d655f; --line: #d9dfda; --warn-bg: #fff4e0; --warn: #8a5300;
  --danger: #b3261e; --radius: 12px;
  --display: "Archivo", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
[hidden] { display: none !important; }
a { color: var(--green-dark); }
h1, h2 { font-family: var(--display); font-stretch: 112%; letter-spacing: -.01em; }
h1 { font-weight: 850; font-size: 28px; margin: 0 0 4px; }
h2 { font-weight: 750; font-size: 18px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.bar { background: var(--black); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 28px; width: auto; }
.brand span { font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 18px; border-left: 1px solid #ffffff44; padding-left: 10px; }
nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
nav a { color: #fff; text-decoration: none; opacity: .85; }
nav a:hover, nav a.on { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
nav .who { color: #ffffffaa; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { nav .who { display: none; } nav { gap: 12px; } .brand img { height: 22px; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 16px 60px; }
.center { display: grid; place-items: center; min-height: calc(100vh - 60px); padding-top: 0; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 3px #0000001a, 0 0 0 1px #0000000a; padding: 22px; }
.hero { max-width: 440px; text-align: center; padding: 36px 28px; }
.hero-logo { width: 240px; max-width: 80%; margin-bottom: 14px; }
.hero p { color: var(--muted); margin: 6px 0 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font: 600 14px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.big { padding: 12px 20px; font-size: 16px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--sunk); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }

.greet { margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 18px; }
.tile { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 3px #0000001a, 0 0 0 1px #0000000a; border-top: 4px solid var(--green); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #00000022, 0 0 0 1px #0000000a; }
.tile .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; }
.tile h2 { margin: 0; font-size: 20px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile .open { margin-top: auto; font-weight: 600; color: var(--green-dark); font-size: 14px; }
.tile.admin-tile { border-top-color: var(--black); }
.tile.admin-tile .ico { background: var(--sunk); color: var(--black); }

.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }

.admin-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 10px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; font: 600 14px var(--body); color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #0002; }
.badge { background: var(--green); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

.add { margin-bottom: 26px; }
.search-row input, .list-head input, .manual-form input[type=email], .manual-form input[type=text] {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 15px var(--body); background: #fff; }
.search-row input:focus, .list-head input:focus, .manual-form input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: transparent; }
.dir { list-style: none; margin: 10px 0 0; padding: 0; }
.dir li { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
.dir li:first-child { border-top: 0; }
.person b { display: block; }
.person span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.dir .pick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--sunk); padding: 10px 12px; border-radius: 8px; }
.dir .pick .btn { margin-left: auto; }
.pill-added { font-size: 12px; color: var(--green-dark); background: var(--green-soft); padding: 3px 9px; border-radius: 99px; font-weight: 600; }
.manual { margin-top: 14px; }
.manual summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.manual-form { display: grid; gap: 10px; margin-top: 10px; max-width: 520px; }
.manual-form .btn { justify-self: start; }
.app-picks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.chk input { width: 17px; height: 17px; accent-color: var(--green); margin: 0; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.list-head input { max-width: 260px; }
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 3px #0000001a, 0 0 0 1px #0000000a; overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
.users th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users tr:last-child td { border-bottom: 0; }
.users tr.off td { opacity: .55; }
.users td.apps .picks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.users .when { color: var(--muted); white-space: nowrap; font-size: 13px; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); border: 0; cursor: pointer; white-space: nowrap; }
.status.off { background: var(--sunk); color: var(--muted); }
.status:disabled { cursor: default; }
.lock { font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .users thead { display: none; }
  .users, .users tbody, .users tr, .users td { display: block; width: 100%; }
  .users tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .users td { border: 0; padding: 4px 0; }
  .users td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .users td.apps::before, .users td.adm::before { display: none; }
}

.reqs, .activity { list-style: none; margin: 0; padding: 0; }
.reqs li { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 1px 3px #0000001a;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.reqs .person { flex: 1 1 220px; }
.activity li { padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.activity time { color: var(--muted); font-size: 13px; min-width: 150px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--black); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 6px 20px #0004; max-width: calc(100% - 32px); z-index: 20; }
.toast.err { background: var(--danger); }

.msg-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.msg { max-width: 460px; text-align: center; }
.msg-logo { width: 200px; margin-bottom: 12px; }
.msg h1 { font-size: 22px; }
.msg p { color: var(--muted); margin: 8px 0 20px; overflow-wrap: anywhere; }
