/* Muñiz Automations — Internal app launcher
   Spotify-style layout, Muñiz brand palette. Matches the CRM theme. */
:root {
  --bg: #0e141b;
  --surface: #151e28;
  --surface-2: #1d2935;
  --surface-3: #243344;
  --line: #314252;
  --ink: #edf5fb;
  --muted: #b2c2d1;
  --faint: #7d93a6;
  --brand: #69b6ef;
  --brand-deep: #3d9be9;
  --accent: #f1865d;
  --accent-soft: #3a2417;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --font-body: "DM Sans", -apple-system, "Segoe UI", sans-serif;
  --font-head: "Manrope", "DM Sans", -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  min-height: 100vh;
}
h1, h2 { font-family: var(--font-head); letter-spacing: -.03em; margin: 0; }
a { color: inherit; }

.hub { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.hub-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: #0b1118; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #08131d; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; }
.brand-sub { color: var(--faint); font-size: .8rem; }
.chip {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand); background: var(--brand-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin-left: 6px;
  vertical-align: 1px;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 600; color: var(--faint);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-pill.ok { color: var(--ok); }
.status-pill.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-pill.bad { color: var(--bad); }
.status-pill.bad .dot { background: var(--bad); }
.user-badge {
  font-size: .8rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- main ---------- */
.hub-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 44px 28px 60px; }
.hub-main h1 { font-size: 2rem; font-weight: 800; }
.hub-sub { color: var(--muted); margin: 8px 0 30px; font-size: 1.02rem; }

.app-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.app-card {
  position: relative; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s;
  min-height: 220px;
}
a.app-card:hover {
  transform: translateY(-3px); border-color: var(--brand);
  box-shadow: var(--shadow);
}
.app-icon {
  width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.app-icon svg { width: 26px; height: 26px; }
.app-icon-blue { background: rgba(105, 182, 239, .14); color: var(--brand); border: 1px solid rgba(105, 182, 239, .35); }
.app-icon-orange { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(241, 134, 93, .35); }
.app-icon-ghost { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--line); }
.app-body { flex: 1; }
.app-body h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.app-body p { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.app-stat { font-size: .82rem; font-weight: 600; color: var(--brand); }
.app-open { font-weight: 700; color: var(--ink); font-size: .95rem; }
a.app-card:hover .app-open { color: var(--brand); }
.app-card-ghost { opacity: .65; border-style: dashed; cursor: default; }
.app-card-ghost h2 { color: var(--muted); }

.hub-foot {
  padding: 18px 28px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: .8rem; text-align: center;
}

@media (max-width: 640px) {
  .hub-top { padding: 14px 16px; }
  .hub-main { padding: 28px 16px 44px; }
  .hub-main h1 { font-size: 1.6rem; }
  .user-badge { display: none; }
}
