:root{
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* Neutral palette (light) */
  --bg: #0b0c0f; /* used as dark default fallback */
  --bg-0: #ffffff;
  --bg-1: #fafafa;
  --bg-2: #f5f5f5;
  --surface-0: rgba(255,255,255,.72);
  --surface-1: rgba(255,255,255,.86);
  --surface-2: #ffffff;
  --border: rgba(10,10,10,.10);
  --border-2: rgba(10,10,10,.16);

  --text-0: #0a0a0a;
  --text-1: rgba(10,10,10,.78);
  --text-2: rgba(10,10,10,.60);
  --muted: rgba(10,10,10,.46);

  --primary: #0f172a; /* slate-900 */
  --accent: #5b7cfa;  /* tech blue */
  --accent-2: #7c5cff;/* violet */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 10px 30px rgba(0,0,0,.10);
  --shadow-lg: 0 25px 80px rgba(0,0,0,.16);

  --glow: 0 0 0 3px rgba(91,124,250,.16), 0 0 30px rgba(91,124,250,.22);
  --glow-strong: 0 0 0 3px rgba(124,92,255,.18), 0 0 45px rgba(124,92,255,.22);

  --blur: 14px;
  --grid-gap: 16px;

  --topbar-h: 56px;
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 84px;
}

html[data-theme="dark"]{
  --bg-0: #07090d;
  --bg-1: #0b0c0f;
  --bg-2: #0f1116;
  --surface-0: rgba(15,17,22,.62);
  --surface-1: rgba(15,17,22,.78);
  --surface-2: rgba(15,17,22,.92);
  --border: rgba(255,255,255,.10);
  --border-2: rgba(255,255,255,.16);

  --text-0: rgba(255,255,255,.92);
  --text-1: rgba(255,255,255,.72);
  --text-2: rgba(255,255,255,.56);
  --muted: rgba(255,255,255,.44);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow: 0 12px 40px rgba(0,0,0,.52);
  --shadow-lg: 0 26px 90px rgba(0,0,0,.62);
}

/* Tune glow strength per theme */
html[data-theme="light"]::before{ opacity: .32; }
html[data-theme="light"]::after{ opacity: .22; }
html[data-theme="dark"]::before{ opacity: .92; }
html[data-theme="dark"]::after{ opacity: .70; }

/* Base */
*{ box-sizing:border-box; }
html,body{ height:100%; }
html{
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-0), var(--bg-1));
}
body{
  margin:0;
  font-family: var(--font-sans);
  position: relative;
  z-index: 1;
  background: transparent;
  color: var(--text-0);
}

/* Animated background glow (2 soft layers, no seams) */
html::before,
html::after{
  content:"";
  position: fixed;
  /* huge overscan: avoids any edge seam even with transforms */
  inset: -80vmax;
  pointer-events: none;
  z-index: 0;
  transform: translate3d(0,0,0);
  will-change: transform, opacity;
}

/* Main glow layer */
html::before{
  opacity: .85;
  mix-blend-mode: screen;
  filter: blur(26px) saturate(1.25);
  background:
    radial-gradient(920px 720px at 18% 22%, rgba(91,124,250,.36), transparent 60%),
    radial-gradient(860px 680px at 78% 16%, rgba(124,92,255,.30), transparent 62%),
    radial-gradient(940px 760px at 55% 88%, rgba(91,124,250,.22), transparent 64%),
    radial-gradient(720px 560px at 52% 46%, rgba(124,92,255,.16), transparent 62%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  animation: glowFloatA 14s ease-in-out infinite;
}

/* Secondary glow layer (adds depth) */
html::after{
  opacity: .62;
  mix-blend-mode: screen;
  filter: blur(44px) saturate(1.2);
  background:
    radial-gradient(760px 560px at 10% 86%, rgba(124,92,255,.24), transparent 60%),
    radial-gradient(740px 560px at 92% 78%, rgba(91,124,250,.22), transparent 62%),
    radial-gradient(660px 520px at 48% 10%, rgba(124,92,255,.18), transparent 58%);
  animation: glowFloatB 20s ease-in-out infinite;
}

@keyframes glowFloatA{
  0%{ transform: translate3d(-2%, -1%, 0) scale(1.06); }
  50%{ transform: translate3d(2%, -2%, 0) scale(1.10); }
  100%{ transform: translate3d(-1%, 2%, 0) scale(1.08); }
}

@keyframes glowFloatB{
  0%{ transform: translate3d(2%, 1%, 0) scale(1.10); }
  50%{ transform: translate3d(-2%, 2%, 0) scale(1.14); }
  100%{ transform: translate3d(1%, -2%, 0) scale(1.12); }
}

/* Focus visibility */
:focus-visible{
  outline: none;
  box-shadow: var(--glow);
}

/* Scrollbars (subtle) */
*{ scrollbar-color: rgba(255,255,255,.12) transparent; }
html[data-theme="light"] *{ scrollbar-color: rgba(10,10,10,.18) transparent; }

a{ color: inherit; text-decoration:none; }
button,input,select,textarea{ font: inherit; color: inherit; }

::selection{ background: rgba(91,124,250,.22); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html::before{ animation: none !important; }
}

/* Layout shell */
.layout-shell{
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height:100vh;
}

.sidebar{
  position: sticky;
  top:0;
  height:100vh;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), rgba(255,255,255,0));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

