/* Magic Marketing Partners: a standalone dashboard, separate from the CRM */
:root {
  --navy: #080530; --blue: #3366ff; --blue-600: #2450d8; --blue-100: #e8eeff; --orange: #ffa500;
  --bg: #f4f6fb; --surface: #fff; --surface-2: #f8f9fd; --border: #e4e7f1; --text: #1c1b33; --muted: #6b7280;
  --ok: #14a06a; --ok-bg: #e3f6ee; --warn: #b26a00; --warn-bg: #fff3dc; --danger: #e0393e; --danger-bg: #fdecec; --purple: #7c4dff;
  --r: 14px; --sh: 0 1px 2px rgba(8,5,48,.05), 0 4px 16px rgba(8,5,48,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Assistant, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
input { font: inherit; font-size: 15px; width: 100%; height: 44px; border: 1px solid #d5d9e8; border-radius: 10px; padding: 0 12px; background: #fff; color: var(--text); }
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: #c9cfe3; background: var(--surface-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 8px #3366ff40; }
.btn.primary:hover { background: var(--blue-600); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; height: 46px; font-size: 16px; }
.btn:disabled { opacity: .7; cursor: wait; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 700; font-size: 14px; }
.fld small { font-weight: 400; color: var(--muted); }
.err { color: var(--danger); min-height: 1.2em; margin: 0 0 10px; font-weight: 600; font-size: 14px; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand i { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--orange), #ffc95c); color: var(--navy); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 18px; font-family: Arial, sans-serif; }
.brand b { display: block; font-size: 16px; line-height: 1.1; }
.brand span { font-size: 13px; font-weight: 800; color: var(--orange); }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr); }
.auth-side { background: linear-gradient(150deg, var(--navy) 0%, #1b1a6b 60%, var(--blue) 130%); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; gap: 26px; }
.auth-side .brand b { color: #fff; }
.auth-side h1 { font-size: 34px; max-width: 440px; margin-top: auto; }
.auth-side ul { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 12px; font-size: 16px; color: #d9defa; }
.auth-side li b { color: var(--orange); font-size: 20px; margin-inline-end: 4px; }
.auth-site { color: #aab3ec; font-size: 13.5px; }
.auth-main { display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 30px 28px; box-shadow: var(--sh); }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card > p.muted { margin: 0 0 20px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }

/* dashboard */
.top { height: 64px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.acct { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.acct:hover { background: var(--surface-2); }
.view { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.card.pad { padding: 20px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 16px; }
.sk { height: 150px; border-radius: var(--r); background: linear-gradient(90deg, #eceff7, #f6f7fb, #eceff7); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk.tall { height: 340px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: center; padding: 24px 26px; border-radius: 18px; background: linear-gradient(120deg, var(--navy) 0%, #1b1a6b 55%, var(--blue) 100%); color: #fff; }
.hero h1 { font-size: 27px; margin-bottom: 6px; }
.hero p { margin: 0 0 12px; color: #d9defa; }
.rate { display: inline-block; background: var(--orange); color: var(--navy); font-weight: 800; border-radius: 10px; padding: 7px 12px; }
.tier { background: #ffffff14; border: 1px solid #ffffff2a; border-radius: 14px; padding: 14px 16px; }
.tier p { margin: 4px 0 0; color: #d9defa; }
.tier .gold { color: #ffc95c; }
.tier-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tier small { display: block; margin-top: 6px; color: #c7cdf3; }
.bar { height: 10px; border-radius: 10px; background: #ffffff26; overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 6px; border-radius: 10px; background: linear-gradient(90deg, var(--orange), #ffc95c); }
.reflink { padding: 16px 18px; display: grid; gap: 10px; }
.link-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.link-head b { font-size: 16px; }
.link-head small { color: var(--muted); }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; font-size: 13.5px; background: var(--surface-2); }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 15px 17px; box-shadow: var(--sh); border-inline-start: 4px solid var(--blue); display: grid; gap: 2px; }
.kpi.ok { border-inline-start-color: var(--ok); } .kpi.warn { border-inline-start-color: var(--orange); } .kpi.purple { border-inline-start-color: var(--purple); }
.kpi span { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.kpi b { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); overflow: hidden; }
.funnel > div { padding: 14px 10px; text-align: center; border-inline-start: 1px solid var(--border); }
.funnel > div:first-child { border-inline-start: 0; }
.funnel b { display: block; font-size: 24px; font-weight: 800; }
.funnel span { font-size: 13px; color: var(--muted); font-weight: 600; }
.funnel .won b { color: var(--ok); } .funnel .lost b { color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .main { font-weight: 700; }
.tbl .sub { font-size: 12.5px; color: var(--muted); }
.tbl .num, .tbl .nowrap { white-space: nowrap; }
.tbl .empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.track { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.track i { width: 18px; height: 6px; border-radius: 6px; background: var(--border); }
.track i.on { background: var(--blue); } .track i.on.won { background: var(--ok); }
.track span { margin-inline-start: 6px; font-weight: 700; font-size: 13px; }
.chip { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.won { background: var(--ok-bg); color: var(--ok); } .chip.part { background: var(--warn-bg); color: var(--warn); } .chip.lost { background: var(--danger-bg); color: var(--danger); }
.how { padding: 16px 20px; }
.how b { font-size: 16px; }
.how ol { margin: 10px 0; padding-inline-start: 20px; line-height: 1.9; }
.how p { margin: 0; }

/* set password */
.setpass { padding: 16px 18px; display: flex; gap: 14px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid #ffd27a; background: #fffaf0; }
.setpass b { display: block; font-size: 16px; }
.setpass small { color: var(--muted); }
.setpass-row { display: flex; gap: 8px; flex: 1; min-width: 260px; max-width: 460px; }
.setpass-row input { flex: 1; min-width: 0; }
.toast.err { background: var(--danger); }

/* modal + toasts */
.modal-bd { position: fixed; inset: 0; background: rgba(8,5,48,.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(8,5,48,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin-bottom: 6px; }
.modal-head .x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal .note { background: #fffaf0; border: 1px solid #ffd27a; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); display: grid; gap: 8px; z-index: 30; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: .2s; box-shadow: var(--sh); }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px; gap: 14px; }
  .auth-side h1 { font-size: 22px; margin-top: 4px; }
  .auth-side ul { font-size: 14.5px; gap: 6px; margin: 0; }
  .auth-site { display: none; }
  .auth-main { place-items: start center; padding: 20px 16px 40px; }
  .auth-card { padding: 22px 18px; }
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .hero h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 21px; }
  .link-row { flex-direction: column; }
  .top { padding: 0 16px; }
  .view { padding: 16px 16px 50px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: start; }
  .tbl td::before { content: attr(data-l); color: var(--muted); font-size: 12.5px; font-weight: 600; }
  .tbl td.empty { display: block; } .tbl td.empty::before { content: none; }
}
