/* MaxFusion Creative Partners — light design system.
   DNA from maxfusion.ai: Oxanium (display), Inter (body),
   warm off-white bg, ink text, money-green accent. */

:root {
  --bg: #f9f8f6;
  --surface: #ffffff;
  --ink: #16171d;
  --muted: #676c7e;
  --line: #e9e7e2;
  --line-strong: #d9d6cf;
  --green: #08b962;
  --green-dark: #079e54;
  --green-soft: #e7f8ef;
  --mint: #5edba6;
  --warn: #9a6b00;
  --warn-soft: #fdf3d7;
  --bad: #d73732;
  --bad-soft: #fdebea;
  --blue: #2f66c4;
  --blue-soft: #eaf1fc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 23, 29, 0.04), 0 4px 16px rgba(22, 23, 29, 0.04);
  --sidebar-w: 236px;
  --display: "Oxanium", "Inter", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .stat .value, .brand-name { font-family: var(--display); }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 2rem 0 0.8rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 0.3rem; }
p.lead, .help { color: var(--muted); line-height: 1.55; }
p.lead { margin-top: 0; }

/* ---------- App shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.65rem; padding: 0.25rem 0.5rem 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; display: block; }
.brand-name { color: var(--ink); font-weight: 700; font-size: 0.98rem; line-height: 1.15; }
.brand-name em { display: block; font-style: normal; font-family: var(--body); font-weight: 500; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.02em; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}
.sidebar nav a svg { flex: none; opacity: 0.85; }
.sidebar nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.sidebar nav a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 0.8rem 0.7rem 0; }
.sidebar-foot .user-email { font-size: 0.8rem; color: var(--muted); word-break: break-all; margin-bottom: 0.35rem; }

.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 1.8rem clamp(1.2rem, 3.5vw, 3rem) 4rem;
  max-width: 1520px;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head .lead { margin-bottom: 0; }
.backlink { display: inline-block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.7rem; }
.backlink:hover { color: var(--ink); text-decoration: none; }

/* ---------- Public (logged-out) shell ---------- */

.public-main { min-height: 100vh; display: flex; flex-direction: column; }
.public-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.2rem, 4vw, 3rem);
}
.public-body { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1.2rem 4rem; }

.hero { text-align: center; padding: clamp(2.5rem, 8vh, 6rem) 0 2.5rem; }
.hero .hero-mark { width: 92px; height: 92px; border-radius: 26px; box-shadow: var(--shadow); margin-bottom: 1.4rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.7rem; }
.hero p.lead { font-size: 1.05rem; max-width: 620px; margin: 0 auto 1.8rem; }
.hero .cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark);
  font-family: var(--display); font-weight: 700; font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

/* ---------- Auth card ---------- */

.auth-card {
  width: 100%; max-width: 430px;
  margin: clamp(1.5rem, 8vh, 6rem) auto 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 2rem 2rem 1.7rem;
}
.auth-card h1 { font-size: 1.35rem; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.68rem 1rem;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.btn-google:hover { background: var(--bg); }
.btn-google svg { flex: none; }

.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.8rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- Cards & grids ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin: 0.8rem 0;
  box-shadow: var(--shadow);
}
.card .meta { color: var(--muted); font-size: 0.87rem; }
.card.accent { border-color: #bfe9d2; background: linear-gradient(180deg, #ffffff, #f4fcf8); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.grid-cards .card { margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.grid-cards .card .spacer { flex: 1; }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr); gap: 1.2rem; align-items: start; }

/* ---------- Stat boxes ---------- */

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0.4rem 0 0.6rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.25rem;
}
.stat .label { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.83rem; font-weight: 600; }
.stat .dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.stat.s-pending .dot { background: #e0a400; }
.stat.s-due .dot { background: var(--blue); }
.stat.s-paid .dot { background: var(--green); }
.stat .value { font-size: 1.9rem; font-weight: 700; margin-top: 0.3rem; letter-spacing: -0.01em; }
.stat .sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.58rem 1.15rem;
  font-family: var(--body);
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #bd2f2a; }
.btn.approve { background: var(--green); }
.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.88rem; padding: 0; font-family: var(--body); }
.btn-link:hover { color: var(--ink); text-decoration: underline; }
.btn.block { display: block; width: 100%; }

/* ---------- Badges & chips ---------- */

