/* Wellpaged — creator dashboard shell (account.wellpaged.com).
   Mirrors the admin dashboard's layout language (sidebar · topbar · panels)
   with the creator-facing paper/ink brand. The auth screens keep the inline
   card styles in index.html; everything below is the signed-in dashboard. */

:root {
  --paper: #FAF7F2; --paper-sink: #F1ECE3; --ink: #0B0B12;
  --blue: #2A55D6; --blue-deep: #1D3DA0; --mint: #C6FF3D; --coral: #E5484D;
  --muted: #5b5b66; --dim: #8a8a94; --line: rgba(11, 11, 18, .14);
  --r-md: 12px; --r-lg: 16px; --shadow-hard: 3px 4px 0 rgba(11, 11, 18, .9);
}

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; background: var(--paper); }

/* ---- sidebar ---- */
.sidebar { border-right: 1.5px solid var(--ink); background: #fff; padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px 18px; }
.sidebar .wm { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.sidebar .tag { font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-deep); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group .label { font-family: ui-monospace, monospace; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.nav-item:hover { background: var(--paper-sink); color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-item .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px dashed var(--line); }
.side-foot .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.side-foot .who { font-size: 12px; font-weight: 600; line-height: 1.25; overflow: hidden; }
.side-foot .who small { display: block; font-weight: 400; color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- main / topbar ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px; border-bottom: 1.5px solid var(--ink); background: #fff; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 19px; letter-spacing: -.02em; margin: 0; flex: 1; }
.site-pick { border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; background: #fff; cursor: pointer; }
.topbtn { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; text-decoration: none; }
.topbtn:hover { background: #fff; color: var(--ink); }
.topbtn.ghost { background: #fff; color: var(--ink); }
.topbtn.ghost:hover { background: var(--paper-sink); }
.content { padding: 24px 26px 48px; max-width: 1060px; }

/* ---- stat tiles ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-hard); padding: 14px 16px; }
.stat .k { font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.stat .v { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12px; color: var(--muted); }

/* ---- panels ---- */
.panel { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-hard); margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px dashed var(--line); }
.panel-head h2 { font-size: 14px; margin: 0; letter-spacing: -.01em; }
.panel-head .muted-n { font-family: ui-monospace, monospace; font-size: 10px; color: var(--dim); }
.panel-body { padding: 16px 18px; }
.empty { padding: 22px 18px; color: var(--muted); font-size: 13.5px; }
.dim { color: var(--muted); font-size: 12.5px; }
.chip { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.chip.live { background: #DDF7C9; } .chip.draft { background: #FFF3CD; } .chip.plan { background: #EEF2FF; }

/* ---- charts & lists ---- */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 84px; padding: 4px 0; }
.bars i { flex: 1; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 3px; opacity: .85; }
.bars i:hover { opacity: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
.kv-list { margin: 0; padding: 0; list-style: none; }
.kv-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-list li b { font-variant-numeric: tabular-nums; }
.kv-head { font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }

/* ---- links manager ---- */
.link-row { display: flex; gap: 6px; margin-bottom: 7px; align-items: center; }
.link-row input { border: 1.5px solid var(--ink); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; background: #fff; }
.link-row input:focus { outline: none; box-shadow: 0 0 0 2px var(--blue); border-color: var(--blue); }
.link-row input.lab { flex: 1; }
.link-row input.url { flex: 1.4; font-family: ui-monospace, monospace; font-size: 12px; }
.link-row .feat { background: #fff; border: 1.5px solid var(--ink); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; flex-shrink: 0; }
.link-row .feat.on { background: #FFE27A; }
.link-row .del { background: none; border: 0; color: var(--coral); font-size: 15px; cursor: pointer; flex-shrink: 0; padding: 4px; }

/* ---- buttons / misc ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #fff; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-sink); }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.okmsg2 { background: #eaf6ec; border: 1.5px solid #2e7d44; color: #1c5530; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-top: 12px; }
.errmsg2 { background: #fdecec; border: 1.5px solid var(--coral); color: #7a1d20; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-top: 12px; }
.set-rows { display: flex; flex-direction: column; }
.set-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.set-row .k { color: var(--muted); }
.set-row .v { font-weight: 600; }
.banner2 { background: #fff7e6; border: 1.5px solid #d9a300; color: #6b5200; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }

/* The auth screens keep inline styles in index.html (.btn{width:100%},
   input{width:100%;margin-bottom:14px}, …). Inside the dashboard shell those
   would leak — scope them back with higher specificity. */
.shell .btn { width: auto; }
.shell .link-row input { width: auto; margin-bottom: 0; }
.shell .site-pick { width: auto; margin-bottom: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; gap: 8px; }
  .sidebar .brand { padding: 0 10px 0 0; }
  .nav-group { flex-direction: row; }
  .nav-group .label, .side-foot { display: none; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 40px; }
}
