/* LI Comment Admin — nixtio-style light cream theme (lime accent) */
:root {
  --bg: #F3F1EA;
  --surface: #ffffff;
  --surface-2: #F7F5EE;
  --line: #E4E0D4;
  --fg: #14140F;
  --muted: #6B6B60;
  --faint: #9A998C;
  --primary: #B8E62E;        /* lime accent */
  --primary-600: #A6D11F;    /* hover */
  --primary-soft: #EFF7D6;   /* pale lime tint */
  --on-primary: #14140F;     /* dark ink on lime fills (white fails contrast) */
  --primary-ink: #4A5B07;    /* readable text on pale lime tint */
  --warn: #C77A0A;
  --bad: #dc2626;
  --info: #2563eb;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --gap: 20px;
  --shadow: 0 1px 2px rgba(20,20,15,.04), 0 8px 28px rgba(20,20,15,.06);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.022em; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  font-weight: 700; font-size: 16px;
}
.brand .logo {
  width: 32px; height: 32px; border-radius: 11px;
  background: var(--primary);
  display: grid; place-items: center; color: var(--on-primary); font-weight: 800;
}
.nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav .group { color: var(--faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; margin-bottom: 2px;
  transition: background .18s ease, color .18s ease, box-shadow .22s ease, transform .12s ease;
}
.nav a:active { transform: scale(.98); }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary); }
.nav a .ico { width: 18px; text-align: center; opacity: .85; }

.userbox {
  border-top: 1px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 700;
}
.userbox .meta { flex: 1; min-width: 0; }
.userbox .meta .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .meta .rl { color: var(--faint); font-size: 11px; }
.userbox form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px; }
.linkbtn:hover { color: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 22px; margin: 0; font-weight: 800; }
.topbar .search {
  margin-left: auto; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; color: var(--faint); min-width: 220px;
}
.content { padding: 34px 36px; max-width: 1200px; width: 100%; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: var(--gap); }
.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,20,15,.05), 0 14px 36px rgba(20,20,15,.10); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 36px; font-weight: 800; margin-top: 8px; line-height: 1; letter-spacing: -.03em; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 6px; }
.stat.accent { background: var(--primary); color: var(--on-primary); border: 0; }
.stat.accent .label, .stat.accent .sub { color: rgba(20,20,15,.7); }
.stat.warn .value { color: var(--warn); }

.section-title { font-size: 13px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin: 26px 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: var(--gap);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,20,15,.05), 0 16px 40px rgba(20,20,15,.10); }
.cards-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 880px) { .cards-2 { grid-template-columns: 1fr; } .sidebar { display: none; } }

.meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.badge.green { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.badge.warn { background: #fef3c7; color: #92400e; border-color: transparent; }
.badge.red { background: #fee2e2; color: #991b1b; border-color: transparent; }
.badge.blue { background: #dbeafe; color: #1e40af; border-color: transparent; }

.post {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--muted); white-space: pre-wrap; max-height: 150px; overflow: auto; margin-bottom: 12px;
}
.comment-text { font-size: 14px; line-height: 1.6; }

textarea, input[type=text], input[type=password], input[type=datetime-local], input[type=email], select {
  width: 100%; background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; font: inherit; outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

button { border: 0; border-radius: var(--radius-pill); padding: 10px 18px; font: inherit;
  font-weight: 650; cursor: pointer; color: #fff;
  transition: filter .15s ease, transform .1s ease, box-shadow .18s ease; }
button:hover { filter: brightness(.96); }
button:active { transform: scale(.97); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary, .approve { background: var(--primary); color: var(--on-primary); }
.btn-soft { background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); }
.reject, .btn-danger { background: var(--bad); }
.btn-warn { background: var(--warn); }

/* LinkedIn connect button (anchor — needs its own box model) */
.btn-linkedin {
  display: inline-block; background: #0a66c2; color: #fff !important; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer;
  line-height: 1.1; white-space: nowrap; font-size: 13px;
  transition: background .15s, box-shadow .15s;
}
.btn-linkedin:hover { background: #004182; box-shadow: 0 2px 8px rgba(10,102,194,.28); }
.btn-linkedin.is-muted { background: #7f93ab; }
.btn-linkedin.is-muted:hover { background: #6b7f97; box-shadow: none; }

/* connected-identity pill */
.li-linked { display: inline-block; background: var(--primary-soft); color: var(--primary-ink);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* link-session modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px;
  width: min(560px, 92vw); box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
.note-warn { background: #fef3c7; color: #92400e; border: 1px solid #f4d390;
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: var(--surface-2); }

.lvl-ERROR { color: var(--bad); font-weight: 600; }
.lvl-WARNING { color: var(--warn); font-weight: 600; }
.empty { color: var(--faint); font-style: italic; padding: 8px 0; }

.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: 0 0 8px; }
.feed-item .when { color: var(--faint); margin-left: auto; white-space: nowrap; font-size: 12px; }

/* centered auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.auth-card { width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth-card h2 { margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.auth-card .row { margin-top: 14px; }
.err { color: var(--bad); font-size: 13px; margin: 8px 0; }
.brand-center { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-weight: 700; font-size: 18px; }

/* ============ interactivity layer (motion, viz, feedback) ============ */
@keyframes fadeRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(.98); } }
@keyframes ringFill { from { stroke-dashoffset: var(--ring-circ); } }

/* page-load stagger: any direct children of .reveal fade+rise in sequence */
.reveal > * { animation: fadeRise .5s ease both; }
.reveal > *:nth-child(1){animation-delay:.02s}.reveal > *:nth-child(2){animation-delay:.07s}
.reveal > *:nth-child(3){animation-delay:.12s}.reveal > *:nth-child(4){animation-delay:.17s}
.reveal > *:nth-child(5){animation-delay:.22s}.reveal > *:nth-child(6){animation-delay:.27s}
.reveal > *:nth-child(n+7){animation-delay:.3s}

/* spinner + busy button */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite;
  vertical-align: -2px; }
button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
button.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border: 2px solid rgba(20,20,15,.55); border-right-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite; }

/* skeleton shimmer */
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg,
  var(--surface-2) 25%, #ece8dc 37%, var(--surface-2) 63%); background-size: 800px 100%;
  animation: shimmer 1.3s infinite linear; min-height: 14px; }

/* toast notifications */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 92vw); }
.toast { background: var(--fg); color: #fff; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 10px 30px rgba(20,20,15,.22);
  display: flex; gap: 10px; align-items: flex-start; animation: toastIn .25s ease both;
  border-left: 4px solid var(--primary); }
.toast.is-out { animation: toastOut .25s ease forwards; }
.toast.ok { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }
.toast .ic { font-weight: 800; flex: 0 0 auto; }
.toast.ok .ic { color: var(--primary); } .toast.error .ic { color: #ff8a8a; }

/* SVG progress ring (cap usage) */
.ring { display: inline-grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--line); fill: none; }
.ring .fill { stroke: var(--primary); fill: none; stroke-linecap: round;
  animation: ringFill .9s ease both; }
.ring .lbl { position: absolute; font-size: 11px; font-weight: 700; color: var(--fg); }

/* warmup bar */
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px;
  transition: width .9s ease; }

/* sparkline card */
.spark { width: 100%; height: 64px; display: block; }
.spark .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--primary-soft); opacity: .7; }
.spark .dot { fill: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .stat:hover { transform: none; }
}
