:root {
  --bg: #F8FAFC; --card: #fff; --line: #CBD5E1; --line-soft: #E2E8F0;
  --text: #0F172A; --muted: #475569; --body: #334155;
  --accent: #1D4ED8; --stg: #D97706; --stg-bg: #FEF3C7; --stg-text: #78350F;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
.page { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.brand { margin: 0; font-size: 24px; font-weight: 700; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.who form { margin: 0; }
.btn { font: inherit; font-size: 14px; padding: 8px 14px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--body); cursor: pointer; }
.btn:hover { background: var(--line-soft); }
a.btn { display: inline-block; text-decoration: none; }

.search { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); margin-bottom: 12px; }
.search::placeholder { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.chip { font: inherit; font-size: 14px; padding: 6px 14px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--body); cursor: pointer; }
.chip:hover { background: var(--line-soft); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; color: var(--body); background: none; border: 0; padding: 6px 0; min-height: 36px; cursor: pointer; }
.sw { width: 36px; height: 20px; border-radius: 999px; background: #64748B; position: relative; flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle[aria-checked="true"] .sw { background: var(--accent); }
.toggle[aria-checked="true"] .sw::after { left: 19px; }

.sec { display: flex; align-items: center; gap: 8px; margin: 24px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.count { font-weight: 500; letter-spacing: 0; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }

.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 12px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; color: var(--text); text-decoration: none; text-align: center; transition: box-shadow .15s, border-color .15s; }
.card:hover { border-color: var(--line); box-shadow: 0 2px 8px rgba(15, 23, 42, .1); }
.card.stg { border-style: dashed; border-color: var(--stg); }
.name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.badge { position: absolute; top: 6px; right: 6px; font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--stg-bg); color: var(--stg-text); }

.logo { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo img { width: 40px; height: 40px; object-fit: contain; }
.logo.ini { color: #fff; font-weight: 700; font-size: 14px; }
/* Paleta fixa (a CSP bloqueia style inline); todas com contraste AA contra texto branco. */
.c-0 { background: #7C3AED; } .c-1 { background: #475569; } .c-2 { background: #BE185D; } .c-3 { background: #C2410C; }
.c-4 { background: #0F766E; } .c-5 { background: #1D4ED8; } .c-6 { background: #0369A1; } .c-7 { background: #A21CAF; }

.msg { margin: 32px 0; text-align: center; color: var(--body); }
.msg .btn { margin-top: 12px; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .toggle { margin-left: 0; width: 100%; }
}
