/* Rosenea — dark, dark pink, purple gradient */
:root {
  --bg: #0b0510;
  --bg-2: #120819;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --text: #fbeef5;
  --muted: rgba(251, 228, 240, .62);
  --faint: rgba(251, 228, 240, .38);
  --pink: #e0367a;
  --pink-2: #f472b6;
  --purple: #8b5cf6;
  --grad: linear-gradient(135deg, #e0367a 0%, #b5359e 50%, #7c3aed 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 18px;
  --display: 'Outfit','Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;   /* headings: clean, geometric */
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;     /* text: modern, easy to read */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(900px 600px at 20% 110%, rgba(224, 54, 122, .18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 500 15px/1.55 var(--sans);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pink-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(60, 14, 52, .55), rgba(20, 8, 26, .7));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 14px;
  backdrop-filter: blur(18px);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 18px; text-decoration: none !important; }
.brand img { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 10px 40px rgba(224, 54, 122, .35); }
.brand span { font: 600 11px/1 var(--sans); letter-spacing: .32em; color: var(--faint); text-transform: uppercase; }
.nav-group { margin-top: 14px; }
.nav-group > div { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 0 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--grad); color: #fff; box-shadow: 0 6px 24px rgba(181, 53, 158, .35); }
.nav a.on svg { opacity: 1; }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #fff; font-weight: 700;
}
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--faint); text-transform: capitalize; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

.main { min-width: 0; padding: 30px 36px 60px; }
.main.flush { padding: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font: 600 35px/1.1 var(--display); margin: 0; letter-spacing: -.015em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.topbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; background: #160a1c; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: rgba(11, 5, 16, .85); backdrop-filter: blur(12px); }
  .topbar img { width: 34px; height: 34px; border-radius: 50%; }
  .topbar b { font: 600 18px var(--display); letter-spacing: .08em; }
  .main { padding: 22px 16px 50px; }
  .page-head h1 { font-size: 30px; }
}

/* ---------- pieces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font: 600 20px/1.2 var(--display); margin: 0 0 12px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }
.grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 26px rgba(181, 53, 158, .35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .25); outline: none;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--pink-2); box-shadow: 0 0 0 3px rgba(244, 114, 182, .18); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.pill.ok { background: rgba(52, 211, 153, .14); color: var(--ok); }
.pill.warn { background: rgba(251, 191, 36, .14); color: var(--warn); }
.pill.bad { background: rgba(251, 113, 133, .14); color: var(--bad); }
.pill.pink { background: rgba(224, 54, 122, .18); color: var(--pink-2); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h3 { font: 600 22px var(--display); color: var(--text); margin: 0 0 6px; }

.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; }
.toast { background: #24112b; border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: up .2s; }
.toast.bad { border-color: rgba(251, 113, 133, .5); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

.modal-bg { position: fixed; inset: 0; background: rgba(5, 2, 8, .72); backdrop-filter: blur(6px); z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #170b1e; border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal.wide { width: min(1100px, 100%); }
.modal h2 { font: 600 23px var(--display); margin: 0 0 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* full-height embedded tools */
.tool-frame { display: block; width: 100%; height: 100vh; border: 0; background: var(--bg); color-scheme: dark; opacity: 0; transition: opacity .18s ease; }
.tool-frame.ready { opacity: 1; }
@media (max-width: 900px) { .tool-frame { height: calc(100vh - 59px); } }

/* view-only accounts */
.viewer-mode [data-w] { display: none !important; }
