/* Novialife — app styles. Self-contained, no external fonts/CDNs. */
:root {
  --ink: #14121f;
  --ink-2: #2c2942;
  --muted: #6b6880;
  --line: #e7e4ef;
  --bg: #ffffff;
  --bg-soft: #f7f6fb;
  --brand: #6d28d9;      /* violet */
  --brand-2: #ec4899;    /* pink */
  --accent: #0ea5a4;     /* teal */
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,18,31,.06), 0 8px 24px rgba(20,18,31,.06);
  --maxw: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC",
    "PingFang HK", "Microsoft JhengHei", Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: 2.4rem; letter-spacing: -.02em; }
h2 { font-size: 1.6rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---- top nav ---- */
.nav {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(150%) blur(8px); border-bottom: 1px solid var(--line);
}
.nav .row { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--ink); }
.brand .dot { color: var(--brand-2); }
.nav .links { display: flex; gap: 18px; align-items: center; margin-left: 6px; }
.nav .links a { color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav .spacer { flex: 1; }
.nav .lang a { color: var(--muted); font-size: .82rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: .95rem; transition: .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #5b21b6; color:#fff; }
.btn-pink { background: var(--brand-2); color: #fff; }
.btn-pink:hover { background: #db2777; color:#fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- hero ---- */
.hero { padding: 84px 0 60px; background:
  radial-gradient(1200px 400px at 80% -10%, rgba(236,72,153,.10), transparent),
  radial-gradient(900px 400px at 0% 0%, rgba(109,40,217,.10), transparent); }
.hero h1 { max-width: 16ch; }
.hero .lede { font-size: 1.2rem; color: var(--ink-2); max-width: 52ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  font-weight: 700; color: var(--brand); margin-bottom: 14px; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.pill-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:28px; }
.pill { border:1px solid var(--line); background:#fff; border-radius:999px;
  padding:6px 14px; font-size:.85rem; color:var(--ink-2); }

/* ---- sections / cards ---- */
section { padding: 54px 0; }
section.soft { background: var(--bg-soft); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.12rem; }
.card .ico { font-size: 1.5rem; }
.stat { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat.brand { color: var(--brand); }
.kpis { display:grid; grid-template-columns: repeat(4,1fr); gap:16px; }
.kpi { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:18px; }
.kpi .n { font-size:1.7rem; font-weight:800; letter-spacing:-.02em; }
.kpi .l { color:var(--muted); font-size:.85rem; }

/* ---- badges ---- */
.badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:.75rem;
  font-weight:700; letter-spacing:.02em; }
.badge-open, .badge-active, .badge-approved, .badge-paid { background:#e8f7ee; color:#137a3a; }
.badge-submitted, .badge-in_progress, .badge-assigned, .badge-in_review, .badge-processing,
.badge-shortlisted, .badge-sent { background:#fff2e0; color:#a55a06; }
.badge-open { background:#eef0ff; color:#3b3ba5; }
.badge-pending, .badge-draft, .badge-applied { background:#f0eef7; color:#5b5872; }
.badge-rejected, .badge-cancelled, .badge-revision { background:#fdeaea; color:#b42318; }
.badge-tier { background:#f3e9ff; color:#6d28d9; }

/* ---- tables ---- */
table { width:100%; border-collapse: collapse; font-size:.92rem; }
th, td { text-align:left; padding:12px 10px; border-bottom:1px solid var(--line); }
th { font-size:.76rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
tr:last-child td { border-bottom:none; }
.table-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow); }
.table-card table th, .table-card table td { padding:14px 18px; }

/* ---- portal layout ---- */
.portal { display:grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 62px); }
.side { border-right:1px solid var(--line); background:var(--bg-soft); padding:22px 14px; }
.side .who { padding:0 8px 16px; }
.side .who .role { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em;
  color:var(--brand); font-weight:700; }
.side nav a { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:var(--ink-2); font-weight:500; font-size:.95rem; }
.side nav a:hover { background:#efecf8; text-decoration:none; }
.side nav a.active { background:#fff; color:var(--brand); box-shadow:var(--shadow); }
.main { padding: 28px 32px; max-width: 980px; }
.page-head { display:flex; align-items:center; gap:14px; margin-bottom:22px; flex-wrap:wrap; }
.page-head h1 { font-size:1.7rem; margin:0; }
.page-head .spacer { flex:1; }

/* ---- forms ---- */
label { display:block; font-weight:600; font-size:.86rem; margin:14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=url], select, textarea {
  width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px;
  font: inherit; background:#fff; color:var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.checkbox-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px 14px; margin-top:6px; }
.checkbox-grid label { display:flex; align-items:center; gap:8px; font-weight:500; margin:4px 0; }
.checkbox-grid input { width:auto; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-wrap .card { padding: 28px; }

/* ---- flash ---- */
.flashes { max-width: var(--maxw); margin: 14px auto 0; padding: 0 20px; }
.flash { padding:12px 16px; border-radius:10px; margin-bottom:8px; font-size:.92rem; }
.flash.success { background:#e8f7ee; color:#137a3a; }
.flash.error { background:#fdeaea; color:#b42318; }
.flash.info { background:#eef0ff; color:#3b3ba5; }

/* ---- misc ---- */
.split-bar { height:8px; border-radius:999px; background:var(--line); overflow:hidden; display:flex; }
.split-bar .net { background:var(--accent); }
.split-bar .fee { background:var(--brand-2); }
.progress { height:8px; border-radius:999px; background:var(--line); overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--brand); }
.timeline { list-style:none; padding:0; margin:0; }
.timeline li { position:relative; padding:0 0 22px 30px; border-left:2px solid var(--line); margin-left:8px; }
.timeline li .dot { position:absolute; left:-9px; top:2px; width:16px; height:16px; border-radius:50%;
  background:#fff; border:3px solid var(--line); }
.timeline li.done .dot { border-color:var(--ok); background:var(--ok); }
.timeline li.in_progress .dot { border-color:var(--warn); }
.meta { display:flex; gap:16px; flex-wrap:wrap; color:var(--muted); font-size:.88rem; }
.tag { font-size:.78rem; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:8px; padding:3px 9px; color:var(--ink-2); }
footer.site { border-top:1px solid var(--line); padding:38px 0; color:var(--muted); margin-top:20px; }
footer.site .row { display:flex; gap:20px; flex-wrap:wrap; align-items:center; }

@media (max-width: 860px) {
  .grid-2,.grid-3,.grid-4,.kpis { grid-template-columns: 1fr 1fr; }
  .portal { grid-template-columns: 1fr; }
  .side { border-right:none; border-bottom:1px solid var(--line); }
  .side nav { display:flex; flex-wrap:wrap; gap:6px; }
  .form-row { grid-template-columns:1fr; }
  .nav .links { display:none; }
  h1 { font-size: 1.9rem; }
}
@media (max-width: 560px) {
  .grid-2,.grid-3,.grid-4,.kpis,.checkbox-grid { grid-template-columns: 1fr; }
}
