:root {
  --bg: #0b0f1a;
  --surface: #131928;
  --surface2: #1a2235;
  --border: rgba(255,255,255,0.06);
  --accent: #00e5c3;
  --accent2: #ff6b6b;
  --accent3: #7c6ff7;
  --text: #e8edf5;
  --muted: #6b7a99;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 2px; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 1.6rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.02em;
  color: var(--text);
}

.brand-mark span { color: var(--accent); }

.brand-version {
  font-size: .72rem;
  color: var(--muted);
  margin-top: .2rem;
}

.sidebar-section-label {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .9rem 1.5rem .3rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); }

.nav-item { margin: .1rem .75rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .9rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: all .2s;
  text-decoration: none;
}

.nav-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(0,229,195,.08);
}

.nav-link .badge-pill {
  margin-left: auto;
  font-size: .65rem;
  padding: .15em .55em;
  border-radius: 20px;
  background: rgba(255,107,107,.18);
  color: var(--accent2);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info .name {
  font-weight: 600;
  font-size: .85rem;
  line-height: 1.2;
}

.user-info .role {
  color: var(--muted);
  font-size: .72rem;
}

.sidebar-more {
  color: var(--muted);
  cursor: pointer;
  margin-left: auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 64px;
  background: rgba(11,15,26,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  z-index: 999;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
}

.search-box { position: relative; }

.search-box input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: .45rem 1rem .45rem 2.2rem;
  font-size: .82rem;
  width: 220px;
  transition: border-color .2s;
}

.search-box input::placeholder { color: var(--muted); }

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box .search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .85rem;
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.topbar-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.15);
}

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid var(--bg);
  position: absolute;
  top: 6px;
  right: 6px;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
}

.main-content {
  margin-left: var(--sidebar-w);
  padding: calc(64px + 1.75rem) 1.75rem 2rem;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0;
}

.page-header p {
  color: var(--muted);
  font-size: .82rem;
  margin: .2rem 0 0;
}

.btn-primary-custom {
  background: var(--accent);
  border: none;
  color: #0b0f1a;
  font-weight: 700;
  font-size: .8rem;
  padding: .55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: opacity .2s;
}

.btn-primary-custom:hover { opacity: .85; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.12);
}

.stat-card .glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: .12;
  filter: blur(24px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: .9rem;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .2rem;
}

.stat-label {
  color: var(--muted);
  font-size: .8rem;
}

.stat-change {
  font-size: .72rem;
  font-weight: 600;
  margin-top: .5rem;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.change-up { color: var(--accent); }
.change-down { color: var(--accent2); }

.card-dark {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.card-header-custom {
  padding: 1.25rem 1.5rem .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-custom h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  margin: 0;
}

.card-header-custom .subtitle {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .15rem;
}

.tag {
  font-size: .7rem;
  font-weight: 600;
  padding: .25em .7em;
  border-radius: 20px;
}

.tag-green { background: rgba(0,229,195,.12); color: var(--accent); }
.tag-red { background: rgba(255,107,107,.12); color: var(--accent2); }
.tag-purple { background: rgba(124,111,247,.12); color: var(--accent3); }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 1rem 1.5rem .5rem;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  min-height: 8px;
  transition: opacity .2s;
}

.bar:hover { opacity: .8; }

.bar-label {
  font-size: .65rem;
  color: var(--muted);
}

.chart-footer {
  padding: .5rem 1.5rem 1rem;
  display: flex;
  gap: 1.5rem;
}

.chart-footer span {
  font-size: .75rem;
  color: var(--muted);
}

.table-dark-custom {
  color: var(--text);
  margin: 0;
}

.table-dark-custom thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  background: transparent;
}

.table-dark-custom tbody td {
  border-bottom: 1px solid var(--border);
  padding: .8rem 1.5rem;
  vertical-align: middle;
  background: transparent;
}

.table-dark-custom tbody tr:last-child td { border-bottom: none; }

.table-dark-custom tbody tr:hover td { background: var(--surface2); }

.td-id {
  color: var(--muted);
  font-size: .78rem;
}

.td-product { color: var(--muted); }

.td-amount { font-weight: 600; }

.user-cell {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .25em .75em;
  border-radius: 20px;
  display: inline-block;
}

.status-paid { background: rgba(0,229,195,.12); color: var(--accent); }
.status-pending { background: rgba(255,200,60,.12); color: #ffc83c; }
.status-failed { background: rgba(255,107,107,.12); color: var(--accent2); }

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
}

.spark-bar {
  flex: 1;
  border-radius: 3px;
  min-height: 3px;
}

.target-body {
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.target-row { display: flex; flex-direction: column; gap: .35rem; }

.target-meta {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
}

.progress-custom {
  height: 6px;
  border-radius: 4px;
  background: var(--surface2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
}

.activity-item {
  display: flex;
  gap: .9rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  margin-top: 1px;
}

.activity-text {
  font-size: .82rem;
  line-height: 1.5;
}

.activity-time {
  font-size: .7rem;
  color: var(--muted);
  margin-top: .2rem;
}

.donut-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 1rem auto;
}

.donut-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  text-align: center;
}

.donut-label .val {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.donut-label .sub {
  font-size: .65rem;
  color: var(--muted);
}

.donut-legend {
  padding: 0 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: .4rem;
}

.see-all-link {
  font-size: .75rem;
  color: var(--accent);
  text-decoration: none;
}

.see-all-link:hover { text-decoration: underline; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-card, .card-dark {
  animation: fadeUp .4s ease both;
}

.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .1s; }
.stat-card:nth-child(3) { animation-delay: .15s; }
.stat-card:nth-child(4) { animation-delay: .2s; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
}
