/* Hub by YEA — CID design system (self-contained subset of YEAPIgo's
   yeapigo.css, plus hub-specific components). */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --blue:   #2196D6;
  --orange: #F26522;
  --purple: #9C3F9E;
  --teal:   #29B6A8;
  --gold:   #F5B622;
  --ink:    #2b323c;
  --muted:  #7d8794;
  --line:   #e9ebee;
  --bg:     #eef1f5;
  --soft:   #f8f9fa;
  --hero-a: #1c2530;
  --hero-b: #2b323c;

  --shadow-card: 0 6px 22px rgba(43,50,60,.06);
  --shadow-pop:  0 24px 70px rgba(43,50,60,.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Top bar ─────────────────────────────────────────────── */
.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hub-brand { display: flex; align-items: center; gap: 12px; }
.hub-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 6px 16px rgba(33,150,214,.35);
  color: #fff; font-weight: 900; font-size: 20px;
}
.hub-brand .wm { font-weight: 900; font-size: 16px; letter-spacing: -.01em; }
.hub-brand .wm small { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.btn-admin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--soft); color: var(--muted);
  font-weight: 800; font-size: 12px; text-decoration: none;
  border: 1.5px solid var(--line); transition: .15s;
}
.btn-admin:hover { color: var(--purple); border-color: #e0c9e8; background: #faf5fb; }

.hub-user { display: flex; align-items: center; gap: 14px; font-size: 12.5px; }
.hub-user .who { text-align: right; line-height: 1.25; }
.hub-user .who b { font-weight: 800; }
.hub-user .who span { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.hub-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff; font-weight: 800; font-size: 14px;
}

/* ── Layout ──────────────────────────────────────────────── */
.hub-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

/* ── Hero welcome band ───────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  border-radius: 22px;
  padding: 30px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}
.hero::after {
  content: "";
  position: absolute; right: -60px; top: -70px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(33,150,214,.38), transparent 70%);
}
.hero::before {
  content: "";
  position: absolute; left: -50px; bottom: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(156,63,158,.30), transparent 70%);
}
.hero .greet { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; position: relative; }
.hero h1 { margin: 6px 0 8px; font-size: 30px; font-weight: 900; letter-spacing: -.02em; position: relative; }
.hero p { margin: 0; font-size: 13.5px; font-weight: 600; opacity: .82; position: relative; max-width: 560px; }

/* ── Section heading ─────────────────────────────────────── */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 2px 16px; }
.sec-head h2 { margin: 0; font-size: 16px; font-weight: 900; letter-spacing: -.01em; }
.sec-head span { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ── Tool card grid ──────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .2s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(43,50,60,.10); }

.tool-bar {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 18px;
  color: #fff;
}
.tool-bar .ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: rgba(255,255,255,.18);
}
.tool-bar .t { font-weight: 900; font-size: 15.5px; line-height: 1.15; }
.tool-bar .d { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; margin-top: 2px; }