html[data-theme="dark"] .sidebar{
  background: linear-gradient(180deg, var(--surface-2), rgba(15,17,22,0));
}

.sidebar-inner{
  display:flex;
  flex-direction:column;
  gap:12px;
  height:100%;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

.brand-mark{
  width:34px; height:34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91,124,250,.95), rgba(124,92,255,.9));
  box-shadow: var(--glow);
  object-fit: cover;
  display: block;
}

.brand-text{
  display:flex; flex-direction:column; line-height:1.1;
}
.brand-text .title{ font-weight:700; font-size: 14px; }
.brand-text .subtitle{ font-size: 12px; color: var(--text-2); }

.nav{
  display:flex; flex-direction:column; gap:6px;
}
.nav-section{
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-1);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-item:hover{
  background: rgba(91,124,250,.08);
  border-color: rgba(91,124,250,.16);
  transform: translateY(-1px);
}
.nav-item.active{
  background: rgba(91,124,250,.12);
  border-color: rgba(91,124,250,.26);
  color: var(--text-0);
  box-shadow: var(--glow);
}
.nav-icon{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid; place-items:center;
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
  color: var(--text-1);
}
html[data-theme="dark"] .nav-icon{ background: rgba(255,255,255,.03); }
html[data-theme="dark"] .nav-icon{ color: var(--text-1); }

.nav-icon svg{ display:block; }

.sidebar-message{
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(91,124,250,.04);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.sidebar-message .message-text{
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-2);
  text-align: center;
  font-weight: 500;
  letter-spacing: .02em;
}

.sidebar-footer{
  margin-top:auto;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.main{
  min-width:0;
}

.topbar{
  position: sticky;
  top:0;
  z-index: 20;
  height: var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-0);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.topbar-title{
  display:flex; flex-direction:column; gap:2px;
}
.topbar-title h1{
  margin:0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}
.topbar-title p{
  margin:0;
  font-size: 12px;
  color: var(--text-2);
}

.topbar-actions{ display:flex; align-items:center; gap:10px; }

.content{
  padding: 18px;
}

.grid{
  display:grid;
  gap: var(--grid-gap);
}
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-1{ grid-template-columns: 1fr; }

@media (max-width: 1024px){
  .layout-shell{ grid-template-columns: 1fr; }
  .sidebar{ position: fixed; left:0; top:0; transform: translateX(-105%); transition: transform .22s ease; width: min(92vw, var(--sidebar-w)); z-index: 50; }
  .sidebar.open{ transform: translateX(0); }
  .topbar{ padding-left: 12px; padding-right: 12px; }
}

/* Sidebar collapsed (desktop) */
html[data-sidebar="collapsed"] .layout-shell{ grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
html[data-sidebar="collapsed"] .sidebar{ padding: 14px 10px; }
html[data-sidebar="collapsed"] .brand-text{ display:none; }
html[data-sidebar="collapsed"] .nav-item span.label{ display:none; }
html[data-sidebar="collapsed"] .nav-section{ display:none; }

/* Components */
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
.card .card-h{
  padding: 14px 14px 0 14px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.card .card-h .h-title{ margin:0; font-weight:700; font-size: 13px; }
.card .card-h .h-sub{ margin:0; color: var(--text-2); font-size: 12px; }
.card .card-b{ padding: 14px; }

.chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 12px;
}
.chip.dot::before{
  content:"";
  width: 7px; height:7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,124,250,.16);
}
.chip.success{ border-color: rgba(22,163,74,.25); }
.chip.success.dot::before{ background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.16); }
.chip.warn{ border-color: rgba(245,158,11,.25); }
.chip.warn.dot::before{ background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.chip.danger{ border-color: rgba(239,68,68,.25); }
.chip.danger.dot::before{ background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.16); }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-0);
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
  user-select:none;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn:active{ transform: translateY(0); }
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

