:root {
  --bg: #000000;
  --bg-panel: #0F0F0F;
  --bg-hover: #1A1A1A;
  --border: #262626;
  --border-light: #333333;
  --text: #FFFFFF;
  --text-sec: #888888;
  --text-ter: #555555;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.15);
  --danger: #FF3B30;
  --danger-glow: rgba(255, 59, 48, 0.15);
  
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Unbounded', -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: text;
  user-select: text;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-ter); }

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

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  position: relative;
  z-index: 1;
}

header {
  height: 70px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

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

main { 
  flex: 1; 
  display: flex; 
  flex-direction: column;
  width: 100%;
  position: relative;
  z-index: 10;
}

.main-center { align-items: center; justify-content: center; }
.main-dashboard { padding-top: 32px; padding-bottom: 48px; display: block; }

footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 11px;
  color: var(--text-ter);
  text-align: center;
  background: var(--bg);
  position: relative;
  z-index: 10;
}

footer a { color: var(--text-sec); transition: 0.2s; text-decoration: none; }
footer a:hover { color: var(--accent); }

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  padding-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}
.btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }
.btn:active { transform: scale(0.98); }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.primary:hover { box-shadow: 0 0 15px var(--accent-glow); opacity: 0.9; }

.btn.danger { color: var(--danger); border-color: rgba(255,59,48,0.3); background: rgba(255,59,48,0.05); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn.sm { height: 32px; padding: 0 12px; font-size: 11px; gap: 6px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn svg { width: 14px; height: 14px; }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
  width: 100%;
}
.card:hover { border-color: var(--border-light); }

.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; }

.center-box { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px 0; }

.tabs { display: flex; background: var(--bg-panel); padding: 4px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 32px; user-select: none; }
.tab { flex: 1; text-align: center; padding: 10px; color: var(--text-sec); cursor: pointer; border-radius: var(--radius-sm); transition: 0.2s var(--ease); font-size: 12px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--bg-hover); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.input { 
  width: 100%; 
  height: 40px; 
  background: var(--bg); 
  border: 1px solid var(--border); 
  color: var(--text); 
  padding: 0 16px; 
  border-radius: var(--radius-sm); 
  font-family: inherit; 
  font-size: 13px; 
  transition: 0.2s;
  
  pointer-events: auto;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}
.input:focus { 
  border-color: var(--accent); 
  box-shadow: 0 0 0 1px var(--accent-glow);
  outline: none; 
}
.label { display: block; font-size: 11px; color: var(--text-ter); margin-bottom: 8px; margin-top: 16px; user-select: none; }
.equal-height { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.equal-height .input, .equal-height .btn { height: 42px; }

.upload-zone { border: 1px dashed var(--border-light); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 100%); padding: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); position: relative; overflow: hidden; user-select: none; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: rgba(168, 85, 247, 0.08); transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); }
.upload-icon { width: 48px; height: 48px; color: var(--text-ter); margin-bottom: 16px; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.upload-zone:hover .upload-icon { color: var(--accent); transform: scale(1.1); }
.upload-text { font-size: 14px; font-weight: 400; color: var(--text); margin-bottom: 6px; text-align: center; }
.upload-hint { font-size: 11px; color: var(--text-ter); text-align: center; }
.upload-zone.uploading { pointer-events: none; background: var(--bg-hover); border-style: solid; border-color: var(--border); }

.list-header { font-size: 11px; color: var(--text-ter); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; padding-left: 8px; user-select: none; }
.item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-panel); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); margin-bottom: 8px; transition: 0.2s; }
.item:hover { transform: translateX(4px); border-color: var(--border-light); }
.item-icon { width: 40px; height: 40px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-sec); flex-shrink: 0; }
.item-icon svg { width: 20px; height: 20px; }
.item-info { flex: 1; margin-left: 16px; min-width: 0; }
.item-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 11px; color: var(--text-ter); margin-top: 4px; font-family: monospace; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); transition: 0.2s; display: flex; flex-direction: column; align-items: flex-start; }
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.stat-icon { color: var(--accent); margin-bottom: 12px; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-val { font-size: 24px; font-weight: 500; color: var(--text); letter-spacing: -0.5px; }
.stat-lbl { font-size: 10px; color: var(--text-ter); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

.empty { padding: 60px 0; text-align: center; color: var(--text-ter); background: var(--bg-panel); border-radius: var(--radius); border: 1px dashed var(--border); display: flex; flex-direction: column; align-items: center; user-select: none; }
.empty-icon { opacity: 0.3; margin-bottom: 16px; display: flex; justify-content: center; }
.empty-icon svg { width: 48px; height: 48px; }
.empty-text { font-size: 13px; color: var(--text-sec); }

@keyframes pulse { 0% { opacity: 0.3; } 50% { opacity: 0.6; } 100% { opacity: 0.3; } }
.skeleton { background: var(--bg-hover); border-radius: var(--radius-sm); animation: pulse 1.5s ease-in-out infinite; }
.sk-card { height: 200px; width: 100%; border-radius: var(--radius); margin-bottom: 24px; }
.sk-head { height: 16px; width: 120px; margin-bottom: 12px; }
.sk-row { height: 74px; width: 100%; margin-bottom: 8px; border-radius: var(--radius); }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.sk-stat { height: 120px; border-radius: var(--radius); }

.progress-container { margin-top: 20px; display: none; }
.progress-bar { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.1s linear; box-shadow: 0 0 10px var(--accent-glow); }
.progress-text { font-size: 11px; color: var(--text-ter); margin-top: 8px; text-align: center; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); z-index: 100; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.modal { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal-title { font-size: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.modal-title svg { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; }
.modal-text { color: var(--text-sec); font-size: 13px; line-height: 1.5; margin-bottom: 24px; user-select: text; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.abuse-notice { font-size: 11px; color: var(--text-ter); text-align: center; margin-top: 24px; }
.abuse-notice a { color: var(--text-sec); text-decoration: underline; }

.hidden { display: none !important; }
.loader { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-sec); margin-left: 8px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .item { flex-direction: column; align-items: flex-start; }
  .item-icon { margin-bottom: 12px; }
  .item-info { margin-left: 0; margin-bottom: 12px; width: 100%; }
  .item-actions { width: 100%; display: flex; gap: 8px; }
  .item-actions .btn { flex: 1; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .equal-height { flex-direction: column; }
}