:root {
  --ink: #000;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --canvas: #fff;
  --page: #fafafa;
  --ok: #2d6c4e;
  --down: #a4322d;
  --info: #8a6d1f;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; }

.topbar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px clamp(16px, 4vw, 52px); background: var(--canvas); border-bottom: 1px solid var(--line); }
.topbar .logo { height: 28px; width: auto; display: block; }
.topbar .title { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 16px; border-left: 1px solid var(--line); }
.account { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .82rem; color: var(--muted); }
.account a { color: var(--ink); white-space: nowrap; }
/* User menu: same pattern as the CRM and DI Locations (user-icon + user-menu panel) */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--page); }
.user-menu summary:hover .user-icon, .user-menu[open] .user-icon { border-color: var(--ink); }
.user-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; display: flex; min-width: 240px; padding: 16px; flex-direction: column; align-items: flex-start; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); color: var(--ink); font-size: .86rem; }
.user-menu-email { max-width: 100%; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.role-pill { margin: 4px 0 8px; padding: 4px 8px; border-radius: 999px; color: #fff; background: var(--ink); font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.user-menu-panel form, .user-menu-panel .btn { width: 100%; }
.btn { display: inline-flex; min-height: 42px; padding: 10px 17px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 700; }
.btn.secondary { border-color: #d4d4d4; color: var(--ink); background: #fff; }
.btn.secondary:hover { border-color: var(--ink); }
.btn.compact { min-height: 34px; padding: 6px 12px; font-size: .8rem; }
@media (max-width: 600px) { .topbar .title { display: none; } }

main { max-width: 1260px; margin: 0 auto; padding: 44px clamp(16px, 4vw, 52px) 64px; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.5rem); letter-spacing: -.02em; margin: 0 0 6px; }
.sub { margin: 0 0 32px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }

.card { aspect-ratio: 1 / 1; display: flex; flex-direction: column; padding: 22px; background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: #bdbdbd; box-shadow: 0 6px 22px rgba(0,0,0,.06); transform: translateY(-2px); }
a.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (max-width: 480px) { .card { aspect-ratio: auto; min-height: 220px; } }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.icon { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; }
.icon svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); }
.status[hidden] { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.up { color: var(--ok); }
.status.down { color: var(--down); }
.status.info { color: var(--info); }

.card h2 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin: 28px 0 6px; }
.card p { margin: 0 0 16px; font-size: .86rem; color: var(--muted); }
.open { margin-top: auto; font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card.soon { background: #fdfdfd; }
.card.soon .open { color: var(--muted); font-weight: 600; }

footer { margin-top: 36px; font-size: .78rem; color: var(--muted); }

/* Sign-in page */
.signin { max-width: 420px; margin: 12vh auto 0; padding: 36px 32px; background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.signin .logo { height: 32px; width: auto; margin: 0 auto 24px; display: block; }
.signin h1 { font-size: 1.7rem; }
.signin p { color: var(--muted); margin: 0 0 24px; font-size: .9rem; }
.signin .gbtn { display: flex; justify-content: center; min-height: 44px; }
.signin .msg { margin: 16px 0 0; font-size: .86rem; color: var(--down); min-height: 1.2em; }
.signin .fine { margin: 24px 0 0; font-size: .74rem; }
.brand { display: block; }
.sub a { color: var(--ink); }
.empty { margin: 24px 0 0; padding: 20px 22px; background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }

/* Activity log (/activity, Owners) */
main.wide { max-width: none; }
.act-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; margin: 20px 0 8px; padding: 16px; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; }
.act-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.act-filters input, .act-filters select { min-height: 34px; min-width: 150px; padding: 6px 8px; border: 1px solid #d4d4d4; border-radius: 6px; font: inherit; font-size: .86rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: #fff; }
.act-buttons .btn:not(.secondary) { color: #fff; background: var(--ink); }
.act-note { color: var(--muted); font-size: .82rem; }
.act-error { padding: 12px 14px; border: 1px solid var(--down); border-radius: 8px; color: var(--down); background: #fff; }
.act-scroll { overflow-x: auto; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; }
.act-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.act-table th { position: sticky; top: 0; padding: 9px 10px; text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--page); border-bottom: 1px solid var(--line); }
.act-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.act-table tr.act-event td { background: #fbf8f1; }
.act-what { min-width: 280px; word-break: break-word; }
.act-what code, .act-table td code { font-size: .78rem; }
.act-kv { color: var(--muted); font-size: .74rem; }
.act-anon { color: var(--muted); font-style: italic; }
.act-sev { font-weight: 700; }
.act-sev.error { color: var(--down); }
.act-sev.warning { color: var(--info); }
.act-ms { color: var(--muted); font-size: .74rem; }
.nowrap { white-space: nowrap; }
@media (max-width: 600px) { .act-filters input, .act-filters select { min-width: 0; width: 100%; } .act-filters label { width: 100%; } }
