:root {
  --page: #f4f5f8;
  --card: #ffffff;
  --ink: #14161d;
  --ink-2: #3d414d;
  --muted: #7d8290;
  --line: #e7e8ee;
  --line-soft: #f0f1f5;
  --side: #0b0c0f;
  --side-2: #14151a;
  --magenta: #e2196b;
  --magenta-2: #b00d52;
  --violet: #7b5ce0;
  --gold: #f2c94c;
  --green: #22b573;
  --red: #e5484d;
  --blue: #4b7bec;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ================================================================== */
/* Login — lavender night + glass card                                 */
/* ================================================================== */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #060914;
}

.scene { position: absolute; inset: 0; }

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #050817 0%, #0a1230 26%, #1b2452 44%, #3d3270 58%, #7c5898 70%, #b982bb 80%, #4a2a62 100%);
}

.stars {
  position: absolute;
  inset: 0 0 34% 0;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 12%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 18% 26%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 27% 9%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.1px 1.1px at 38% 22%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 47% 8%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 58% 18%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1.5px 1.5px at 67% 6%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.1px 1.1px at 76% 21%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 84% 11%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 92% 27%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.3px 1.3px at 33% 33%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 71% 32%, rgba(255,255,255,.5), transparent 60%);
  opacity: .9;
}