/* accent variants for the coloured header band */
.acc-blue   { background: linear-gradient(120deg, #2196D6, #1c7cb8); }
.acc-teal   { background: linear-gradient(120deg, #29B6A8, #1f8f9c); }
.acc-orange { background: linear-gradient(120deg, #F26522, #d84f1a); }
.acc-purple { background: linear-gradient(120deg, #9C3F9E, #7a2f86); }
.acc-gold   { background: linear-gradient(120deg, #F5B622, #e08e12); }

.tool-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tool-desc { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.5; margin: 0; flex: 1; }

.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ── Status badge ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 800;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.ok      { background: #e7f6ee; color: #1c7a46; }
.badge.ok .dot { background: #22a35a; }
.badge.pending      { background: #fef3d9; color: #a56a08; }
.badge.pending .dot { background: #efab1c; }
.badge.none      { background: #eef1f5; color: #8a929c; }
.badge.none .dot { background: #b3bcc6; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border: none; border-radius: 11px;
  font-family: inherit; font-weight: 800; font-size: 12.5px;
  color: #fff; cursor: pointer; text-decoration: none;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  box-shadow: 0 8px 20px rgba(33,150,214,.28);
  transition: transform .1s ease, box-shadow .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn.acc-blue-btn   { background: linear-gradient(90deg, #2196D6, #1c7cb8); box-shadow: 0 8px 20px rgba(33,150,214,.30); }
.btn.acc-teal-btn   { background: linear-gradient(90deg, #29B6A8, #1f8f9c); box-shadow: 0 8px 20px rgba(41,182,168,.30); }
.btn.acc-orange-btn { background: linear-gradient(90deg, #F5A020, #F26522); box-shadow: 0 8px 20px rgba(242,101,34,.30); }
.btn.acc-purple-btn { background: linear-gradient(90deg, #9C3F9E, #7a2f86); box-shadow: 0 8px 20px rgba(156,63,158,.30); }
.btn.acc-gold-btn   { background: linear-gradient(90deg, #F5B622, #e08e12); box-shadow: 0 8px 20px rgba(245,182,34,.30); }

.btn.ghost {
  background: #fff; color: var(--muted);
  border: 1.5px solid var(--line); box-shadow: none;
}
.btn.ghost:hover { color: var(--ink); border-color: #d5dae0; }

.btn.disabled {
  background: #eef1f5; color: #aab2bc; box-shadow: none;
  cursor: not-allowed; pointer-events: none;
}
.btn.sm { padding: 8px 14px; font-size: 12px; }
.btn.block { width: 100%; }

.btn-logout {
  background: none; border: 1.5px solid var(--line); color: var(--muted);
  padding: 8px 14px; border-radius: 10px; font-family: inherit;
  font-weight: 800; font-size: 12px; cursor: pointer; transition: .15s;
}
.btn-logout:hover { color: var(--orange); border-color: #f3cbb8; }

/* ── Admin: client management table ─────────────────────── */
.admin-table-wrap {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-card); overflow: auto;
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th {
  text-align: left; padding: 12px 16px; font-size: 10.5px; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: #fafbfc; }
.client-name { font-weight: 800; color: var(--ink); }
.link-select {
  padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink);
  background: #fff; min-width: 220px; max-width: 260px;
}
.link-select:focus { outline: none; border-color: var(--blue); }
.link-saved { font-size: 11px; font-weight: 700; color: #1c7a46; margin-left: 8px; opacity: 0; transition: opacity .2s; }
.link-saved.show { opacity: 1; }
.admin-search {
  width: 100%; max-width: 320px; padding: 10px 14px; margin-bottom: 16px;
  border: 1.5px solid var(--line); border-radius: 11px; font-family: inherit;
  font-size: 13px; font-weight: 600; background: #fff;
}
.admin-search:focus { outline: none; border-color: var(--blue); }

/* ── Empty / loading ─────────────────────────────────────── */
.state {
  text-align: center; color: var(--muted);
  padding: 60px 20px; font-weight: 700; font-size: 13px;
}
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--line); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hub-foot { text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600; margin-top: 36px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 560px) {
  .hub-top { padding: 14px 18px; }
  .hub-main { padding: 20px 16px 44px; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 24px; }
  .hub-user .who { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
}

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2196D6 0%, #9C3F9E 55%, #F26522 100%);
  padding: 24px;
}
.login-card {
  width: 420px; max-width: 100%;
  background: #fff; border-radius: 20px;
  padding: 38px 34px 30px;
  box-shadow: var(--shadow-pop);
}
.login-card .logo {
  width: 62px; height: 62px; border-radius: 18px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 10px 26px rgba(33,150,214,.4);
  color: #fff; font-size: 30px; font-weight: 900;
}
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 20px; font-weight: 900; letter-spacing: -.01em; }
.login-card .sub { text-align: center; margin: 0 0 24px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  background: #fff; color: var(--ink); transition: border .15s;
}
.input:focus { outline: none; border-color: var(--blue); }

.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-weight: 800; font-size: 13.5px;
  cursor: pointer; transition: .15s; text-decoration: none;
}
.btn-google:hover { border-color: #d5dae0; background: var(--soft); }
.btn-google svg { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alert { padding: 11px 14px; border-radius: 11px; margin-bottom: 16px; font-size: 12.5px; font-weight: 700; }
.alert.ok  { background: #e7f6ee; color: #1c7a46; border: 1px solid #cbe8d0; }
.alert.err { background: #fdecea; color: #c0392b; border: 1px solid #f5c9c4; }

.copyright { color: rgba(255,255,255,.85); font-size: 11.5px; font-weight: 600; margin-top: 22px; text-shadow: 0 1px 2px rgba(0,0,0,.15); }

.dev-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.dev-block .lbl { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