.btn-primary{
  border-color: rgba(91,124,250,.28);
  background: linear-gradient(135deg, rgba(91,124,250,.96), rgba(124,92,255,.92));
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover{ box-shadow: var(--glow-strong); border-color: rgba(124,92,255,.30); }

.btn-danger{
  border-color: rgba(239,68,68,.30);
  background: linear-gradient(135deg, rgba(239,68,68,.92), rgba(244,63,94,.88));
  color:#fff;
}

.icon-btn{
  width: 40px; height: 40px;
  padding: 0;
}

/* Small tech icon toggle (used for expand/collapse etc.) */
.icon-tech{
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}
html[data-theme="light"] .icon-tech{
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.icon-tech:hover{
  transform: translateY(-1px);
  border-color: rgba(91,124,250,.36);
  color: var(--text-0);
  box-shadow: var(--glow);
}
.icon-tech:active{ transform: translateY(0); }
.icon-tech:focus-visible{ box-shadow: var(--glow-strong); }
.icon-tech.is-open{
  border-color: rgba(124,92,255,.38);
  box-shadow: var(--glow-strong);
}

/* Icon tech variants */
.icon-tech.icon-danger{ border-color: rgba(239,68,68,.28); color: rgba(239,68,68,.95); }
.icon-tech.icon-danger:hover{ border-color: rgba(239,68,68,.40); box-shadow: 0 0 0 3px rgba(239,68,68,.16), 0 0 34px rgba(239,68,68,.22); }
.icon-tech.icon-info{ border-color: rgba(91,124,250,.28); color: rgba(91,124,250,.96); }
.icon-tech.icon-info:hover{ border-color: rgba(91,124,250,.40); box-shadow: var(--glow); }
.icon-tech.icon-success{ border-color: rgba(22,163,74,.28); color: rgba(22,163,74,.95); }
.icon-tech.icon-success:hover{ border-color: rgba(22,163,74,.40); box-shadow: 0 0 0 3px rgba(22,163,74,.16), 0 0 34px rgba(22,163,74,.20); }
.icon-tech.icon-warning{ border-color: rgba(245,158,11,.28); color: rgba(245,158,11,.95); }
.icon-tech.icon-warning:hover{ border-color: rgba(245,158,11,.40); box-shadow: 0 0 0 3px rgba(245,158,11,.16), 0 0 34px rgba(245,158,11,.22); }

/* Ghost toggle (no background) */
.icon-ghost{
  border: 0;
  background: transparent;
  box-shadow: none;
  width: 34px; height: 34px;
  border-radius: 12px;
  color: var(--text-1);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: transform .16s ease, color .16s ease, background .16s ease;
}
.icon-ghost:hover{
  transform: translateY(-1px);
  color: var(--text-0);
  background: rgba(255,255,255,.06);
}
html[data-theme="light"] .icon-ghost:hover{ background: rgba(10,10,10,.05); }
.icon-ghost:active{ transform: translateY(0); }
.icon-ghost:focus-visible{ box-shadow: var(--glow); }

.toggle-link{
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text-1);
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.toggle-link:hover{
  color: var(--text-0);
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}
html[data-theme="light"] .toggle-link:hover{ background: rgba(10,10,10,.05); }
.toggle-link:active{ transform: translateY(0); }
.toggle-link.is-open{ color: var(--text-0); }

.input, .select, .textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-0);
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.textarea{ min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(91,124,250,.42);
  box-shadow: var(--glow);
}
.help{ color: var(--text-2); font-size: 12px; }
.label{ font-size: 12px; color: var(--text-1); margin-bottom: 6px; display:block; }

.row{ display:flex; gap: 10px; align-items:center; flex-wrap:wrap; }
.stack{ display:flex; flex-direction:column; gap: 10px; }

.table-wrap{
  overflow:auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
}
table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th{
  text-align:left;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.02);
}
html[data-theme="dark"] thead th{ background: rgba(255,255,255,.03); }
tbody td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}
tbody tr:hover td{ background: rgba(91,124,250,.05); }

.badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-1);
  background: var(--surface-2);
}
.badge.success{ border-color: rgba(22,163,74,.25); color: rgba(22,163,74,.95); }
.badge.danger{ border-color: rgba(239,68,68,.25); color: rgba(239,68,68,.95); }
.badge.warn{ border-color: rgba(245,158,11,.25); color: rgba(245,158,11,.95); }
.badge.info{ border-color: rgba(91,124,250,.25); color: rgba(91,124,250,.95); }

/* Simple top loader */
.top-loader{
  position: fixed;
  top: 0; left:0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, rgba(91,124,250,.95), rgba(124,92,255,.95));
  box-shadow: 0 0 18px rgba(91,124,250,.32);
  z-index: 1000;
  transition: width .22s ease;
}

/* Toast */
.toast-wrap{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.toast{
  min-width: 240px;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  color: var(--text-0);
  transform-origin: 85% 100%;
  animation: toastIn 420ms cubic-bezier(.2, .9, .2, 1) both;
}
.toast .t-title{ font-size: 12px; font-weight: 700; margin:0; }
.toast .t-msg{ font-size: 12px; color: var(--text-1); margin: 4px 0 0 0; }

.toast.is-leaving{
  animation: toastOut 280ms cubic-bezier(.4, 0, 1, 1) both;
}

/* Count badges (chips with more breathing room) */
.badge-count{
  padding: 4px 12px !important;
  margin-left: 10px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
}

/* Inline verified icon (used inside table cells) */
.verified-icon{
  margin-left: 8px;
  color: var(--success);
}

@keyframes toastIn{
  0%{
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(.92);
  }
  60%{
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1.02);
  }
  100%{
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toastOut{
  0%{
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100%{
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(.96);
  }
}


