/* ============================================================
   FBase - Steam Inventory Manager UI (Dark Theme)
   ============================================================ */

:root {
  --background: #09090B;
  --surface: #18181B;
  --surface-hover: #27272A;
  --border: #27272A;
  --text-primary: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --accent: #14B8A6;
  --accent-hover: #0D9488;
  --accent-light: rgba(20,184,166,0.1);
  --success: #10B981;
  --success-bg: rgba(16,185,129,0.1);
  --success-light: rgba(16,185,129,0.15);
  --danger: #EF4444;
  --danger-bg: rgba(239,68,68,0.1);
  --danger-light: rgba(239,68,68,0.15);
  --warning: #F59E0B;
  --warning-bg: rgba(245,158,11,0.1);
  --warning-light: rgba(245,158,11,0.15);
  --info: #6366F1;
  --info-bg: rgba(99,102,241,0.1);
  --info-light: rgba(99,102,241,0.15);
  --purple: #8B5CF6;
  --purple-light: rgba(139,92,246,0.15);
  --orange: #F59E0B;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --sidebar-width: 256px;
  --topbar-height: 64px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  overflow: hidden;
  height: 100vh;
}

/* ---- Layout ---- */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
#sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(39,39,42,0.5);
  flex-shrink: 0;
  height: var(--topbar-height);
}

.logo-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  display: block;
}

.logo-dots span:nth-child(2) {
  background: #fbbf24;
}

.logo-dots span:nth-child(3) {
  background: #fcd34d;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.8px;
}

.sidebar-section {
  padding: 0 16px 4px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 8px;
  margin-bottom: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  position: relative;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(39,39,42,0.5);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(39,39,42,0.8);
  color: white;
  border: 1px solid rgba(255,255,255,0.05);
}

.nav-item.active i {
  color: #14B8A6 !important;
}

.nav-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-item.active .nav-svg,
.nav-item:hover .nav-svg {
  color: var(--text-primary);
}

.nav-badge {
  margin-left: auto;
  background: rgba(99,102,241,0.2);
  color: #818CF8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(39,39,42,0.5);
}

/* ---- Main Content ---- */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#topbar {
  height: var(--topbar-height);
  background: rgba(9,9,11,0.8);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 12px;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-search {
  flex: 1;
  max-width: 320px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-search-input {
  width: 100%;
  padding: 8px 40px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}

.topbar-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}

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

.topbar-search-kbd {
  position: absolute;
  right: 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all .15s;
}

.topbar-icon-btn svg {
  width: 16px;
  height: 16px;
}

.topbar-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

#page-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(39,39,42,0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  font-family: var(--font);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #14B8A6;
  color: #fff;
  border-color: #14B8A6;
}

.btn-primary:hover:not(:disabled) {
  background: #0D9488;
  border-color: #0D9488;
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #3F3F46;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
}

.btn-icon {
  padding: 7px;
  border-radius: var(--radius-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface);
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(39,39,42,0.5);
  transition: background .1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(39,39,42,0.4);
}

tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-success {
  background: rgba(16,185,129,0.15);
  color: #34D399;
  border: 1px solid rgba(16,185,129,0.2);
}

.badge-danger {
  background: rgba(239,68,68,0.15);
  color: #F87171;
  border: 1px solid rgba(239,68,68,0.2);
}

.badge-warning {
  background: rgba(245,158,11,0.15);
  color: #FBBF24;
  border: 1px solid rgba(245,158,11,0.2);
}

.badge-info {
  background: rgba(99,102,241,0.15);
  color: #818CF8;
  border: 1px solid rgba(99,102,241,0.2);
}

.badge-running {
  background: rgba(99,102,241,0.15);
  color: #818CF8;
  border: 1px solid rgba(99,102,241,0.2);
  animation: pulse-badge 2s infinite;
}

.badge-purple {
  background: rgba(139,92,246,0.15);
  color: #A78BFA;
  border: 1px solid rgba(139,92,246,0.2);
}

.badge-gray {
  background: rgba(113,113,122,0.15);
  color: var(--text-muted);
  border: 1px solid rgba(113,113,122,0.2);
}

.badge-sell {
  background: rgba(239,68,68,0.15);
  color: #F87171;
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid rgba(239,68,68,0.2);
}

.badge-buy {
  background: rgba(16,185,129,0.15);
  color: #34D399;
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid rgba(16,185,129,0.2);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---- Status badges (text only) ---- */
.status-text-active { color: var(--text-secondary); font-size: 12px; }
.status-text-completed { color: var(--success); font-size: 12px; font-weight: 500; }
.status-text-running { color: #818CF8; font-size: 12px; font-weight: 500; }
.status-text-queued { color: var(--text-muted); font-size: 12px; }

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--background);
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ---- Input with icon ---- */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-control {
  padding-right: 40px;
}

.input-icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}

.input-icon-btn svg {
  width: 16px;
  height: 16px;
}

.input-icon-btn:hover {
  color: var(--text-secondary);
}

/* ---- Radio Options ---- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--surface);
}

.radio-option:hover {
  border-color: var(--accent);
  background: rgba(20,184,166,0.05);
}

.radio-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.radio-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.radio-option-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* ---- Info box ---- */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--info-bg);
  border: 1px solid var(--info-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ---- Filters Panel ---- */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.3);
}

.filters-panel-collapsible {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
}

.filters-panel-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filters-panel-header:hover {
  background: rgba(39,39,42,0.3);
}

.filters-panel-body {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.filter-control {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--background);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s;
}

