:root {
  --bg-main: #0b0714;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-sidebar: #0f0a1c;
  --bg-header: #0f0a1c;
  --bg-panel-header: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --primary-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --sidebar-active: rgba(236, 72, 153, 0.15);
  --sidebar-active-border: #ec4899;
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.03);
  --sidebar-hover-text: #ffffff;
  --glow-shadow: 0 4px 20px rgba(236, 72, 153, 0.25);
  --sidebar-width: 240px;
  --header-height: 70px;
  --input-bg: rgba(0, 0, 0, 0.3);
  --table-alt-bg: rgba(255, 255, 255, 0.02);
}

[data-theme='light'] {
  --bg-main: #f3f4f6;
  --bg-panel: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-panel-header: #f9fafb;
  --border-color: #e5e7eb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --primary-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --sidebar-active: rgba(219, 39, 119, 0.1);
  --sidebar-active-border: #db2777;
  --sidebar-active-text: #db2777;
  --sidebar-hover-bg: rgba(0, 0, 0, 0.04);
  --sidebar-hover-text: #1f2937;
  --glow-shadow: 0 4px 15px rgba(236, 72, 153, 0.15);
  --input-bg: #ffffff;
  --table-alt-bg: #f9fafb;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  font-size: 14px;
}

body:not([data-theme='light']) {
  background-image:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-header);
  backdrop-filter: blur(10px);
}

.header-left .logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #a1a1aa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-right .points {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-convert {
  padding: 8px 18px;
  background: var(--primary-gradient);
  border: none;
  color: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--glow-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-convert:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(236, 72, 153, 0.35);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  padding-left: 15px;
  border-left: 1px solid var(--border-color);
}

.icon-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-panel-header);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  overflow-y: auto;
  padding: 20px 0;
}

.menu-list {
  list-style: none;
}

.menu-item {
  display: block;
  margin-bottom: 4px;
}

.menu-item a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.menu-item.active a {
  background-color: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--sidebar-active-border);
}

.menu-item a:hover:not(.active) {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-text);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.page-header {
  margin-bottom: 30px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.page-header span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 15px;
}

/* Panels */
.panel {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.panel-header {
  background-color: var(--bg-panel-header);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-body {
  padding: 24px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  color: var(--text-main);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 500;
  width: 25%;
}

.data-table tr:last-child th,
.data-table tr:last-child td {
  border-bottom: none;
}

.data-table.grid-style th,
.data-table.grid-style td {
  border: 1px solid var(--border-color);
  text-align: center;
}

.data-table.grid-style th {
  background-color: var(--table-alt-bg);
}

.text-red {
  color: #f87171 !important;
  font-weight: 600;
}

.flex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.btn-small {
  padding: 6px 16px;
  background: var(--primary-gradient);
  border: none;
  color: white;
  border-radius: 15px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--glow-shadow);
  transition: opacity 0.2s;
}

.btn-small:hover {
  opacity: 0.9;
}

/* Responsive Design */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  margin-right: 15px;
}

@media (max-width: 1024px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-left {
    display: flex;
    align-items: center;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    height: calc(100vh - var(--header-height));
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    left: 0;
  }

  .header {
    padding: 0 15px;
  }

  .header-right {
    gap: 10px;
  }

  .header-left .logo {
    font-size: 16px;
  }

  .user-info {
    font-size: 0;
    gap: 0;
    padding-left: 10px;
  }

  .icon-user {
    margin: 0;
  }

  .panel-body {
    overflow-x: auto;
    padding: 15px;
  }

  .data-table th,
  .data-table td {
    padding: 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .content-area {
    padding: 15px;
  }
}

/* Forms & Utility Buttons */
.form-input,
.form-select {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}

.form-input:focus,
.form-select:focus {
  border-color: #8b5cf6;
}

.form-select option {
  background: var(--bg-panel);
}

.btn-blue {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  color: #60a5fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-blue:hover {
  background: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.btn-red {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #f87171;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-red:hover {
  background: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-grey {
  background: rgba(107, 114, 128, 0.2);
  border: 1px solid #6b7280;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-grey:hover {
  background: rgba(107, 114, 128, 0.4);
}