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

:root {
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --success: #10B981;
  --danger: #EF4444;
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-input: #334155;
  --border: #475569;
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.login-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
  font-family: inherit;
}
.login-input:focus { border-color: var(--primary); }
.login-input::placeholder { color: var(--text-muted); }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 24px; }
.header-title { font-size: 18px; font-weight: 700; }

/* Stats */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 20px 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-number { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Section */
.section {
  padding: 20px 24px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Generate form */
.generate-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-select, .form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-select:focus, .form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-muted); }

.btn-generate {
  margin-top: 4px;
}

/* Generated result */
.generated-result {
  margin-top: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 16px;
}
.generated-result h3 {
  font-size: 14px;
  color: var(--success);
  margin-bottom: 12px;
}

.generated-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 8px;
}
.generated-item:last-child { margin-bottom: 0; }

.gen-info { flex: 1; min-width: 0; }
.gen-id { font-size: 13px; font-weight: 600; color: var(--primary); }
.gen-url {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-copy:hover { border-color: var(--primary); color: var(--text); }
.btn-copy.copied { background: var(--success); color: white; border-color: var(--success); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-bar .form-select { width: auto; min-width: 120px; }

/* Tag table */
.tag-table { overflow-x: auto; }

.tag-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.tag-id { font-weight: 600; font-size: 13px; color: var(--primary); min-width: 100px; }
.tag-project {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-input);
  border-radius: 4px;
  color: var(--text-secondary);
}
.tag-url {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.tag-status.unused { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.tag-status.used { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.tag-actions { display: flex; gap: 6px; }
.btn-small {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.btn-small:hover { border-color: var(--primary); color: var(--text); }
.btn-small.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  transition: transform 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); }
