/* ProfileShift — same Soft UI Evolution system as the DomainZillas Control Center.
   Light default + dark. Slate neutrals, emerald accent. */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --font-sans: 'Fira Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, monospace;

  --bg:        #eef1f6;
  --bg-grad-1: #e7ecf5;
  --bg-grad-2: #eef1f6;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --text:      #0f172a;
  --text-soft: #475569;
  --text-mut:  #64748b;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --accent:    #059669;
  --accent-ink:#047857;
  --ring:      rgba(5,150,105,.35);

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-md: 0 6px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 18px 40px rgba(15,23,42,.12), 0 6px 14px rgba(15,23,42,.07);

  --radius:    16px;
  --radius-sm: 11px;

  /* accent tints for card icons */
  --c-emerald: #059669; --c-emerald-bg: #d1fae5;
  --c-violet:  #7c3aed; --c-violet-bg:  #ede9fe;
  --c-sky:     #0284c7; --c-sky-bg:     #e0f2fe;
  --c-amber:   #d97706; --c-amber-bg:   #fef3c7;
  --c-rose:    #e11d48; --c-rose-bg:    #ffe4e6;
  --c-teal:    #0d9488; --c-teal-bg:    #ccfbf1;
  --c-indigo:  #4f46e5; --c-indigo-bg:  #e0e7ff;
  --c-slate:   #475569; --c-slate-bg:   #e2e8f0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #060a14;
  --bg-grad-1: #0b1220;
  --bg-grad-2: #060a14;
  --surface:   #0f172a;
  --surface-2: #131c30;
  --text:      #f1f5f9;
  --text-soft: #cbd5e1;
  --text-mut:  #94a3b8;
  --border:    #24314b;
  --border-2:  #334155;
  --accent:    #34d399;
  --accent-ink:#6ee7b7;
  --ring:      rgba(52,211,153,.35);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 46px rgba(0,0,0,.55);

  --c-emerald: #34d399; --c-emerald-bg: #05372a;
  --c-violet:  #a78bfa; --c-violet-bg:  #2a1e52;
  --c-sky:     #38bdf8; --c-sky-bg:     #0b2b46;
  --c-amber:   #fbbf24; --c-amber-bg:   #3a2a06;
  --c-rose:    #fb7185; --c-rose-bg:    #45111f;
  --c-teal:    #2dd4bf; --c-teal-bg:    #06342f;
  --c-indigo:  #818cf8; --c-indigo-bg:  #1e2350;
  --c-slate:   #94a3b8; --c-slate-bg:   #1e293b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 15% -8%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, var(--bg-grad-1), transparent 55%),
    var(--bg-grad-2);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--ring); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.02em; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--accent), #10b981);
  box-shadow: var(--shadow-sm); flex: 0 0 auto;
}
.brand .logo svg { width: 22px; height: 22px; }
.brand b { font-size: 1.02rem; }
.brand span { display: block; font-size: .72rem; font-weight: 500; color: var(--text-mut); margin-top: -2px; }
.spacer { flex: 1; }

.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
}
.iconbtn:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.iconbtn:active { transform: translateY(0); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:focus-visible, .card:focus-visible, .search input:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--ring); outline-offset: 2px;
}

.userchip {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 8px 7px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow-sm); font-size: .86rem; color: var(--text-soft);
}
.userchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.userchip .out { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--text-mut); }
.userchip .out:hover { color: var(--c-rose); background: var(--c-rose-bg); }
.userchip .out svg { width: 17px; height: 17px; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 64px; }
.hello { margin: 6px 0 22px; }
.hello h1 { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -.03em; }
.hello p { margin: 6px 0 0; color: var(--text-mut); font-size: .96rem; }

.toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 26px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-mut); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 42px; font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s;
}
.search input::placeholder { color: var(--text-mut); }
.search input:focus { border-color: var(--accent); }
.count { font-size: .82rem; color: var(--text-mut); font-family: var(--font-mono); }

/* ---------- groups ---------- */
.group { margin-bottom: 34px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; }
.group-head h2 { margin: 0; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mut); }
.group-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

