/* ============================================================
   CLIPSA DESIGN SYSTEM — "Ember"
   Fonts: Unbounded (display, numbers) + Manrope (UI, text). Icons: Flaticon UIcons bold-rounded
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Michroma&family=Unbounded:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
@import url("https://cdn-uicons.flaticon.com/2.6.0/uicons-bold-rounded/css/uicons-bold-rounded.css");

:root {
  /* surfaces */
  --bg: #0a0a0b;
  --bg-2: #101012;
  --card: #161618;
  --card-2: #1c1c1f;
  --raise: #232327;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);

  /* text */
  --tx: #f5f5f6;
  --tx-2: #a4a4ad;
  --tx-3: #6b6b74;

  /* ember accent */
  --ember: #c8f53a;
  --ember-hi: #d6ff5c;
  --ember-lo: #8fd01b;
  --ember-glow: rgba(200, 245, 58, .4);
  --ember-soft: rgba(200, 245, 58, .12);
  --grad-ember: linear-gradient(180deg, #e4ff6b 0%, #c8f53a 45%, #6fae12 100%);

  /* status */
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --warn: #ffc53d;
  --warn-soft: rgba(255, 197, 61, .12);
  --bad: #ff4d5e;
  --bad-soft: rgba(255, 77, 94, .12);
  --info: #7aa7ff;
  --info-soft: rgba(122, 167, 255, .12);

  /* platforms */
  --tiktok: #25f4ee;
  --instagram: #ff3d8b;
  --youtube: #ff3b30;

  /* type */
  --f-display: "Unbounded", system-ui, sans-serif;
  --f-ui: "Manrope", system-ui, sans-serif;

  /* shape */
  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 6px;
  --r-pill: 999px;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 500 14px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ember); color: #0a0a0a; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 10px; border: 3px solid var(--bg); }

/* ---------- type scale ---------- */
.wordmark { display: inline-flex; align-items: flex-end; font: 400 19px/1 Michroma, sans-serif; letter-spacing: .08em; color: var(--tx); }
.wordmark svg { width: .95em; height: .95em; margin-left: .1em; }
.d1 { font: 600 44px/1 var(--f-display); letter-spacing: -.03em; }
.d2 { font: 600 30px/1.05 var(--f-display); letter-spacing: -.02em; }
.d3 { font: 600 19px/1.15 var(--f-display); letter-spacing: -.01em; }
.h  { font: 700 15px/1.3 var(--f-ui); }
.cap { font: 600 11px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.mut { color: var(--tx-2); }
.dim { color: var(--tx-3); }
.num { font-family: var(--f-display); font-feature-settings: "tnum"; }

/* ---------- card ---------- */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 22px; box-shadow: var(--shadow); overflow: hidden;
}
.card.glow::before { /* ember aurora like the reference */
  content: ""; position: absolute; inset: -40% 30% 40% -30%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(200, 245, 58, .32), rgba(120, 200, 20, .1) 55%, transparent 75%);
  filter: blur(30px); opacity: .9;
}
.card > * { position: relative; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- buttons: flat, square-ish; colour only on the primary action ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--tx-2);
  transition: color .15s, border-color .15s, background .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { color: var(--tx); border-color: rgba(255, 255, 255, .22); }
.btn.pri { background: var(--ember); border-color: var(--ember); color: #0a0a0a; }
.btn.pri:hover { background: var(--ember-hi); border-color: var(--ember-hi); }
.btn.ok:hover { color: var(--ok); border-color: var(--ok); }
.btn.bad:hover { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.fi { display: inline-flex; line-height: 1; font-size: 15px; }
.btn .fi { font-size: 13px; }

/* tabs: underline, not pills */
.seg { display: inline-flex; gap: 22px; border-bottom: 1px solid var(--line); }
.seg button { height: 34px; padding: 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--tx-3); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button:hover { color: var(--tx-2); }
.seg button.on { color: var(--tx); border-bottom-color: var(--ember); }

/* status: small rectangle with a soft gradient of the status colour */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--tx-2); white-space: nowrap; text-decoration: none;
  background: linear-gradient(100deg, color-mix(in srgb, currentColor 26%, transparent), color-mix(in srgb, currentColor 6%, transparent));
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.tag.plain { height: auto; padding: 0; background: none; border: 0; }
.tag .fi { font-size: 10px; }

/* dropdown (replaces native select) */
select.inp { display: none; }
.dd { position: relative; display: inline-block; min-width: 140px; }
.field .dd { display: block; }
.dd-b { width: 100%; height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--tx); font-weight: 600; cursor: pointer; }
.dd-b:hover, .dd.open .dd-b { border-color: rgba(255, 255, 255, .24); }
.dd-b .fi { color: var(--tx-3); transition: transform .2s; }
.dd.open .dd-b .fi { transform: rotate(180deg); }
.dd.off { pointer-events: none; opacity: .5; }
.dd-m { display: none; position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); min-width: 180px; max-height: 280px; overflow: auto; padding: 6px; border-radius: var(--r-md); background: #1b1b1e; border: 1px solid var(--line-2); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8); }
.dd.open .dd-m { display: block; animation: fade .12s; }
.dd-o { padding: 9px 10px; border-radius: 6px; cursor: pointer; color: var(--tx-2); font-weight: 600; white-space: nowrap; }
.dd-o:hover { background: var(--raise); color: var(--tx); }
.dd-o.on { color: var(--ember-hi); }

