
:root{
  --font: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Theme variables (dark default) */
  --bg: #0b1220;
  --bg-2: #0a1020;
  --card: rgba(255,255,255,0.06);
  --card-2: rgba(255,255,255,0.08);
  --border: rgba(148,163,184,0.18);

  --text: #e5e7eb;
  --text-soft: rgba(229,231,235,0.78);
  --text-muted: rgba(229,231,235,0.62);

  --sidebar-bg: rgba(2,6,23,0.72);
  --sidebar-border: rgba(255,255,255,0.08);

  --topbar-bg: rgba(2,6,23,0.35);

  --accent: #4f46e5;
  --accent-2: #ec4899;

  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;

  --shadow: 0 20px 45px rgba(0,0,0,0.35);

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

  --icon: rgba(229,231,235,0.82);
  --icon-soft: rgba(229,231,235,0.58);

  --input-bg: rgba(255,255,255,0.07);
  --input-border: rgba(148,163,184,0.20);

  --btn-text: #ffffff;
}

html[data-theme="light"]{
  /* Light mode fixes: high contrast */
  --bg: #f6f7fb;
  --bg-2: #eef1f8;
  --card: #ffffff;
  --card-2: #ffffff;
  --border: rgba(15,23,42,0.10);

  --text: #0f172a;
  --text-soft: rgba(15,23,42,0.78);
  --text-muted: rgba(15,23,42,0.58);

  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(15,23,42,0.10);

  --topbar-bg: rgba(255,255,255,0.82);

  --icon: rgba(15,23,42,0.80);
  --icon-soft: rgba(15,23,42,0.58);

  --input-bg: rgba(15,23,42,0.04);
  --input-border: rgba(15,23,42,0.14);

  --btn-text: #ffffff;
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 18% 16%, rgba(79,70,229,0.24), transparent 60%),
    radial-gradient(1000px 650px at 84% 18%, rgba(236,72,153,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a{ color: inherit; text-decoration: none; }
button{ font-family: var(--font); }
img{ max-width: 100%; display:block; }

.app{
  min-height:100vh;
  display:flex;
}

.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.content-scroll{
  padding: 1.2rem 1.2rem 2rem;
}

/* Sidebar */
.sidebar{
  width: 290px;
  min-width: 290px;
  padding: 0.9rem;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  backdrop-filter: blur(20px);
  position: sticky;
  top:0;
  height: 100vh;
  overflow: hidden;
  z-index: 20;
  transition: width .25s ease, transform .25s ease;
}

.sidebar-header{
  display:flex;
  align-items:center;
  gap:0.8rem;
  padding: 0.6rem 0.4rem 0.9rem;
  position: relative;
}

.sidebar-logo{
  width:44px;
  height:44px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(79,70,229,0.95), rgba(236,72,153,0.75));
  box-shadow: 0 12px 22px rgba(79,70,229,0.22);
  position: relative;
  overflow:hidden;
}

.sidebar-logo-text{
  color:#fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 14px;
}

.sidebar-logo-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: cover;
  display:none;
}