.badge {
  display: inline-block;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.submitted, .badge.pending_review { background: var(--warn-soft); color: var(--warn); }
.badge.approved, .badge.paid, .badge.active { background: var(--green-soft); color: var(--green-dark); }
.badge.rejected, .badge.missed { background: var(--bad-soft); color: var(--bad); }
.badge.due { background: var(--blue-soft); color: var(--blue); }
.badge.draft, .badge.closed, .badge.neutral, .badge.paused, .badge.cancelled { background: #efedea; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.14rem 0.65rem;
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.chip svg { flex: none; }
.chip-x { color: var(--ink); background: var(--surface); }
.chip-linkedin { color: #0A66C2; background: #eef5fc; border-color: #d5e5f7; }

.payout { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.payout small { font-family: var(--body); font-weight: 500; color: var(--muted); font-size: 0.78rem; }

/* ---------- Forms ---------- */

form p { margin: 0 0 1rem; }
label { display: block; margin-bottom: 0.35rem; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.58rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.93rem;
  font-family: var(--body);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: var(--green); }

ul.errorlist { color: var(--bad); margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.86rem; }
.helptext { color: var(--muted); font-size: 0.8rem; }

.radio-group label { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; padding: 0.7rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); margin-bottom: 0.6rem; cursor: pointer; background: var(--surface); }
.radio-group label:hover { border-color: var(--green); }
/* The question label itself (direct child of the form's <p>) stays a plain label. */
.radio-group p > label { border: none; padding: 0; margin: 0 0 0.5rem; background: none; cursor: default; font-weight: 600; }
.radio-group p > label:hover { border: none; }
.radio-group input { accent-color: var(--green); }

.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] { width: auto; flex: 1; min-width: 160px; }

.progress { color: var(--muted); font-size: 0.83rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: 0.02em; text-transform: uppercase; }

/* ---------- Messages ---------- */

.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li {
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.messages li.success { border-color: #bfe9d2; background: var(--green-soft); color: #0c5c35; }
.messages li.error { border-color: #f3c2c0; background: var(--bad-soft); color: #8f221e; }
.messages li.info { border-color: #c4d7f4; background: var(--blue-soft); color: #1e4787; }

/* ---------- Data display ---------- */

.kv { margin: 0.4rem 0 0; }
.kv dt { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.8rem; }
.kv dd { margin: 0.15rem 0 0; word-break: break-word; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: #fcfbf9; }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.empty { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 1.6rem; text-align: center; background: rgba(255, 255, 255, 0.5); }

.referral-card { margin-top: 1rem; }
.referral-share { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.referral-code {
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.06em;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
}
.referral-share .btn { display: inline-flex; align-items: center; gap: 0.45rem; }

.approval-steps { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin-top: 0.8rem; }
.approval-steps h4 { margin: 0 0 0.5rem; font-family: var(--display); font-size: 0.9rem; }
.approval-steps ol { margin: 0; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.65; color: var(--ink); }
.approval-steps li { margin-bottom: 0.35rem; }
.approval-steps li:last-child { margin-bottom: 0; }
.approval-steps .flags { display: inline-flex; gap: 0.3rem; vertical-align: -2px; }
.approval-steps .flag { border-radius: 2px; box-shadow: 0 0 0 1px rgba(22, 23, 29, 0.12); }

/* ---------- Responsive ---------- */

@media (max-width: 940px) {
  .shell { display: block; }
  .sidebar {
    position: sticky; inset: auto; width: 100%; height: auto;
    flex-direction: row; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .brand-name em { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; flex: 1; }
  .sidebar nav a { white-space: nowrap; padding: 0.4rem 0.6rem; }
  .sidebar nav a svg { display: none; }
  .sidebar-foot { border-top: none; padding: 0; display: flex; align-items: center; gap: 0.6rem; }
  .sidebar-foot .user-email { display: none; }
  .content { margin-left: 0; padding: 1.2rem 1rem 3rem; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .stat-row { grid-template-columns: 1fr; }
  .auth-card { border: none; box-shadow: none; background: transparent; padding: 1rem 0.2rem; }
}

.clearing { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--blue); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.clearing svg { flex: none; }

/* Staff calendar */
.cal-nav { display: flex; align-items: center; gap: 0.6rem; }
.cal-month { font-family: var(--display); font-weight: 600; min-width: 9.5rem; text-align: center; }
.calendar { padding: 0.7rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }
.cal-head { margin-top: 0; }
.cal-head div { text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--muted); padding: 0.25rem 0; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-day { min-height: 88px; border: 1px solid var(--line); border-radius: 8px; padding: 0.3rem 0.35rem; display: flex; flex-direction: column; gap: 2px; background: #fff; color: var(--ink); }
.cal-day.dim { background: var(--bg); opacity: 0.55; }
.cal-day.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.cal-day.selected { background: var(--green-soft); border-color: var(--green); }
a.cal-day:hover { text-decoration: none; border-color: var(--line-strong); background: var(--bg); }
a.cal-day.selected:hover { background: var(--green-soft); }
.cal-num { font-weight: 600; font-size: 0.78rem; }
.cal-day.today .cal-num { color: var(--green-dark); }
.cal-chip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 5px; padding: 1px 5px; font-size: 0.68rem; font-weight: 600; }
.cal-chip.lg { display: inline-block; font-size: 0.78rem; padding: 3px 9px; border-radius: 999px; }
.cal-chip.blue { background: var(--blue-soft); color: var(--blue); }
.cal-chip.green { background: var(--green-soft); color: var(--green-dark); }
.cal-chip.amber { background: var(--warn-soft); color: var(--warn); }
.cal-chip.muted { background: #efedea; color: var(--muted); }
.cal-more { font-size: 0.66rem; color: var(--muted); }
.slot-row { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.slot-when { min-width: 8.5rem; }
.slot-pay { font-size: 1.05rem; white-space: nowrap; }
.slot-dialog { border: none; border-radius: 14px; padding: 0; max-width: 540px; width: 92%; box-shadow: 0 18px 50px rgba(20, 18, 12, 0.25); }
.slot-dialog::backdrop { background: rgba(20, 18, 12, 0.45); }
.dialog-body { padding: 1.4rem 1.5rem; }
.dialog-body .kv { margin: 1rem 0; }
.pay-box, .bonus-box, .cancel-box { border: 1px solid var(--border, #e5e1da); border-radius: 10px; padding: 0.8rem 1rem; margin-top: 0.8rem; }
.pay-box .pay-amount { font-size: 1.5rem; }
.bonus-box { background: var(--warn-soft, #fdf6e3); }
.cancel-box { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
@media (max-width: 700px) {
  .cal-day { min-height: 52px; }
  .cal-chip { display: none; }
  .cal-day.has-entries::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
}