.hills {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 30%;
  height: 26%;
  background:
    radial-gradient(ellipse 38% 100% at 16% 100%, #241c47 0 62%, transparent 63%),
    radial-gradient(ellipse 46% 100% at 58% 100%, #1d173c 0 65%, transparent 66%),
    radial-gradient(ellipse 40% 100% at 89% 100%, #2a214f 0 60%, transparent 61%);
  filter: blur(1px);
}

.lavender {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -7%;
  height: 55%;
  background:
    repeating-linear-gradient(100deg,
      rgba(46, 22, 72, .95) 0 4px,
      rgba(112, 64, 150, .82) 4px 9px,
      rgba(34, 16, 56, .96) 9px 14px);
  mask-image: linear-gradient(to top, #000 58%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 58%, transparent 100%);
  filter: blur(1.4px);
}

.lavender::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(180px 220px at 12% 70%, rgba(198, 145, 234, .45), transparent 70%),
    radial-gradient(200px 240px at 32% 52%, rgba(170, 110, 214, .35), transparent 70%),
    radial-gradient(240px 280px at 58% 74%, rgba(205, 150, 235, .38), transparent 70%),
    radial-gradient(220px 260px at 82% 58%, rgba(165, 100, 210, .35), transparent 70%);
  filter: blur(10px);
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(520px, 94vw);
  margin: auto 0;
  padding: 26px 38px 22px;
  border-radius: 26px;
  background: rgba(19, 20, 34, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  color: #fff;
}

.login-logo { display: flex; justify-content: center; margin-bottom: 6px; }

.login-card h1 {
  font-size: 37px;
  font-weight: 400;
  letter-spacing: -0.6px;
  text-align: center;
  margin: 2px 0 4px;
}

.login-sub {
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 18px;
}

.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.login-field > span { font-size: 12px; color: rgba(255, 255, 255, 0.62); }
.login-field input {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.login-field input::placeholder { color: rgba(255, 255, 255, 0.38); }
.login-field input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.password-wrap { position: relative; display: flex; }
.password-wrap input { width: 100%; padding-right: 48px; }
.eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  cursor: pointer;
}
.eye:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 12.5px;
}
.remember { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.78); cursor: pointer; }
.remember input { width: 15px; height: 15px; accent-color: var(--violet); }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  cursor: pointer;
}
.link:hover { color: #fff; text-decoration: underline; }

.login-btn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1a142f;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2px;
  transition: filter .16s, transform .12s;
}
.login-btn:hover { filter: brightness(.96); }
.login-btn:active { transform: translateY(1px); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0 12px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.google-btn {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .16s;
}
.google-btn:hover { background: rgba(255, 255, 255, 0.07); }

.google-g {
  font-weight: 800;
  font-size: 16px;
  background: conic-gradient(from -45deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.signup {
  margin: 13px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.58);
}
.signup .link { font-size: 12.5px; }

.form-error {
  font-size: 12px;
  color: #ffd7dd;
  background: rgba(229, 72, 77, 0.22);
  border: 1px solid rgba(229, 72, 77, 0.45);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
}

/* ================================================================== */
/* App shell                                                           */
/* ================================================================== */
.app {
  display: grid;
  grid-template-columns: 246px 1fr;
  min-height: 100vh;
  background: var(--page);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, #0a0b0e, #101116);
  border-right: 1px solid #1c1d23;
  color: #fff;
  overflow-y: auto;
}

.side-top { display: flex; flex-direction: column; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 18px;
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 0.2px;
  color: #fff;
}
.brand b { font-weight: 800; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 25px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e53935, var(--magenta));
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(226, 25, 107, 0.35);
}

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #23242b;
  background: #15161b;
  color: #fff;
  cursor: pointer;
  text-align: left;
  margin-bottom: 14px;
}
.workspace:hover { background: #1a1b21; }
.workspace-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(226, 25, 107, 0.16);
  color: #ff7fb0;
  font-size: 14px;
  flex-shrink: 0;
}
.workspace-text { display: flex; flex-direction: column; min-width: 0; }
.workspace-text strong { font-size: 12.5px; font-weight: 600; }
.workspace-text small { font-size: 10.5px; color: #7f828d; }
.workspace-chevron { margin-left: auto; color: #6f727d; font-size: 12px; }

.side-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid #23242b;
  background: #121318;
  color: #6f727d;
}
.side-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #e6e7eb;
  font-size: 12px;
  outline: none;
}
.side-search input::placeholder { color: #5f626c; }
.side-search kbd {
  font-family: inherit;
  font-size: 9.5px;
  color: #8b8e99;
  background: #1d1e24;
  border: 1px solid #2a2b33;
  border-radius: 4px;
  padding: 1px 5px;
}

.side-label {
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: #5f626c;
  padding: 0 10px 8px;
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c4c6ce;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.nav-btn:hover { background: #17181d; color: #fff; }
.nav-btn.active {
  background: #1d1e24;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--magenta);
}
.nav-ico { width: 16px; text-align: center; opacity: .8; font-size: 12px; }
.nav-text { flex: 1; }
.nav-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #a9acb6;
  background: #24252c;
  border-radius: 999px;
  padding: 1px 7px;
}
.nav-badge.new { color: #ff9dc1; background: rgba(226, 25, 107, 0.18); }

.side-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #1c1d23;
}

.account {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px 0;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7b5ce0, #e2196b);
  flex-shrink: 0;
}
.account-info { display: flex; flex-direction: column; min-width: 0; }
.account-info strong { font-size: 11.5px; font-weight: 600; }
.account-info small { font-size: 10px; color: #7f828d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-logout {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8b8e99;
  cursor: pointer;
  font-size: 13px;
}
.account-logout:hover { background: #1d1e24; color: #fff; }

/* ================================================================== */
/* Main                                                                */
/* ================================================================== */
.main {
  min-width: 0;
  padding: 24px 28px 44px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.page-title h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.page-title p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(16, 18, 27, .04), 0 10px 26px rgba(16, 18, 27, .05);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.card-head p { margin: 3px 0 0; font-size: 11.5px; }

.pill {
  font-size: 9.5px;
  letter-spacing: .7px;
  text-transform: uppercase;
  font-weight: 700;
  color: #6f7480;
  background: #f2f3f6;
  border: 1px solid #e7e8ee;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.pill.light { background: rgba(255, 255, 255, .75); border-color: #eadcf7; color: #7c5a95; }

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; min-height: 124px; }
.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ink);
  line-height: 1.15;
}
.kpi-value.small { font-size: 18px; font-weight: 700; }
.kpi-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 11px;
}
.kpi-note { color: var(--muted); }

.delta {
  font-size: 10.5px;
  font-weight: 700;
  color: #6f7480;
  background: #f2f3f6;
  border-radius: 999px;
  padding: 2px 7px;
}
.delta.up { color: #0d7a4a; background: #e6f7ee; }
.delta.down { color: #a3282c; background: #fdecec; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-left: auto; }
.spark span { width: 6px; border-radius: 2px; background: #f6ccdc; }
.spark span:last-child { background: var(--magenta); }
.spark span.hot { background: linear-gradient(180deg, #f062a0, var(--magenta)); }

/* Grids */
.dash-grid { display: grid; gap: 14px; margin-top: 14px; }
.main-grid { grid-template-columns: 1.7fr 1fr; }
.bottom-grid { grid-template-columns: 1.55fr 1fr; }
.plans-grid { grid-template-columns: 1fr 1fr; margin-top: 0; }

/* Chart */
.chart-card { display: flex; flex-direction: column; }
.chart {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  height: 230px;
  padding: 14px 6px 0;
  background: repeating-linear-gradient(
    to top,
    transparent 0 43px,
    var(--line-soft) 43px 44px
  );
}
.chart-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.bar-value { font-size: 10px; color: var(--muted); height: 12px; }
.bar {
  width: 100%;
  max-width: 38px;
  min-height: 5px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #f57fb2, var(--magenta));
  box-shadow: 0 6px 16px rgba(226, 25, 107, .16);
  transition: height .4s ease;
}
.bar-label { font-size: 10px; color: var(--muted); text-transform: capitalize; }

/* Highlight card */
.highlight-card {
  background: linear-gradient(150deg, #f7f0ff 0%, #fdf3f9 60%, #fff6f1 100%);
  border-color: #ece2f7;
  display: flex;
  flex-direction: column;
}
.highlight-value {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -1.6px;
  line-height: 1;
  color: #34134d;
  margin-top: 4px;
}
.highlight-sub { margin: 4px 0 18px; font-size: 12px; color: #8a769b; }
.highlight-rows { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.highlight-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #efe4f8;
  font-size: 12.5px;
  color: #6b587c;
}
.highlight-rows strong { color: #34134d; font-size: 13px; }
.highlight-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11.5px;
  color: #8a769b;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  display: inline-block;
  flex-shrink: 0;
}
.dot.ok { background: var(--green); }
.dot.warn { background: var(--gold); }
.dot.danger { background: var(--red); }
.dot.magenta { background: var(--magenta); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background: conic-gradient(var(--green) 0 34%, var(--gold) 34% 67%, var(--red) 67% 100%);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: var(--card);
}
.donut-legend { display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--ink-2); flex: 1; }
.donut-legend > div { display: flex; align-items: center; gap: 8px; }
.donut-legend strong { margin-left: auto; color: var(--ink); font-size: 12.5px; }

.expiring-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.expiring-box h3 { margin: 0 0 10px; font-size: 12.5px; color: var(--ink); }

/* Lists */
.list { display: flex; flex-direction: column; gap: 7px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid var(--line-soft);
}
.list-main { min-width: 0; }
.list-title { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 10.5px; color: var(--muted); }
.list-amount { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--magenta); white-space: nowrap; }

/* Lost code colours for overview rows */
.list-row .mono { font-size: 11px; }

/* Tables */
.table-panel { padding: 18px 0 0; }
.table-panel .card-head { padding: 0 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
thead th {
  text-align: left;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  color: #8b8f9c;
  padding: 9px 14px;
  background: #fafbfc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
table.compact { min-width: 0; }
table.compact thead th { padding: 8px 10px; }
table.compact tbody td { padding: 9px 10px; font-size: 11.5px; }

.mono { font-family: "Consolas", "SFMono-Regular", monospace; font-size: 11px; letter-spacing: .2px; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.empty-row td { text-align: center; color: var(--muted); padding: 26px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.active { color: #0d7a4a; background: #e6f7ee; }
.badge.trial { color: #8a6100; background: #fff6dd; }
.badge.expired { color: #a3282c; background: #fdecec; }
.badge.unused { color: #5b3fc4; background: #eeeafd; }
.badge.revoked { color: #555a66; background: #eef0f3; }

/* Toolbar / inputs / buttons */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 14px;
}
.input {
  width: auto;
  min-width: 150px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #e2e4ea;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
}
.input:focus { border-color: #d29bec; box-shadow: 0 0 0 3px rgba(226, 25, 107, .08); }
.toolbar #lic-search { flex: 1; min-width: 220px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid #e3e5ea;
  background: #f3f4f7;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, filter .16s, transform .12s;
  white-space: nowrap;
}
.btn:hover { background: #eaecf1; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--magenta), #b14bd8);
  color: #fff;
  box-shadow: 0 6px 18px rgba(226, 25, 107, .22);
}
.btn.dark { border-color: #14151a; background: #14151a; color: #fff; }
.btn.dark:hover { background: #23242b; }
.btn.ghost { background: #fff; border-color: #e3e5ea; }
.btn.ghost:hover { background: #f7f8fa; }
.btn.small { padding: 6px 10px; font-size: 11px; }
.btn.danger { background: #fdecec; border-color: #f6d5d5; color: #a3282c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; }
.field .input { width: 100%; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .switch { align-self: end; margin-bottom: 13px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.switch input { width: 15px; height: 15px; accent-color: var(--magenta); }
.inline-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; min-width: 190px; }

.form-card { margin-bottom: 14px; }
.note-panel h3 { margin: 0 0 8px; font-size: 13.5px; }
.note-panel p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.note-panel .note-warning { margin-top: 12px; color: #a1601a; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.form-actions .muted { font-size: 12px; }
.playlist-stats { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.playlist-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.playlist-stats strong { color: var(--ink); font-size: 13px; font-weight: 600; }

/* ================================================================== */
/* Modal + toast                                                       */
/* ================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 20, .55);
  backdrop-filter: blur(4px);
}
.modal {
  width: min(520px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #eceef2;
  box-shadow: 0 30px 90px rgba(8, 10, 18, .35);
}
.modal h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.modal .btn.primary { background: linear-gradient(120deg, var(--magenta), #b14bd8); }
.modal .btn.ghost { background: #f5f6f8; border-color: #e5e7ec; color: var(--ink); }

.code-result {
  margin-top: 12px;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  background: #faf7ff;
  border: 1px solid #ecd9ff;
}
.code-result .code { font-size: 21px; font-weight: 800; letter-spacing: 1px; color: var(--magenta); }
.code-result .hint { margin-top: 4px; font-size: 11px; color: var(--muted); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: 380px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #e7e8ee;
  box-shadow: 0 18px 50px rgba(8, 10, 18, .18);
  font-size: 12.5px;
}
.toast.success { border-color: #bdebcf; }
.toast.error { border-color: #f6c9cc; }

/* ================================================================== */
/* Responsive                                                          */
/* ================================================================== */
@media (max-width: 1100px) {
  .kpi-grid, .kpi-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-grid, .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px;
    gap: 10px;
  }
  .side-top { flex: 1; min-width: 0; }
  .brand { padding-bottom: 8px; }
  .workspace, .side-search, .side-label { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-text { display: none; }
  .nav-ico { font-size: 14px; }
  .nav-badge { display: none; }
  .side-bottom { flex-direction: row; align-items: center; padding-top: 0; border-top: 0; }
  .account-info { display: none; }
  .main { padding: 18px 16px 36px; }
  .topbar { flex-direction: column; }
  .kpi-grid, .kpi-grid.three { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .login-card h1 { font-size: 32px; }
}

@media (max-width: 600px) {
  .main { padding: 16px 12px 32px; }
  .page-title h1 { font-size: 21px; }
  .kpi-value { font-size: 24px; }
  .toolbar .input { flex: 1 1 100%; min-width: 0; }
  .toolbar .btn { flex: 1 1 calc(50% - 5px); }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1; }
  .chart { gap: 10px; height: 190px; }
  .bar { max-width: 26px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .donut { width: 120px; height: 120px; }
  .login-card { padding: 22px 18px; }
  .login-card h1 { font-size: 30px; }
  .login-sub { font-size: 12px; }
  .login-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .modal { padding: 18px; }
  .modal h2 { font-size: 17px; }
  .code-result .code { font-size: 18px; }
}

@media (max-width: 420px) {
  .stats-grid, .kpi-grid, .kpi-grid.three, .plans-grid { grid-template-columns: 1fr; }
  .login-card { padding: 18px 14px; }
  .login-card h1 { font-size: 27px; }
  .topbar-actions .btn { font-size: 11.5px; padding: 8px 10px; }
}