.sidebar-title{
  display:flex;
  flex-direction:column;
  gap:0.1rem;
  min-width:0;
}
.sidebar-title span:first-child{
  font-weight:700;
  font-size: 13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sidebar-title span:last-child{
  font-size: 11px;
  color: var(--text-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-close-btn{
  position:absolute;
  right: 0.35rem;
  top: 0.5rem;
  display:none; /* only mobile */
}

.sidebar-nav{
  margin-top: 0.2rem;
  display:flex;
  flex-direction:column;
  gap:0.25rem;
  padding-right: 0.1rem;
  height: calc(100vh - 190px);
  overflow:auto;
}

.sidebar-nav::-webkit-scrollbar{ width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb{ background: rgba(148,163,184,0.25); border-radius: 999px; }

.sidebar-nav-section-label{
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
  padding: 0.2rem 0.5rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.nav-item{
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding: 0.7rem 0.7rem;
  border-radius: 14px;
  color: var(--text-soft);
  transition: background .18s ease, transform .18s ease, color .18s ease;
  border: 1px solid transparent;
}
.nav-item i{
  width: 18px;
  text-align:center;
  color: var(--icon);
}
.nav-item:hover{
  background: rgba(79,70,229,0.12);
  transform: translateY(-1px);
  color: var(--text);
}
.nav-item.active{
  background: rgba(79,70,229,0.18);
  border-color: rgba(79,70,229,0.35);
  color: var(--text);
}

.sidebar-footer{
  margin-top: 0.6rem;
  padding: 0.8rem 0.6rem;
  border-top: 1px solid var(--sidebar-border);
  display:flex;
  flex-direction:column;
  gap:0.3rem;
  color: var(--text-muted);
  font-size: 12px;
}
.sidebar-plan-pill{
  display:inline-flex;
  align-items:center;
  gap:0.5rem;
  width: fit-content;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: rgba(255,255,255,0.04);
}

/* Collapsed */
body.sidebar-collapsed .sidebar{
  width: 86px;
  min-width: 86px;
}
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-nav-section-label,
body.sidebar-collapsed .sidebar-footer span{
  display:none;
}
body.sidebar-collapsed .nav-item span{
  display:none;
}
body.sidebar-collapsed .nav-item{
  justify-content:center;
}
body.sidebar-collapsed .sidebar-footer{
  align-items:center;
}
body.sidebar-collapsed .sidebar-plan-pill{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  justify-content:center;
  padding:0;
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0.85rem 1.2rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.topbar-left{
  display:flex;
  align-items:flex-start;
  gap:0.9rem;
  min-width:0;
}
.topbar-title{
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.topbar-subtitle{
  margin-top: 0.15rem;
  font-size: 12px;
  color: var(--text-muted);
}
.topbar-breadcrumb{
  margin-top: 0.35rem;
  font-size: 11px;
  color: var(--text-muted);
  display:flex;
  align-items:center;
  gap: 0.4rem;
}
.breadcrumb-separator{ opacity:0.65; }

.topbar-right{
  display:flex;
  align-items:center;
  gap:0.6rem;
}
.topbar-search{
  width: 280px;
}

.search-input{
  display:flex;
  align-items:center;
  gap:0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-soft);
}
.search-input i{ color: var(--icon-soft); }
.search-input input{
  border:none;
  outline:none;
  background: transparent;
  color: var(--text);
  width:100%;
}
.search-input input::placeholder{ color: var(--text-muted); }

/* Buttons */
.icon-button{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--icon);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.icon-button:hover{ transform: translateY(-1px); border-color: rgba(79,70,229,0.35); background: rgba(79,70,229,0.10); }

.btn-primary, .btn-soft{
  display:inline-flex;
  align-items:center;
  gap:0.55rem;
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  border: 1px solid transparent;
  cursor:pointer;
  font-weight: 600;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--btn-text);
  box-shadow: 0 16px 30px rgba(79,70,229,0.22);
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 18px 36px rgba(79,70,229,0.28); }
.btn-soft{
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="light"] .btn-soft{
  background: rgba(15,23,42,0.04);
}
.btn-soft:hover{ transform: translateY(-1px); border-color: rgba(79,70,229,0.35); background: rgba(79,70,229,0.08); }

.btn-xs{ padding: 0.55rem 0.75rem; border-radius: 12px; font-size: 12px; }

/* Profile */
.profile-wrapper{ position: relative; }
.profile-chip{
  display:flex;
  align-items:center;
  gap:0.65rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  cursor:pointer;
  color: var(--text);
}
.profile-avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(79,70,229,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 700;
  color: var(--text);
}
.profile-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height: 1.1;
}
.profile-text span:first-child{ font-size: 12px; font-weight: 700; }
.profile-text span:last-child{ font-size: 10px; color: var(--text-muted); }
.profile-chevron{ color: var(--icon-soft); font-size: 12px; }

.profile-menu{
  position:absolute;
  right:0;
  top: 56px;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
}
.profile-menu.open{ display:block; }
.profile-menu-item{
  width:100%;
  display:flex;
  align-items:center;
  gap:0.6rem;
  padding: 0.75rem 0.85rem;
  background: transparent;
  border:none;
  color: var(--text);
  cursor:pointer;
  font-size: 13px;
}
.profile-menu-item:hover{ background: rgba(79,70,229,0.10); }

/* Cards & layout */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.10);
}
.card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.card-title{ font-weight: 800; font-size: 15px; }
.card-subtitle{ font-size: 12px; color: var(--text-muted); margin-top: 0.15rem; }
.card-actions{ display:flex; align-items:center; gap: 0.5rem; }

.content-grid{
  display:grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.stats-row{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.stat-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.stat-label{ font-size: 12px; color: var(--text-muted); }
.stat-value-row{
  margin-top: 0.55rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.stat-value{ font-weight: 800; font-size: 20px; }
.stat-value-row i{ color: var(--icon-soft); }

.hero-card{
  background: linear-gradient(135deg, rgba(79,70,229,0.22), rgba(236,72,153,0.14));
  border: 1px solid rgba(79,70,229,0.22);
  border-radius: var(--radius);
  padding: 1rem;
}
.hero-inner{
  display:grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 1rem;
  align-items:stretch;
}
.hero-title{
  font-weight: 900;
  font-size: 20px;
}
.hero-subtitle{
  margin-top: 0.25rem;
  font-size: 12px;
  color: var(--text-soft);
}
.hero-metrics{
  display:flex;
  gap: 0.8rem;
  margin-top: 0.9rem;
  flex-wrap:wrap;
}
.metric{
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(2,6,23,0.24);
  min-width: 140px;
}
html[data-theme="light"] .metric{
  background: rgba(255,255,255,0.78);
  border-color: rgba(15,23,42,0.10);
}
.metric-label{ font-size: 11px; color: var(--text-muted); }
.metric-value{ font-weight: 900; font-size: 18px; }

.hero-cta-row{
  display:flex;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap:wrap;
}

.hero-mini-chart{
  background: rgba(2,6,23,0.26);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 0.9rem;
}
html[data-theme="light"] .hero-mini-chart{
  background: rgba(255,255,255,0.72);
  border-color: rgba(15,23,42,0.10);
}
.hero-mini-chart-header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin-bottom: 0.5rem;
}
.hero-mini-chart-value{ font-weight: 800; }
.hero-mini-chart-meta{ font-size: 12px; color: var(--text-muted); }

.chart-wrapper{
  width:100%;
  height: 300px;
}
.chart-wrapper.mini{ height: 160px; }

.table-wrapper{
  width: 100%;
  overflow:auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 620px;
  background: transparent;
}
thead th{
  font-size: 12px;
  color: var(--text-muted);
  text-align:left;
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] thead th{
  background: rgba(15,23,42,0.03);
}
tbody td{
  padding: 0.75rem 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}
tbody tr:hover{ background: rgba(79,70,229,0.07); }

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:0.45rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.status-pill.pending{
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.12);
  color: var(--text);
}
.status-pill.active{
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.12);
  color: var(--text);
}
.status-pill.inactive{
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.12);
  color: var(--text);
}

.filters-row{
  display:flex;
  gap: 0.8rem;
  flex-wrap:wrap;
}
.filter-field{
  display:flex;
  flex-direction:column;
  gap: 0.35rem;
  min-width: 260px;
}
.filter-field label{
  font-size: 12px;
  color: var(--text-muted);
}
.filter-field input, .filter-field select{
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline:none;
}
.filter-field input::placeholder{ color: var(--text-muted); }

.form-field{
  display:flex;
  flex-direction:column;
  gap: 0.35rem;
}
.form-field label{
  font-size: 12px;
  color: var(--text-muted);
}
.form-field input, .form-field select{
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline:none;
}
.form-field input::placeholder{ color: var(--text-muted); }
.field-help{
  margin-top: 0.2rem;
  font-size: 11px;
  color: var(--text-muted);
}

.profile-form-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0.9rem;
}
.profile-actions-row{
  display:flex;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap:wrap;
}

.toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
}
.toggle-label{ font-weight: 700; }

/* Switch */
.switch{
  position: relative;
  display:inline-block;
  width: 44px;
  height: 26px;
}
.switch input{ opacity:0; width:0; height:0; }
.slider-toggle{
  position:absolute;
  cursor:pointer;
  top:0; left:0; right:0; bottom:0;
  background: rgba(148,163,184,0.35);
  transition:.18s;
  border-radius: 999px;
}
.slider-toggle:before{
  position:absolute;
  content:"";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  transition:.18s;
  border-radius: 999px;
}
.switch input:checked + .slider-toggle{
  background: rgba(34,197,94,0.65);
}
.switch input:checked + .slider-toggle:before{
  transform: translateX(18px);
}

/* Modal */
.modal-backdrop{
  position: fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(2,6,23,0.55);
  z-index: 60;
  padding: 1.2rem;
}
.modal-backdrop.open{ display:flex; }

.modal-card{
  width: min(780px, 96vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-card-wide{ width: min(900px, 98vw); }
.modal-header, .modal-footer{
  padding: 0.9rem 1rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.modal-footer{
  border-bottom: none;
  border-top: 1px solid var(--border);
}
.modal-title{ font-weight: 900; }
.modal-subtitle{ font-size: 12px; color: var(--text-muted); margin-top: 0.15rem; }
.modal-body{ padding: 1rem; }
.modal-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.8rem;
  flex-wrap:wrap;
  margin-bottom: 0.8rem;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  font-size: 12px;
}
html[data-theme="light"] .chip{ background: rgba(15,23,42,0.03); }
.modal-actions{ display:flex; gap: 0.5rem; flex-wrap:wrap; }

.api-list{
  display:flex;
  flex-direction:column;
  gap: 0.6rem;
}
.api-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .api-row{ background: rgba(15,23,42,0.02); }
.api-row-left{ display:flex; flex-direction:column; gap: 0.15rem; }
.api-row-name{ font-weight: 800; font-size: 13px; }
.api-row-tag{ font-size: 11px; color: var(--text-muted); }
.api-toggle{
  display:flex;
  align-items:center;
  gap: 0.65rem;
  color: var(--text-soft);
  font-size: 12px;
}

/* Timeline */
.timeline{
  display:flex;
  flex-direction:column;
  gap: 0.65rem;
}
.timeline-item{
  display:flex;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .timeline-item{ background: rgba(15,23,42,0.02); }
.timeline-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(79,70,229,0.8);
  margin-top: 0.2rem;
}
.timeline-content{ flex:1; }
.timeline-title{ font-weight: 800; font-size: 13px; }
.timeline-meta{ font-size: 11px; color: var(--text-muted); margin-top: 0.2rem; }

/* Profile blocks */
.profile-main{
  display:flex;
  align-items:center;
  gap: 1rem;
  padding: 0.7rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .profile-main{ background: rgba(15,23,42,0.02); }
.profile-avatar-large{
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: rgba(79,70,229,0.20);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 22px;
}
.profile-main-info h2{ margin:0; font-weight: 900; }
.profile-main-info p{ margin: 0.25rem 0 0; color: var(--text-muted); font-size: 12px; }
.profile-tags{ margin-top: 0.55rem; display:flex; gap: 0.5rem; flex-wrap:wrap; }

/* Logo previews */
.logo-preview{
  margin-top: 0.5rem;
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background: rgba(255,255,255,0.03);
}
.logo-preview img{ max-height: 46px; display:none; }

/* Preview mini */
.preview-shell{
  width: 100%;
  height: 200px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow:hidden;
  display:grid;
  grid-template-columns: 220px 1fr;
  background: var(--card);
}
.preview-sidebar{
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}
.preview-main{ display:flex; flex-direction:column; }
.preview-topbar{
  height: 46px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
}
.preview-card-row{
  padding: 0.8rem;
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0.8rem;
}
.preview-card{
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-2);
}

/* API cards for admin */
.api-cards-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}
.api-card{
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
}
.api-card-title{
  font-weight: 900;
}
.api-card-subtitle{
  margin-top: 0.2rem;
  font-size: 12px;
  color: var(--text-muted);
}
.api-card-footer{
  margin-top: 0.8rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.api-state{
  display:inline-flex;
  align-items:center;
  gap:0.45rem;
  font-size: 12px;
  color: var(--text-soft);
}
.api-state i{ color: var(--icon-soft); }
.api-disabled{
  opacity:0.55;
  filter: grayscale(0.2);
}
.api-disabled .btn-primary{
  opacity:0.7;
  pointer-events:none;
}

/* Small info cards */
.stack{ display:flex; flex-direction:column; gap: 0.8rem; }
.info-card{
  display:flex;
  gap: 0.8rem;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
html[data-theme="light"] .info-card{ background: rgba(15,23,42,0.02); }
.info-icon{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(79,70,229,0.14);
  color: var(--text);
}
.info-title{ font-weight: 900; }
.info-subtitle{ font-size: 12px; color: var(--text-muted); margin-top: 0.15rem; }

/* Auth */
.auth-body{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding: 1.2rem;
}

.sliding-auth{
  width: min(980px, 96vw);
}

.auth-slider-container{
  position: relative;
  width: 100%;
  min-height: 560px;
  border-radius: 24px;
  overflow:hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.form-container{
  position:absolute;
  top:0;
  height:100%;
  transition: all .6s ease-in-out;
}

.sign-in-container{
  left:0;
  width: 50%;
  z-index:2;
}
.sign-up-container{
  left:0;
  width:50%;
  opacity:0;
  z-index:1;
}

.auth-slider-container.right-panel-active .sign-in-container{
  transform: translateX(100%);
}
.auth-slider-container.right-panel-active .sign-up-container{
  transform: translateX(100%);
  opacity:1;
  z-index:5;
}

.overlay-container{
  position:absolute;
  top:0;
  left:50%;
  width:50%;
  height:100%;
  overflow:hidden;
  transition: transform .6s ease-in-out;
  z-index:100;
}
.auth-slider-container.right-panel-active .overlay-container{
  transform: translateX(-100%);
}

.overlay{
  background: linear-gradient(135deg, rgba(79,70,229,0.82), rgba(236,72,153,0.70));
  color:#fff;
  position:relative;
  left:-100%;
  height:100%;
  width:200%;
  transform: translateX(0);
  transition: transform .6s ease-in-out;
}
.auth-slider-container.right-panel-active .overlay{
  transform: translateX(50%);
}

.overlay-panel{
  position:absolute;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  top:0;
  height:100%;
  width:50%;
  transform: translateX(0);
  transition: transform .6s ease-in-out;
  padding: 0 2.2rem;
}

.overlay-left{ transform: translateX(-20%); }
.auth-slider-container.right-panel-active .overlay-left{ transform: translateX(0); }

.overlay-right{
  right:0;
  transform: translateX(0);
}
.auth-slider-container.right-panel-active .overlay-right{
  transform: translateX(20%);
}

/* Center content in overlay panels (your request) */
.overlay-center{
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 0.6rem;
}
.overlay-center h2{ margin:0; font-weight: 900; font-size: 24px; }
.overlay-center p{ margin:0; font-size: 13px; opacity: 0.92; max-width: 360px; }

.auth-form-card{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 2rem 2.1rem;
  text-align:center;
}
.auth-title{ margin:0; font-weight: 900; font-size: 24px; }
.auth-subtitle{ margin: 0.35rem 0 1.2rem; font-size: 12px; color: var(--text-muted); }

.auth-form{
  width:100%;
  max-width: 360px;
  display:flex;
  flex-direction:column;
  gap: 0.85rem;
}
.auth-form .form-field{ text-align:left; }
.auth-form .form-field input{
  width:100%;
}
.auth-btn{
  width:100%;
  justify-content:center;
  margin-top: 0.2rem;
}
.auth-link{
  font-size: 12px;
  color: var(--text-soft);
}
.auth-link:hover{ color: var(--text); text-decoration: underline; }
.auth-footer-text{ margin-top: 1rem; font-size: 12px; color: var(--text-muted); }

.overlay-btn{ padding: 0.75rem 1.0rem; border-radius: 16px; }
.auth-divider{ height:1px; width:100%; background: var(--border); margin: 1.2rem 0; }
.auth-links-row{ display:flex; justify-content:center; gap: 0.7rem; }
.auth-info{
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.12);
  font-size: 12px;
  display:flex;
  align-items:center;
  gap: 0.55rem;
  justify-content:center;
}

.auth-single-card{
  width: min(520px, 96vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

/* Mobile */
.mobile-backdrop{
  position: fixed;
  inset:0;
  background: rgba(2,6,23,0.55);
  z-index: 19;
  display:none;
}
.mobile-backdrop.open{ display:block; }

@media (max-width: 1100px){
  .stats-row{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content-grid{ grid-template-columns: 1fr; }
  .profile-form-grid{ grid-template-columns: 1fr 1fr; }
  .api-cards-grid{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px){
  .sidebar{
    position: fixed;
    left:0;
    top:0;
    transform: translateX(-110%);
    box-shadow: var(--shadow);
  }
  .sidebar.open{ transform: translateX(0); }
  .sidebar-close-btn{ display:inline-flex; }
  body.sidebar-collapsed .sidebar{
    width: 290px;
    min-width: 290px;
  }
  body.sidebar-collapsed .sidebar-title,
  body.sidebar-collapsed .sidebar-nav-section-label,
  body.sidebar-collapsed .sidebar-footer span{ display:block; }
  body.sidebar-collapsed .nav-item span{ display:inline; }
  body.sidebar-collapsed .nav-item{ justify-content:flex-start; }
  .topbar-search{ display:none; }
  table{ min-width: 520px; }
}

@media (max-width: 600px){
  .profile-form-grid{ grid-template-columns: 1fr; }
  .api-cards-grid{ grid-template-columns: 1fr; }

  /* Auth: switch to stacked */
  .auth-slider-container{
    min-height: unset;
  }
  .overlay-container{ display:none; }
  .form-container{
    position: relative;
    width:100% !important;
    transform:none !important;
    opacity:1 !important;
  }
  .sign-in-container, .sign-up-container{
    left:0;
  }
  .auth-slider-container.right-panel-active .sign-in-container{
    display:none;
  }
  .auth-slider-container:not(.right-panel-active) .sign-up-container{
    display:none;
  }
}