/* ---------- card ---------- */
.card {
  position: relative; display: flex; align-items: flex-start; gap: 15px;
  padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
  text-align: left; width: 100%; font: inherit; color: inherit;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
:root[data-theme="dark"] .card::after { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.card:active { transform: translateY(-1px); }

.card .ic { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; }
.card .ic svg { width: 24px; height: 24px; }
.card .body { min-width: 0; flex: 1; }
.card .body h3 { margin: 1px 0 3px; font-size: 1rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; }
.card .body p { margin: 0; font-size: .85rem; color: var(--text-mut); line-height: 1.45; }
.card .go {
  position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-mut); opacity: 0;
  transform: translateX(-4px); transition: opacity .2s, transform .2s, color .2s, background .2s;
}
.card .go svg { width: 15px; height: 15px; }
.card:hover .go { opacity: 1; transform: translateX(0); color: var(--accent); background: var(--surface-2); }

.badge {
  font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; line-height: 1.5;
}
.badge.sso  { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.badge.link { color: var(--text-mut); background: var(--surface-2); border: 1px solid var(--border); }

/* icon accent variants */
.ac-emerald{color:var(--c-emerald);background:var(--c-emerald-bg)}
.ac-violet {color:var(--c-violet); background:var(--c-violet-bg)}
.ac-sky    {color:var(--c-sky);    background:var(--c-sky-bg)}
.ac-amber  {color:var(--c-amber);  background:var(--c-amber-bg)}
.ac-rose   {color:var(--c-rose);   background:var(--c-rose-bg)}
.ac-teal   {color:var(--c-teal);   background:var(--c-teal-bg)}
.ac-indigo {color:var(--c-indigo); background:var(--c-indigo-bg)}
.ac-slate  {color:var(--c-slate);  background:var(--c-slate-bg)}

.empty { text-align: center; color: var(--text-mut); padding: 60px 20px; font-size: .95rem; }

.foot { text-align: center; color: var(--text-mut); font-size: .78rem; margin-top: 26px; font-family: var(--font-mono); }

/* ---------- login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 34px 30px 30px; position: relative;
}
.login-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.login-logo { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), #10b981); box-shadow: var(--shadow-md); }
.login-logo svg { width: 28px; height: 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; letter-spacing: -.02em; }
.login-card .sub { margin: 0 0 24px; color: var(--text-mut); font-size: .9rem; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .82rem; font-weight: 500; color: var(--text-soft); margin-bottom: 7px; }
.field .inp { position: relative; }
.field .inp > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-mut); }
.field input {
  width: 100%; height: 48px; padding: 0 44px 0 40px; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; transition: border-color .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--accent); outline: 3px solid var(--ring); outline-offset: 1px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  display: grid; place-items: center; border: 0; background: transparent; color: var(--text-mut); cursor: pointer; border-radius: 8px; }
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg { width: 18px; height: 18px; }
.btn {
  width: 100%; height: 48px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: .96rem;
  color: #fff; background: linear-gradient(135deg, var(--accent), #10b981); box-shadow: var(--shadow-md);
  transition: transform .15s, box-shadow .15s, filter .15s; margin-top: 6px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }
.err { background: var(--c-rose-bg); color: var(--c-rose); border: 1px solid color-mix(in srgb, var(--c-rose) 30%, transparent);
  padding: 11px 14px; border-radius: 11px; font-size: .86rem; margin-bottom: 16px; }
.login-foot { text-align: center; color: var(--text-mut); font-size: .76rem; margin-top: 20px; font-family: var(--font-mono); }

/* ================= ProfileShift additions (same tokens, same look) ================= */

.wrap.narrow { max-width: 860px; }

/* panel = the same card surface, full width */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px clamp(16px, 3vw, 26px); margin-bottom: 26px;
}

/* ---- the download form ---- */
.psform .f-row { margin-bottom: 4px; }
.psform .f-row.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.psform .field small { display: block; margin-top: 6px; color: var(--text-mut); font-size: .78rem; line-height: 1.5; }
.psform .field input { padding-right: 14px; }
.psform .btn { max-width: 280px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; }
.psform .btn svg { width: 18px; height: 18px; }

/* ---- one row per download ---- */
.runs { display: flex; flex-direction: column; gap: 12px; }
.run {
  display: flex; align-items: center; gap: 15px; padding: 15px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.run:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }
.run .ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.run .ic svg { width: 22px; height: 22px; }
.run-body { flex: 1; min-width: 0; }
.run-body h3 { margin: 0 0 3px; font-size: 1rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-body p { margin: 0; font-size: .85rem; color: var(--text-mut); line-height: 1.5; }
.run-body p.dim { font-size: .74rem; opacity: .8; }
.mono { font-family: var(--font-mono); }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.run-actions.big { margin-top: 14px; }

.mini {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, color .15s, border-color .15s, background .15s;
}
.mini svg { width: 17px; height: 17px; }
.mini:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--text); border-color: var(--border-2); }
.mini.go { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mini.bad:hover { color: var(--c-rose); border-color: color-mix(in srgb, var(--c-rose) 40%, var(--border)); background: var(--c-rose-bg); }

.badge.live { color: var(--c-amber); background: var(--c-amber-bg); }
.badge.bad  { color: var(--c-rose);  background: var(--c-rose-bg); }

/* ---- progress ---- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -.02em; font-family: var(--font-mono); }
.stat span { font-size: .78rem; color: var(--text-mut); }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #10b981); transition: width .4s ease; }
.bar-label { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: .82rem; color: var(--text-mut); font-family: var(--font-mono); }

.logbox {
  height: 340px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; font-family: var(--font-mono); font-size: .8rem; line-height: 1.7;
}
.logbox .l { color: var(--text-soft); }
.logbox .l.ok { color: var(--accent-ink); font-weight: 600; }
.logbox .l.err { color: var(--c-rose); font-weight: 600; }

.note {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 20px; border: 1px solid transparent;
}
.note svg { width: 19px; height: 19px; flex: 0 0 auto; }
.note.ok { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---- delete confirm popup ---- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }   /* keep it closed until the Delete button is pressed */
.modal-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px 26px 22px; text-align: center; }
.modal-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; }
.modal-ic svg { width: 26px; height: 26px; }
.modal-card h2 { margin: 0 0 10px; font-size: 1.18rem; letter-spacing: -.02em; }
.modal-card p { margin: 0 0 8px; font-size: .9rem; color: var(--text-soft); line-height: 1.55; }
.modal-card p.dim { color: var(--text-mut); font-size: .82rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { margin-top: 0; }
.btn.ghost { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { color: var(--text); filter: none; }
.btn.danger { background: linear-gradient(135deg, var(--c-rose), #f43f5e); }

@media (max-width: 700px) {
  .run { flex-wrap: wrap; }
  .run-actions { width: 100%; }
  .mini { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  .userchip .label { display: none; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