.filter-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}

.filter-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  padding-bottom: 1px;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}

.tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ---- Account Avatar ---- */
.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-name {
  font-weight: 500;
  font-size: 13px;
}

.account-steamid {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Item Image ---- */
.item-image {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(39,39,42,0.8);
  flex-shrink: 0;
}

.item-image-sm {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(39,39,42,0.8);
  flex-shrink: 0;
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Rarity Colors ---- */
.rarity-covert { color: #eb4b4b; }
.rarity-classified { color: #d32ce6; }
.rarity-restricted { color: #8847ff; }
.rarity-mil-spec { color: #4b69ff; }
.rarity-industrial { color: #5e98d9; }
.rarity-consumer { color: #b0c3d9; }
.rarity-contraband { color: #e4ae39; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-lg {
  max-width: 820px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: all .15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(9,9,11,0.3);
}

/* ---- Wizard Steps ---- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0 2px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.wizard-step.active .step-num {
  background: var(--accent);
  color: white;
}

.wizard-step.active .step-label {
  color: var(--text-primary);
  font-weight: 600;
}

.wizard-step.done .step-num {
  background: var(--success);
  color: white;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Pricing Strategy ---- */
.pricing-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}

.pricing-option:hover {
  border-color: var(--accent);
  background: rgba(20,184,166,0.05);
}

.pricing-option.selected {
  border-color: var(--accent);
  background: rgba(20,184,166,0.08);
}

.pricing-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.pricing-option-content {
  flex: 1;
}

.pricing-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.pricing-option-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- Batch Items List ---- */
.batch-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
  transition: background .1s;
}

.batch-item-row:hover {
  background: var(--surface-hover);
}

.batch-item-info {
  flex: 1;
  min-width: 0;
}

.batch-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ---- Toast Notifications ---- */
#toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  font-size: 13px;
  font-weight: 500;
  color: white;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-in 0.25s ease;
  backdrop-filter: blur(20px);
}

.toast-success {
  background: rgba(16,185,129,0.9);
  border: 1px solid rgba(16,185,129,0.3);
}

.toast-error {
  background: rgba(239,68,68,0.9);
  border: 1px solid rgba(239,68,68,0.3);
}

.toast-info {
  background: rgba(99,102,241,0.9);
  border: 1px solid rgba(99,102,241,0.3);
}

.toast-warning {
  background: rgba(245,158,11,0.9);
  border: 1px solid rgba(245,158,11,0.3);
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Loading ---- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  font-size: 48px;
  opacity: 0.2;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
}

/* ---- Bottom Action Bar ---- */
.action-bar {
  position: sticky;
  bottom: 0;
  background: rgba(24,24,27,0.95);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  z-index: 50;
  flex-wrap: wrap;
  margin-top: 20px;
  border-radius: 0 0 16px 16px;
  backdrop-filter: blur(20px);
}

.action-bar-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.action-bar-info strong {
  color: var(--text-primary);
}

.action-bar-spacer {
  flex: 1;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid rgba(39,39,42,0.5);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #3F3F46;
}

.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
}

.page-info-left {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: auto;
}

/* ---- Detail Page ---- */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
}

.detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.detail-meta-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Profile Sections ---- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.profile-section-header {
  padding: 12px 16px;
  background: rgba(39,39,42,0.5);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.profile-field {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(39,39,42,0.5);
  gap: 16px;
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.profile-field-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* ---- Custom Checkbox ---- */
.checkbox-cell {
  width: 40px;
  text-align: center;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: #18181B;
  margin: 0;
  width: 1.15em;
  height: 1.15em;
  border: 1px solid #27272A;
  border-radius: 0.25em;
  display: grid;
  place-content: center;
  transition: all 0.2s;
  cursor: pointer;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #18181B;
  background-color: #18181B;
}

input[type="checkbox"]:checked {
  background-color: #14B8A6;
  border-color: #14B8A6;
  box-shadow: 0 0 10px rgba(20,184,166,0.4);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* ---- Search Input ---- */
.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  transition: border-color .15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20,184,166,0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ---- Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- File Upload ---- */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--background);
}

.file-upload:hover {
  border-color: var(--accent);
  background: rgba(20,184,166,0.05);
}

.file-upload-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ---- Tooltip ---- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-hover);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 6px;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ---- Proxy type badges ---- */
.proxy-type-http { color: #818CF8; font-weight: 600; font-size: 12px; }
.proxy-type-https { color: #34D399; font-weight: 600; font-size: 12px; }
.proxy-type-socks4 { color: #A78BFA; font-weight: 600; font-size: 12px; }
.proxy-type-socks5 { color: #FBBF24; font-weight: 600; font-size: 12px; }

/* ---- Job Status Colors ---- */
.status-pending { color: var(--text-muted); }
.status-running { color: #818CF8; }
.status-completed { color: var(--success); }
.status-failed { color: var(--danger); }
.status-cancelled { color: var(--text-muted); }

/* ---- Info Banner ---- */
.info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--info-bg);
  border: 1px solid var(--info-light);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---- Dashboard chart ---- */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding: 0 4px;
}

.chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-width: 4px;
  transition: opacity .15s;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-bar-sell {
  background: #6366F1;
}

.chart-bar-buy {
  background: #14B8A6;
}

/* ---- Inventory selected row highlight ---- */
.selected-row {
  background: rgba(20,184,166,0.05) !important;
}

/* ---- Utility ---- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'Courier New', monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #09090B; }
::-webkit-scrollbar-thumb { background: #27272A; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3F3F46; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  #sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
