* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --text: #1c2333; --muted: #67707f; --primary: #2456d6; --primary-dark: #1a41a8;
  --border: #e2e6ee; --danger: #c62838; --ok: #1c8a4c;
}
body {
  font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); font-size: 15px;
  min-height: 100vh; background: linear-gradient(150deg, #101c3d 0%, #1c3a86 55%, #2456d6 100%);
}
button { font: inherit; cursor: pointer; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; width: 100%; }
input:focus { outline: 2px solid #b9cbf5; border-color: var(--primary); }
a { color: inherit; text-decoration: none; }

/* ---- Login ---- */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { background: #fff; padding: 34px; border-radius: 16px; width: 370px; max-width: 92vw; box-shadow: 0 22px 60px rgba(6, 16, 45, .45); }
.login-box .logo { text-align: center; font-size: 40px; margin-bottom: 6px; }
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 2px; }
.login-box .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; text-align: center; }
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 600; }
.btn:hover { background: var(--primary-dark); }
.btn.block { width: 100%; }

/* ---- Portal ---- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 24px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 800; font-size: 26px; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.brand .dot { color: #8fb2ff; }
.userchip { display: flex; align-items: center; gap: 12px; color: #cdd8f5; font-size: 13.5px; }
.userchip strong { color: #fff; }
.userchip button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; padding: 6px 12px; font-size: 13px; }
.userchip button:hover { background: rgba(255,255,255,.22); }
.lead { color: #b9c6ea; font-size: 15px; margin-bottom: 30px; max-width: 640px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile {
  background: #fff; border-radius: 15px; padding: 22px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 10px 30px rgba(6, 16, 45, .22); transition: transform .13s, box-shadow .13s; position: relative; min-height: 168px;
}
a.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(6, 16, 45, .3); }
.tile .icon { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.tile .name { font-size: 18px; font-weight: 700; }
.tile .desc { color: var(--muted); font-size: 13.5px; line-height: 1.4; flex: 1; }
.tile .go { color: var(--primary); font-weight: 600; font-size: 13.5px; margin-top: 6px; }
.tile.soon { opacity: .82; }
.badge { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 3px 9px; }
.badge.live { background: #e5f4ec; color: var(--ok); }
.badge.soon { background: #eef1f7; color: var(--muted); }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #16204a; color: #fff; padding: 11px 18px; border-radius: 9px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

@media (max-width: 560px) {
  .wrap { padding: 26px 16px 44px; }
  .brand { font-size: 22px; }
}