/* date/time inputs: dark picker, own calendar glyph */
input[type="date"].inp, input[type="datetime-local"].inp { color-scheme: dark; }
input[type="date"].inp::-webkit-calendar-picker-indicator, input[type="datetime-local"].inp::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .55; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4c4cc' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E") center / 16px no-repeat; }
input[type="date"].inp::-webkit-calendar-picker-indicator:hover, input[type="datetime-local"].inp::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.tag.ok { color: var(--ok); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--bad); }
.tag.info { color: var(--info); }
.tag.ember { color: var(--ember-hi); }
.tag.plain::before { display: none; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-hi); }

.delta { font: 700 12px var(--f-ui); color: var(--warn); }
.delta.up::before { content: "↑ "; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--tx-2); margin: 0; }
.inp, select.inp, textarea.inp {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--bg-2); outline: none; transition: border .2s, box-shadow .2s;
}
textarea.inp { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font: 700 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--tx-3); padding: 0 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .02); }
.tbl .r { text-align: right; }

/* ---------- glow bars (signature chart) ---------- */
.bars { display: flex; align-items: flex-end; gap: var(--gap, 12px); height: 220px; padding-top: 30px; }
.bar { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: pointer; }
.bar .b {
  width: 100%; max-width: 64px; border-radius: var(--rad, 10px) var(--rad, 10px) 3px 3px; min-height: 4px;
  background: linear-gradient(180deg, #3a3a3f 0%, #232326 60%, rgba(30, 30, 33, .2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: height .6s var(--ease), background .3s, filter .3s;
}
.bar:hover .b { filter: brightness(1.25); }
.bar.on .b { background: var(--grad-ember); box-shadow: 0 0 40px -4px var(--ember-glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.bar .l { height: 14px; margin-top: 12px; font: 600 12px/14px var(--f-ui); color: var(--tx-3); white-space: nowrap; }
.bar.on .l { color: var(--ember-hi); }
.bar .pin { position: absolute; width: 1px; background: rgba(255, 255, 255, .6); bottom: 26px; display: none; }
.bar.on .pin { display: block; }
.tip {
  position: absolute; z-index: 3; min-width: 170px; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(40, 40, 44, .72); backdrop-filter: blur(14px); border: 1px solid var(--line-2);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7); pointer-events: none; transition: left .3s var(--ease), top .3s var(--ease);
}
.tip .t { font: 600 13px var(--f-display); margin-bottom: 8px; color: var(--tx-2); }
.tip .row { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--tx-2); }
.tip .row b { color: var(--tx); }

/* ---------- progress ---------- */
.prog { height: 6px; border-radius: 6px; background: var(--raise); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 6px; background: var(--ember); }

/* ---------- avatar ---------- */
.ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--f-display); background: linear-gradient(135deg, #2c2c31, #1b1b1e); border: 1px solid var(--line-2); flex: none; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--tx-3); font-size: 12px; }

/* ---------- toast / modal ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 99; padding: 12px 18px; border-radius: var(--r-sm); background: var(--raise); border: 1px solid var(--line-2); font-weight: 700; transition: all .3s var(--ease); box-shadow: var(--shadow); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { color: var(--bad); }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* number fields: no native spinner arrows (quick-pick buttons sit under the field instead) */
input[type="number"].inp { -moz-appearance: textfield; appearance: textfield; }
input[type="number"].inp::-webkit-inner-spin-button, input[type="number"].inp::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
